You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Kugaprakash Visagamani <kv...@infoblox.com> on 2008/09/24 07:56:09 UTC
WSDL CXF Issue!
Hi,
Can anyone help me with following issue:
In the XSD I have a schema defined as follows:
<complexType name="TestObject">
<complexContent>
<sequence>
<element name="xyz_properties" minOccurs="0"
type="ib:bootp_props"/>
<element name="client_name" minOccurs="0" type="string"/>
</sequence>
</complexContent>
</complexType>
Using WsdlToJava the following is the generated class:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TestObject", propOrder = {
"xyzProperties",
"clientName"}
public class TestObject
{
@XmlElement(name = "xyz_properties")
protected BootpProps bootpProperties;
@XmlElement(name = "client_name")
protected String clientName;
When doing on object read (SOAP) everything gets Unmarshalled correctly
and this TestObject is filled correctly.
BUT: When try do a Object Write (SOAP) the xml response instead of send
the properties as "xyz_properties" or "client_name". It is sending as
xyzProperties & clientName.
Is there any setting we need to do to be able send it as "_" ?
Thanks
Kuga
Re: WSDL CXF Issue!
Posted by Daniel Kulp <dk...@apache.org>.
Honestly, we don't have any control over this level of serialization. We just
hand the jaxb objects over to the jaxb runtime and let it handle it.
(providing you are really using JAXB and not aegis) Thus, if this is being
handled wrong, that would be a bug there.
Definitely check to make sure you have the latest JAXB jars. Otherwise, you
might need to write a simple pure jaxb example and send it off to the jaxb
folks to debug.
Dan
On Wednesday 24 September 2008 1:56:09 am Kugaprakash Visagamani wrote:
> Hi,
> Can anyone help me with following issue:
> In the XSD I have a schema defined as follows:
>
> <complexType name="TestObject">
> <complexContent>
> <sequence>
> <element name="xyz_properties" minOccurs="0"
> type="ib:bootp_props"/>
> <element name="client_name" minOccurs="0" type="string"/>
> </sequence>
> </complexContent>
> </complexType>
>
> Using WsdlToJava the following is the generated class:
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "TestObject", propOrder = {
> "xyzProperties",
> "clientName"}
> public class TestObject
> {
> @XmlElement(name = "xyz_properties")
> protected BootpProps bootpProperties;
> @XmlElement(name = "client_name")
> protected String clientName;
>
> When doing on object read (SOAP) everything gets Unmarshalled correctly
> and this TestObject is filled correctly.
>
> BUT: When try do a Object Write (SOAP) the xml response instead of send
> the properties as "xyz_properties" or "client_name". It is sending as
> xyzProperties & clientName.
>
> Is there any setting we need to do to be able send it as "_" ?
> Thanks
> Kuga
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: WSDL CXF Issue!
Posted by Benson Margulies <bi...@gmail.com>.
wsdl2javs doesn't read annotations, it writes them. if you want to mess with
the names, you'd need jaxb customizations in the xsd files.
On Wed, Sep 24, 2008 at 7:09 PM, Kugaprakash Visagamani <
kvisagamani@infoblox.com> wrote:
> Hi,
> Basically here is the process:
> Client communicates to the server using SOAP protocol.
> All the objects that goes across the wire are defined in the XSD schema.
>
> WSDL definition imports the schema and help defines the calls for the
> clients.
> So using this WSDL/XSD we have generated the Java objects.
> Below was the code snippet for the XSD and Java generated objects. We
> are using pure CXF to help in the data translation layer
> (Marshalling/Unmarshalling).
> So basically the UNMARSHALL ie., CXF the client is able to get the
> converted java objects correctly (I would assume using the @XmlElement
> annotation) using CXF.
> But the reverse direction (MARSHALL) from java object to XML - CXF is
> not converting to "xyz_properties" or "client_name" instead it is
> sending as "xyzProperties" & "clientName" as defined in the generated
> Java object.
>
> I guess I am missing something in the code generation process.
> Below is the codegeneration args:
>
> <target name="generate.code" depends="clean.source">
> <echo message="build.src = ${build.src.dir}"/>
> <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava"
> failonerror="true" fork="true">
> <arg value="-client"/>
> <arg value="-d"/>
> <arg value="${build.src.dir}"/>
> <arg value="-p"/>
> <arg value="${project.name}"/>
> <arg value="${wsdl.dir}/Test.wsdl"/>
> <classpath>
> <path refid="cxf.classpath"/>
> </classpath>
> </java>
> </target>
>
> Thanks for the help and suggestions.
> Thanks
> Kuga
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Wednesday, September 24, 2008 11:45 AM
> To: users@cxf.apache.org
> Subject: Re: WSDL CXF Issue!
>
> Now you have complete lost me. Can you be really specific as to what CXF
> API
> calls you are making?
>
> On Wed, Sep 24, 2008 at 2:16 PM, Kugaprakash Visagamani <
> kvisagamani@infoblox.com> wrote:
>
> > Hi,
> > Appreciate your response, here is what I am trying to do:
> >
> > We have a layer in the middle CXF which actually interprets the server
> > calls: ie., Server sends us a SOAP call, via WSDL definition.
> > At the client side, using the WSDL definition, we converted to java
> data
> > objects. Below was the sample code generated code. As you mentioned,
> > looks like one way (Unmarshall) is taken care of. But the other
> > direction (Marshalling) converting the java objects to WSDL soap call,
> > is not specified. How do I do that, can you please let me know?
> > Thanks
> > Kuga
> >
> >
> >
> > -----Original Message-----
> > From: Benson Margulies [mailto:bimargulies@gmail.com]
> > Sent: Wednesday, September 24, 2008 11:11 AM
> > To: users@cxf.apache.org
> > Subject: Re: WSDL CXF Issue!
> >
> > Off hand, I'd imagine that you don't have the same configuration in
> both
> > directions.
> >
> > Can you tell us more precisely what you are doing? Is this a client
> > program
> > and a server program, both CXF? Could you have different data
> bindings?
> >
> > On Wed, Sep 24, 2008 at 2:00 PM, Kugaprakash Visagamani <
> > kvisagamani@infoblox.com> wrote:
> >
> > > Hi,
> > > Can anyone please help me with this issue?
> > > Kind of stuck in here.
> > > Thanks
> > > Kuga
> > >
> > > -----Original Message-----
> > > From: Kugaprakash Visagamani [mailto:kvisagamani@infoblox.com]
> > > Sent: Tuesday, September 23, 2008 10:56 PM
> > > To: users@cxf.apache.org
> > > Cc: Suresh Adluru
> > > Subject: WSDL CXF Issue!
> > >
> > > Hi,
> > > Can anyone help me with following issue:
> > > In the XSD I have a schema defined as follows:
> > >
> > > <complexType name="TestObject">
> > > <complexContent>
> > > <sequence>
> > > <element name="xyz_properties" minOccurs="0"
> > > type="ib:bootp_props"/>
> > > <element name="client_name" minOccurs="0" type="string"/>
> > > </sequence>
> > > </complexContent>
> > > </complexType>
> > >
> > > Using WsdlToJava the following is the generated class:
> > >
> > > @XmlAccessorType(XmlAccessType.FIELD)
> > > @XmlType(name = "TestObject", propOrder = {
> > > "xyzProperties",
> > > "clientName"}
> > > public class TestObject
> > > {
> > > @XmlElement(name = "xyz_properties")
> > > protected BootpProps bootpProperties;
> > > @XmlElement(name = "client_name")
> > > protected String clientName;
> > >
> > > When doing on object read (SOAP) everything gets Unmarshalled
> > correctly
> > > and this TestObject is filled correctly.
> > >
> > > BUT: When try do a Object Write (SOAP) the xml response instead of
> > send
> > > the properties as "xyz_properties" or "client_name". It is sending
> as
> > > xyzProperties & clientName.
> > >
> > > Is there any setting we need to do to be able send it as "_" ?
> > > Thanks
> > > Kuga
> > >
> >
>
RE: WSDL CXF Issue!
Posted by Kugaprakash Visagamani <kv...@infoblox.com>.
Hi,
Basically here is the process:
Client communicates to the server using SOAP protocol.
All the objects that goes across the wire are defined in the XSD schema.
WSDL definition imports the schema and help defines the calls for the
clients.
So using this WSDL/XSD we have generated the Java objects.
Below was the code snippet for the XSD and Java generated objects. We
are using pure CXF to help in the data translation layer
(Marshalling/Unmarshalling).
So basically the UNMARSHALL ie., CXF the client is able to get the
converted java objects correctly (I would assume using the @XmlElement
annotation) using CXF.
But the reverse direction (MARSHALL) from java object to XML - CXF is
not converting to "xyz_properties" or "client_name" instead it is
sending as "xyzProperties" & "clientName" as defined in the generated
Java object.
I guess I am missing something in the code generation process.
Below is the codegeneration args:
<target name="generate.code" depends="clean.source">
<echo message="build.src = ${build.src.dir}"/>
<java classname="org.apache.cxf.tools.wsdlto.WSDLToJava"
failonerror="true" fork="true">
<arg value="-client"/>
<arg value="-d"/>
<arg value="${build.src.dir}"/>
<arg value="-p"/>
<arg value="${project.name}"/>
<arg value="${wsdl.dir}/Test.wsdl"/>
<classpath>
<path refid="cxf.classpath"/>
</classpath>
</java>
</target>
Thanks for the help and suggestions.
Thanks
Kuga
-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com]
Sent: Wednesday, September 24, 2008 11:45 AM
To: users@cxf.apache.org
Subject: Re: WSDL CXF Issue!
Now you have complete lost me. Can you be really specific as to what CXF
API
calls you are making?
On Wed, Sep 24, 2008 at 2:16 PM, Kugaprakash Visagamani <
kvisagamani@infoblox.com> wrote:
> Hi,
> Appreciate your response, here is what I am trying to do:
>
> We have a layer in the middle CXF which actually interprets the server
> calls: ie., Server sends us a SOAP call, via WSDL definition.
> At the client side, using the WSDL definition, we converted to java
data
> objects. Below was the sample code generated code. As you mentioned,
> looks like one way (Unmarshall) is taken care of. But the other
> direction (Marshalling) converting the java objects to WSDL soap call,
> is not specified. How do I do that, can you please let me know?
> Thanks
> Kuga
>
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Wednesday, September 24, 2008 11:11 AM
> To: users@cxf.apache.org
> Subject: Re: WSDL CXF Issue!
>
> Off hand, I'd imagine that you don't have the same configuration in
both
> directions.
>
> Can you tell us more precisely what you are doing? Is this a client
> program
> and a server program, both CXF? Could you have different data
bindings?
>
> On Wed, Sep 24, 2008 at 2:00 PM, Kugaprakash Visagamani <
> kvisagamani@infoblox.com> wrote:
>
> > Hi,
> > Can anyone please help me with this issue?
> > Kind of stuck in here.
> > Thanks
> > Kuga
> >
> > -----Original Message-----
> > From: Kugaprakash Visagamani [mailto:kvisagamani@infoblox.com]
> > Sent: Tuesday, September 23, 2008 10:56 PM
> > To: users@cxf.apache.org
> > Cc: Suresh Adluru
> > Subject: WSDL CXF Issue!
> >
> > Hi,
> > Can anyone help me with following issue:
> > In the XSD I have a schema defined as follows:
> >
> > <complexType name="TestObject">
> > <complexContent>
> > <sequence>
> > <element name="xyz_properties" minOccurs="0"
> > type="ib:bootp_props"/>
> > <element name="client_name" minOccurs="0" type="string"/>
> > </sequence>
> > </complexContent>
> > </complexType>
> >
> > Using WsdlToJava the following is the generated class:
> >
> > @XmlAccessorType(XmlAccessType.FIELD)
> > @XmlType(name = "TestObject", propOrder = {
> > "xyzProperties",
> > "clientName"}
> > public class TestObject
> > {
> > @XmlElement(name = "xyz_properties")
> > protected BootpProps bootpProperties;
> > @XmlElement(name = "client_name")
> > protected String clientName;
> >
> > When doing on object read (SOAP) everything gets Unmarshalled
> correctly
> > and this TestObject is filled correctly.
> >
> > BUT: When try do a Object Write (SOAP) the xml response instead of
> send
> > the properties as "xyz_properties" or "client_name". It is sending
as
> > xyzProperties & clientName.
> >
> > Is there any setting we need to do to be able send it as "_" ?
> > Thanks
> > Kuga
> >
>
Re: WSDL CXF Issue!
Posted by Benson Margulies <bi...@gmail.com>.
Now you have complete lost me. Can you be really specific as to what CXF API
calls you are making?
On Wed, Sep 24, 2008 at 2:16 PM, Kugaprakash Visagamani <
kvisagamani@infoblox.com> wrote:
> Hi,
> Appreciate your response, here is what I am trying to do:
>
> We have a layer in the middle CXF which actually interprets the server
> calls: ie., Server sends us a SOAP call, via WSDL definition.
> At the client side, using the WSDL definition, we converted to java data
> objects. Below was the sample code generated code. As you mentioned,
> looks like one way (Unmarshall) is taken care of. But the other
> direction (Marshalling) converting the java objects to WSDL soap call,
> is not specified. How do I do that, can you please let me know?
> Thanks
> Kuga
>
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Wednesday, September 24, 2008 11:11 AM
> To: users@cxf.apache.org
> Subject: Re: WSDL CXF Issue!
>
> Off hand, I'd imagine that you don't have the same configuration in both
> directions.
>
> Can you tell us more precisely what you are doing? Is this a client
> program
> and a server program, both CXF? Could you have different data bindings?
>
> On Wed, Sep 24, 2008 at 2:00 PM, Kugaprakash Visagamani <
> kvisagamani@infoblox.com> wrote:
>
> > Hi,
> > Can anyone please help me with this issue?
> > Kind of stuck in here.
> > Thanks
> > Kuga
> >
> > -----Original Message-----
> > From: Kugaprakash Visagamani [mailto:kvisagamani@infoblox.com]
> > Sent: Tuesday, September 23, 2008 10:56 PM
> > To: users@cxf.apache.org
> > Cc: Suresh Adluru
> > Subject: WSDL CXF Issue!
> >
> > Hi,
> > Can anyone help me with following issue:
> > In the XSD I have a schema defined as follows:
> >
> > <complexType name="TestObject">
> > <complexContent>
> > <sequence>
> > <element name="xyz_properties" minOccurs="0"
> > type="ib:bootp_props"/>
> > <element name="client_name" minOccurs="0" type="string"/>
> > </sequence>
> > </complexContent>
> > </complexType>
> >
> > Using WsdlToJava the following is the generated class:
> >
> > @XmlAccessorType(XmlAccessType.FIELD)
> > @XmlType(name = "TestObject", propOrder = {
> > "xyzProperties",
> > "clientName"}
> > public class TestObject
> > {
> > @XmlElement(name = "xyz_properties")
> > protected BootpProps bootpProperties;
> > @XmlElement(name = "client_name")
> > protected String clientName;
> >
> > When doing on object read (SOAP) everything gets Unmarshalled
> correctly
> > and this TestObject is filled correctly.
> >
> > BUT: When try do a Object Write (SOAP) the xml response instead of
> send
> > the properties as "xyz_properties" or "client_name". It is sending as
> > xyzProperties & clientName.
> >
> > Is there any setting we need to do to be able send it as "_" ?
> > Thanks
> > Kuga
> >
>
RE: WSDL CXF Issue!
Posted by Kugaprakash Visagamani <kv...@infoblox.com>.
Hi,
Appreciate your response, here is what I am trying to do:
We have a layer in the middle CXF which actually interprets the server
calls: ie., Server sends us a SOAP call, via WSDL definition.
At the client side, using the WSDL definition, we converted to java data
objects. Below was the sample code generated code. As you mentioned,
looks like one way (Unmarshall) is taken care of. But the other
direction (Marshalling) converting the java objects to WSDL soap call,
is not specified. How do I do that, can you please let me know?
Thanks
Kuga
-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com]
Sent: Wednesday, September 24, 2008 11:11 AM
To: users@cxf.apache.org
Subject: Re: WSDL CXF Issue!
Off hand, I'd imagine that you don't have the same configuration in both
directions.
Can you tell us more precisely what you are doing? Is this a client
program
and a server program, both CXF? Could you have different data bindings?
On Wed, Sep 24, 2008 at 2:00 PM, Kugaprakash Visagamani <
kvisagamani@infoblox.com> wrote:
> Hi,
> Can anyone please help me with this issue?
> Kind of stuck in here.
> Thanks
> Kuga
>
> -----Original Message-----
> From: Kugaprakash Visagamani [mailto:kvisagamani@infoblox.com]
> Sent: Tuesday, September 23, 2008 10:56 PM
> To: users@cxf.apache.org
> Cc: Suresh Adluru
> Subject: WSDL CXF Issue!
>
> Hi,
> Can anyone help me with following issue:
> In the XSD I have a schema defined as follows:
>
> <complexType name="TestObject">
> <complexContent>
> <sequence>
> <element name="xyz_properties" minOccurs="0"
> type="ib:bootp_props"/>
> <element name="client_name" minOccurs="0" type="string"/>
> </sequence>
> </complexContent>
> </complexType>
>
> Using WsdlToJava the following is the generated class:
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "TestObject", propOrder = {
> "xyzProperties",
> "clientName"}
> public class TestObject
> {
> @XmlElement(name = "xyz_properties")
> protected BootpProps bootpProperties;
> @XmlElement(name = "client_name")
> protected String clientName;
>
> When doing on object read (SOAP) everything gets Unmarshalled
correctly
> and this TestObject is filled correctly.
>
> BUT: When try do a Object Write (SOAP) the xml response instead of
send
> the properties as "xyz_properties" or "client_name". It is sending as
> xyzProperties & clientName.
>
> Is there any setting we need to do to be able send it as "_" ?
> Thanks
> Kuga
>
Re: WSDL CXF Issue!
Posted by Benson Margulies <bi...@gmail.com>.
Off hand, I'd imagine that you don't have the same configuration in both
directions.
Can you tell us more precisely what you are doing? Is this a client program
and a server program, both CXF? Could you have different data bindings?
On Wed, Sep 24, 2008 at 2:00 PM, Kugaprakash Visagamani <
kvisagamani@infoblox.com> wrote:
> Hi,
> Can anyone please help me with this issue?
> Kind of stuck in here.
> Thanks
> Kuga
>
> -----Original Message-----
> From: Kugaprakash Visagamani [mailto:kvisagamani@infoblox.com]
> Sent: Tuesday, September 23, 2008 10:56 PM
> To: users@cxf.apache.org
> Cc: Suresh Adluru
> Subject: WSDL CXF Issue!
>
> Hi,
> Can anyone help me with following issue:
> In the XSD I have a schema defined as follows:
>
> <complexType name="TestObject">
> <complexContent>
> <sequence>
> <element name="xyz_properties" minOccurs="0"
> type="ib:bootp_props"/>
> <element name="client_name" minOccurs="0" type="string"/>
> </sequence>
> </complexContent>
> </complexType>
>
> Using WsdlToJava the following is the generated class:
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "TestObject", propOrder = {
> "xyzProperties",
> "clientName"}
> public class TestObject
> {
> @XmlElement(name = "xyz_properties")
> protected BootpProps bootpProperties;
> @XmlElement(name = "client_name")
> protected String clientName;
>
> When doing on object read (SOAP) everything gets Unmarshalled correctly
> and this TestObject is filled correctly.
>
> BUT: When try do a Object Write (SOAP) the xml response instead of send
> the properties as "xyz_properties" or "client_name". It is sending as
> xyzProperties & clientName.
>
> Is there any setting we need to do to be able send it as "_" ?
> Thanks
> Kuga
>
RE: WSDL CXF Issue!
Posted by Kugaprakash Visagamani <kv...@infoblox.com>.
Hi,
Can anyone please help me with this issue?
Kind of stuck in here.
Thanks
Kuga
-----Original Message-----
From: Kugaprakash Visagamani [mailto:kvisagamani@infoblox.com]
Sent: Tuesday, September 23, 2008 10:56 PM
To: users@cxf.apache.org
Cc: Suresh Adluru
Subject: WSDL CXF Issue!
Hi,
Can anyone help me with following issue:
In the XSD I have a schema defined as follows:
<complexType name="TestObject">
<complexContent>
<sequence>
<element name="xyz_properties" minOccurs="0"
type="ib:bootp_props"/>
<element name="client_name" minOccurs="0" type="string"/>
</sequence>
</complexContent>
</complexType>
Using WsdlToJava the following is the generated class:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TestObject", propOrder = {
"xyzProperties",
"clientName"}
public class TestObject
{
@XmlElement(name = "xyz_properties")
protected BootpProps bootpProperties;
@XmlElement(name = "client_name")
protected String clientName;
When doing on object read (SOAP) everything gets Unmarshalled correctly
and this TestObject is filled correctly.
BUT: When try do a Object Write (SOAP) the xml response instead of send
the properties as "xyz_properties" or "client_name". It is sending as
xyzProperties & clientName.
Is there any setting we need to do to be able send it as "_" ?
Thanks
Kuga