You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ao...@meridianp2p.com on 2004/07/15 11:31:54 UTC
Do I need to use WSDL stubs ?
Hi,
I'm a newbie to SOAP and Axis and I'm hoping somebody can help me out.
I'm using Axis 1.1 to write a client to talk to a web service. I have
used the service WSDL to generate stubs etc. The data to be passed to the
service is XML data. That is, the SOAP body of my message contains an XML
string. The WSDL definition of this parameter type is described in its
own xsd file so the java type generated to represent this parameter is a
Java object and not a simple string. Consequently the generated remote
interface expects an parameter of this type.
However, what the client will get passed is a an XML string which I guess
is the string representation of the data to be sent rather than an
instance of the Java object expected by the generated stubs and remote
interface. What I'm wondering is is there any way that I can convert this
string to the required Java object without having to parse the XML string
and call each individual set method on the Java object?
I want my client to be able to just read in the XML string representing
the data to be sent and to somehow use this as the parameter rather than
generated object. Is there any way of doing this or of converting the
string to the java object?
Thanks,
Aoife
Re: Do I need to use WSDL stubs ?
Posted by Chandrasegaram Jeyakumaran <jk...@opensource.lk>.
Hi,
stubs are generated according to the wsdl. So if the wsdl specifies a
perticular type then generation will be respected to it.
I think the alternate way is to have a DII rather generationg stubs.(I am
not sure whether it will suit your problem).
Have a try with this.
If that is not your problem then,
Build your own serializer and deserializer and deploy them in the type
mapping.(put them in the typemapping tag)
for more details refer http://ws.apache.org/axis/java/user-guide.html
regards,
Jeyakumaran
> Hi,
>
> I'm a newbie to SOAP and Axis and I'm hoping somebody can help me out.
>
> I'm using Axis 1.1 to write a client to talk to a web service. I have
> used the service WSDL to generate stubs etc. The data to be passed to the
> service is XML data. That is, the SOAP body of my message contains an XML
> string. The WSDL definition of this parameter type is described in its
> own xsd file so the java type generated to represent this parameter is a
> Java object and not a simple string. Consequently the generated remote
> interface expects an parameter of this type.
>
> However, what the client will get passed is a an XML string which I guess
> is the string representation of the data to be sent rather than an
> instance of the Java object expected by the generated stubs and remote
> interface. What I'm wondering is is there any way that I can convert this
> string to the required Java object without having to parse the XML string
> and call each individual set method on the Java object?
>
> I want my client to be able to just read in the XML string representing
> the data to be sent and to somehow use this as the parameter rather than
> generated object. Is there any way of doing this or of converting the
> string to the java object?
>
> Thanks,
> Aoife
>
>
Lanka Software Foundation
Promoting opensource in Srilanka