You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Alex Rayan <al...@gmail.com> on 2007/10/18 00:24:31 UTC

XmlBeans behaving different in service

Hi ,

   I'm using org.apache.xmlbeans.2.3.0.
   Using Eclipse/maven2/OSGI for development/deployment.

   I've generated the java classes from  the xsd document.
   And using those classes I generate my request XML.

   This works fine when I run this within Eclipse.

   But when I deploy my  application as a service in a OSGI container,
   the xml generated doesnt have the xsi:type in the XML.

   Server is external and it rejects the xml without this xsi:type.

   XML generated when run as standalone .

 <entry xsi:type="userAddition" xmlns:user="http://www.abc.com/schemas/user
">
       <user:firstName>Beena</user:firstName>
       <user:lastName>Nambiar</user:lastName>
 </entry>


   XML generated when deployed as a service

 <entry xmlns:user="http://www.abc.com/schemas/user">
       <user:firstName>Beena</user:firstName>
       <user:lastName>Nambiar</user:lastName>
 </entry>


 My pom file has these dependencies currently listed

   org.apache.xmlbeans
        xmlbeans
        xmlbeans-qname
        xmlbeans-xpath
        xmlbeans-xmlpublic

  Any idea why the behavior is different in standalone environment and
container  ?
  Any other dependencies I need to add to make this work in a service
environment. ?
Thanx

-Alex

Re: XmlBeans behaving different in service

Posted by Alex Rayan <al...@gmail.com>.
Hi Cezar,

    I'm not sure how to verify the marshaller part . Not a java guru yet :-)

    If I print the schemaType() of that object,  it prints it correctly.
    I  stick this object on the MessageDocument instance, and print the
generated xml from MessageDocument.

   'The following attributes  are missing    in the generated XML.

    xsi:type="userAddition"
   "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"

   Any suggestions on how to verify if it gets marshalled/loaded correctly ?

   Thanx

-Alex






On 10/18/07, Cezar Andrei <ce...@bea.com> wrote:
>
>  Alex,
>
>
>
> You have to make sure that the marshaller has access to the xbean jar you
> generated from the schema.
>
> In other words, the marshaller finds the required schema type in the
> contextTypeLoader, see org.apache.xmlbeans.XmlBeans.getContextTypeLoader
> ().
>



Cezar
>
>
>   ------------------------------
>
> *From:* Alex Rayan [mailto:alex.rayan@gmail.com]
> *Sent:* Wednesday, October 17, 2007 6:07 PM
> *To:* user@xmlbeans.apache.org
> *Subject:* Re: XmlBeans behaving different in service
>
>
>
>  I do not  use Axis in my project. (And I do not have access to the server
> side)
>  Its RPC style payload.
>
>  And  the XML gets generated in Eclipse real good.
>  Only in when I deploy it as a service the xsi:type=blablabla  disappears
> in the final xml.
>
>  My google search returns similar problem reported (but no solutions
> posted there )
> by another user.
>   http://mail-archives.apache.org/mod_mbox/ws-axis-user/200701.mbox/%3c8d2a81130701171341p55f95b70o7f144ea7d941639a@mail.gmail.com%3e
>
>
> -Alex
>
>
>  On 10/17/07, *Jacob Danner* <ja...@gmail.com> wrote:
>
> This is just a guess, but is the endpoint (server) needing an RPC/encoded
> payload?
> Otherwise are you using Axis in your container? If so which version? Are
> you seeing: http://issues.apache.org/jira/browse/AXIS2-2578<https://issues.apache.org/jira/browse/AXIS2-2578>
>
> thanks,
> -Jacobd
>
>
>
> On 10/17/07, *Alex Rayan* < alex.rayan@gmail.com > wrote:
>
> Hi ,
>
>    I'm using org.apache.xmlbeans.2.3.0.
>    Using Eclipse/maven2/OSGI for development/deployment.
>
>    I've generated the java classes from  the xsd document.
>    And using those classes I generate my request XML.
>
>    This works fine when I run this within Eclipse.
>
>    But when I deploy my  application as a service in a OSGI container,
>    the xml generated doesnt have the xsi:type in the XML.
>
>    Server is external and it rejects the xml without this xsi:type.
>
>    XML generated when run as standalone .
>
>  <entry xsi:type="userAddition" xmlns:user="http://www.abc.com/schemas/user">
>
>        <user:firstName>Beena</user
>
> :firstName>
>        <user:lastName>Nambiar</user:lastName>
>  </entry>
>
>
>    XML generated when deployed as a service
>
>  <entry xmlns:user="http://www.abc.com/schemas/user ">
>        <user:firstName>Beena</user:firstName>
>        <user:lastName>Nambiar</user:lastName>
>  </entry>
>
>
>  My pom file has these dependencies currently listed
>
>    org.apache.xmlbeans
>         xmlbeans
>         xmlbeans-qname
>         xmlbeans-xpath
>         xmlbeans-xmlpublic
>
>   Any idea why the behavior is different in standalone environment and
> container  ?
>   Any other dependencies I need to add to make this work in a service
> environment. ?
> Thanx
>
> -Alex
>
>
>
>
>
> Notice: This email message, together with any attachments, may contain
> information of BEA Systems, Inc., its subsidiaries and affiliated entities,
> that may be confidential, proprietary, copyrighted and/or legally
> privileged, and is intended solely for the use of the individual or entity
> named in this message. If you are not the intended recipient, and have
> received this message in error, please immediately return this by email and
> then delete it.

RE: XmlBeans behaving different in service

Posted by Cezar Andrei <ce...@bea.com>.
Alex,

 

You have to make sure that the marshaller has access to the xbean jar
you generated from the schema.

In other words, the marshaller finds the required schema type in the
contextTypeLoader, see
org.apache.xmlbeans.XmlBeans.getContextTypeLoader().

 

Cezar

 

________________________________

From: Alex Rayan [mailto:alex.rayan@gmail.com] 
Sent: Wednesday, October 17, 2007 6:07 PM
To: user@xmlbeans.apache.org
Subject: Re: XmlBeans behaving different in service

 

 I do not  use Axis in my project. (And I do not have access to the
server side)
 Its RPC style payload.

 And  the XML gets generated in Eclipse real good. 
 Only in when I deploy it as a service the xsi:type=blablabla
disappears in the final xml. 

 My google search returns similar problem reported (but no solutions
posted there )
by another user.
 
http://mail-archives.apache.org/mod_mbox/ws-axis-user/200701.mbox/%3c8d2
a81130701171341p55f95b70o7f144ea7d941639a@mail.gmail.com%3e 

-Alex




On 10/17/07, Jacob Danner <ja...@gmail.com> wrote:

This is just a guess, but is the endpoint (server) needing an
RPC/encoded payload?
Otherwise are you using Axis in your container? If so which version? Are
you seeing: http://issues.apache.org/jira/browse/AXIS2-2578
<https://issues.apache.org/jira/browse/AXIS2-2578> 

thanks,
-Jacobd

 

On 10/17/07, Alex Rayan < alex.rayan@gmail.com > wrote:

Hi ,

   I'm using org.apache.xmlbeans.2.3.0.
   Using Eclipse/maven2/OSGI for development/deployment. 
  
   I've generated the java classes from  the xsd document.
   And using those classes I generate my request XML. 

   This works fine when I run this within Eclipse.
   
   But when I deploy my  application as a service in a OSGI container, 
   the xml generated doesnt have the xsi:type in the XML.

   Server is external and it rejects the xml without this xsi:type. 

   XML generated when run as standalone .

 <entry xsi:type="userAddition" xmlns:user="
http://www.abc.com/schemas/user <http://www.abc.com/schemas/user> ">
       <user:firstName>Beena</user

:firstName>
       <user:lastName>Nambiar</user:lastName>
 </entry>


   XML generated when deployed as a service

 <entry xmlns:user="http://www.abc.com/schemas/user ">
       <user:firstName>Beena</user:firstName> 
       <user:lastName>Nambiar</user:lastName>
 </entry>

 
 My pom file has these dependencies currently listed

   org.apache.xmlbeans
        xmlbeans
        xmlbeans-qname 
        xmlbeans-xpath
        xmlbeans-xmlpublic

  Any idea why the behavior is different in standalone environment and
container  ?
  Any other dependencies I need to add to make this work in a service
environment. ? 
Thanx

-Alex





 


Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

Re: XmlBeans behaving different in service

Posted by Alex Rayan <al...@gmail.com>.
 I do not  use Axis in my project. (And I do not have access to the server
side)
 Its RPC style payload.

 And  the XML gets generated in Eclipse real good.
 Only in when I deploy it as a service the xsi:type=blablabla  disappears in
the final xml.

 My google search returns similar problem reported (but no solutions posted
there )
by another user.

http://mail-archives.apache.org/mod_mbox/ws-axis-user/200701.mbox/%3c8d2a81130701171341p55f95b70o7f144ea7d941639a@mail.gmail.com%3e


-Alex



On 10/17/07, Jacob Danner <ja...@gmail.com> wrote:
>
> This is just a guess, but is the endpoint (server) needing an RPC/encoded
> payload?
> Otherwise are you using Axis in your container? If so which version? Are
> you seeing: http://issues.apache.org/jira/browse/AXIS2-2578<https://issues.apache.org/jira/browse/AXIS2-2578>
>
> thanks,
> -Jacobd
>
> On 10/17/07, Alex Rayan <alex.rayan@gmail.com > wrote:
> >
> > Hi ,
> >
> >    I'm using org.apache.xmlbeans.2.3.0.
> >    Using Eclipse/maven2/OSGI for development/deployment.
> >
> >    I've generated the java classes from  the xsd document.
> >    And using those classes I generate my request XML.
> >
> >    This works fine when I run this within Eclipse.
> >
> >    But when I deploy my  application as a service in a OSGI container,
> >    the xml generated doesnt have the xsi:type in the XML.
> >
> >    Server is external and it rejects the xml without this xsi:type.
> >
> >    XML generated when run as standalone .
> >
> >  <entry xsi:type="userAddition" xmlns:user="http://www.abc.com/schemas/user
> > ">
> >        <user:firstName>Beena</user:firstName>
> >        <user:lastName>Nambiar</user:lastName>
> >  </entry>
> >
> >
> >    XML generated when deployed as a service
> >
> >  <entry xmlns:user="http://www.abc.com/schemas/user ">
> >        <user:firstName>Beena</user:firstName>
> >        <user:lastName>Nambiar</user:lastName>
> >  </entry>
> >
> >
> >  My pom file has these dependencies currently listed
> >
> >    org.apache.xmlbeans
> >         xmlbeans
> >         xmlbeans-qname
> >         xmlbeans-xpath
> >         xmlbeans-xmlpublic
> >
> >   Any idea why the behavior is different in standalone environment and
> > container  ?
> >   Any other dependencies I need to add to make this work in a service
> > environment. ?
> > Thanx
> >
> > -Alex
> >
>
>

Re: XmlBeans behaving different in service

Posted by Jacob Danner <ja...@gmail.com>.
This is just a guess, but is the endpoint (server) needing an RPC/encoded
payload?
Otherwise are you using Axis in your container? If so which version? Are you
seeing: http://issues.apache.org/jira/browse/AXIS2-2578<https://issues.apache.org/jira/browse/AXIS2-2578>

thanks,
-Jacobd

On 10/17/07, Alex Rayan <al...@gmail.com> wrote:
>
> Hi ,
>
>    I'm using org.apache.xmlbeans.2.3.0.
>    Using Eclipse/maven2/OSGI for development/deployment.
>
>    I've generated the java classes from  the xsd document.
>    And using those classes I generate my request XML.
>
>    This works fine when I run this within Eclipse.
>
>    But when I deploy my  application as a service in a OSGI container,
>    the xml generated doesnt have the xsi:type in the XML.
>
>    Server is external and it rejects the xml without this xsi:type.
>
>    XML generated when run as standalone .
>
>  <entry xsi:type="userAddition" xmlns:user="http://www.abc.com/schemas/user
> ">
>        <user:firstName>Beena</user:firstName>
>        <user:lastName>Nambiar</user:lastName>
>  </entry>
>
>
>    XML generated when deployed as a service
>
>  <entry xmlns:user="http://www.abc.com/schemas/user ">
>        <user:firstName>Beena</user:firstName>
>        <user:lastName>Nambiar</user:lastName>
>  </entry>
>
>
>  My pom file has these dependencies currently listed
>
>    org.apache.xmlbeans
>         xmlbeans
>         xmlbeans-qname
>         xmlbeans-xpath
>         xmlbeans-xmlpublic
>
>   Any idea why the behavior is different in standalone environment and
> container  ?
>   Any other dependencies I need to add to make this work in a service
> environment. ?
> Thanx
>
> -Alex
>