Hi,
I have a web service I wrote in Perl using SOAP::Lite. I've used Axis
before to consume really simple Perl web services that perform
echoString and HelloWorld type functionality, however, this time I've
built a web service in SOAP::Lite that returns some complex types. I am
trying to build a Java client using AXIS to consume this service, with
little success. The WSDL file I'm using has the following complex types
defined:
<xsd:complexType name="JIBArray">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType"
wsdl:arrayType="tns:JIBs[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="JIBs">
<xsd:all>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="url" type="xsd:string"/>
<xsd:element name="summary" type="xsd:string"/>
<xsd:element name="date" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
The relevant message from the WSDL is:
<message name='getRequest1'>
<part name='request' type='xsd:string'/>
</message>
<message name='getResponse1'>
<part name='results' type='tns:JIBArray'/>
</message>
I used WSDL2Java to generate the Java stubs, and I wrote a simple client:
import com.soaplite.namespaces.*;
public class JIBClient {
public static void main(String args[]) throws Exception {
JIBService service = new JIBServiceLocator();
JIBPortType myblah = service.getJIBPort();
JIBs[] j = myblah.getJIBs("testing");
String s = j[0].getUrl();
System.out.println("The URL of JIB[0] is " + s);
}
}
My problem is that I get all kinds of errors when I try to execute the
above:
Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}Server.generalException
faultString: Error invoking operation:
java.lang.ArrayStoreException
faultActor: null
faultDetail:
stackTrace: AxisFault
faultCode: {http://xml.apache.org/axis/}Server.generalException
faultString: Error invoking operation:
java.lang.ArrayStoreException
faultActor: null
faultDetail:
Error invoking operation:
java.lang.ArrayStoreException
at org.apache.axis.client.Call.invoke(Call.java:1329)
at
com.soaplite.namespaces.JIBBindingStub.getJIBs(JIBBindingStub.java:134)
at JIBClient.main(JIBClient.java:12)
I would welcome any suggestions that anyone can give me. I've tried
using Apache:Soap and older versions of Axis, with no success.
Thanks
--
Brook Heaton