Using complex data types from Java in Axis webservice
Posted
by Manuel Ferreria
on Stack Overflow
See other posts from Stack Overflow
or by Manuel Ferreria
Published on 2008-10-30T19:21:42Z
Indexed on
2010/03/19
17:01 UTC
Read the original article
Hit count: 503
I am currently developing a Java app which handles a SOAP webservice.
The problem lies after I parse the WSDL [the Parser object from Apache Axis does it for me], and I create the call.
When I try to invoke it, I have to pass a Object[] to assign the parameters [taken from the Action of the WSDL]. A normal action is easy, but when I have custom datatypes, I can't get it to fill it out for me. I try to pass Object[]{ new Object { }}, but it assigns the first field instead. I can't pass it already processed, because it changes the '< >' to '--lt --gt', and the server doesn't recognize it'.
This is a fragment of the WSDL.
<s:element name="FERecuperaQTYRequest"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="argAuth" type="tns:FEAuthRequest" /> </s:sequence> </s:complexType> </s:element> <s:complexType name="FEAuthRequest"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Token" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Sign" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="cuit" type="s:long" /> </s:sequence> </s:complexType>
And this is the troublesome Java Fragment
QTY = (String) call.invoke (
new Object[]{
new Object[]{
tokenConexion.getToken (),
tokenConexion.getSign (),
tokenConexion.getCUIT ()
}
});
© Stack Overflow or respective owner