Hi!
I have a web service with a WSDL that works fine with both
soap implementations in Microsoft .NET (ATL and ASP).
But I cannot get it to work with Axis 1.0 RC2.
Generated java code like this (see attached wsdl):
java org.apache.axis.wsdl.WSDL2Java -p AxisClient.dab DabCtrlApi.wsdl
No problems.
Wrote a little app (java 1.4.0-02) that does this:
DabCtrlApiLocator locator = new DabCtrlApiLocator();
ApiPort cfgApi = locator.getApiPort();
ArrayOfConfigurations arr = cfgApi.requestAllConfigurations();
The SOAP communications looks fine (see attachment).
But I get the following error when the response is deserialized:
2002-okt-01 13:00:54 org.apache.axis.client.Call invoke
ALLVARLIG: Exception:
org.xml.sax.SAXException: Bad types (class [Ljava.lang.Object; -> class
AxisClient.dab.ArrayOfConfigurations)
at
org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:285)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:893)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:200)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:684)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:241)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:265)
at org.apache.axis.client.Call.invoke(Call.java:1871)
at org.apache.axis.client.Call.invoke(Call.java:1777)
at org.apache.axis.client.Call.invoke(Call.java:1315)
at
AxisClient.dab.ApiBindingStub.requestAllConfigurations(ApiBindingStub.java:123)
at AxisClient.AxisClient.main(AxisClient.java:22)
BTW: "ALLVARLIG" is swedish and means "SERIOUS".
What is wrong?
/
/ Daniel
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="factum.se/dab"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="factum.se/dab" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified" targetNamespace="factum.se/dab">
<s:element name="RequestAllConfigurations">
<s:complexType />
</s:element>
<s:element name="AllConfigurationsResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ConfigurationArray"
type="s0:ArrayOfConfigurations" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfConfigurations">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="configuration"
nillable="true" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="ArrayOfConfigurations" nillable="true"
type="s0:ArrayOfConfigurations" />
</s:schema>
</types>
<message name="InAllConfigurations">
<part name="parameters" element="s0:RequestAllConfigurations" />
</message>
<message name="OutAllConfigurations">
<part name="parameters" element="s0:AllConfigurationsResponse" />
</message>
<portType name="ApiPort">
<operation name="RequestAllConfigurations">
<input name="InAllConfigurations" message="s0:InAllConfigurations" />
<output name="OutAllConfigurations" message="s0:OutAllConfigurations" />
</operation>
</portType>
<binding name="ApiBinding" type="s0:ApiPort">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="RequestAllConfigurations">
<soap:operation soapAction="/DabCtrlApi" style="document" />
<input name="InAllConfigurations">
<soap:body use="literal" />
</input>
<output name="OutAllConfigurations">
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="DabCtrlApi">
<port name="ApiPort" binding="s0:ApiBinding">
<soap:address location="http://localhost/" />
</port>
</service>
</definitions>
POST / HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.0
Host: localhost
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "/DabCtrlApi"
Content-Length: 319
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<RequestAllConfigurations xmlns="factum.se/dab"/>
</soapenv:Body>
</soapenv:Envelope>
---------------------------------------------------------------------------------
HTTP/1.1 200 OK
Connection: close
Content-Length: 827
Content-Type: text/xml
<?xml version="1.0" encoding="iso-8859-1"?>
<SOAP-ENV:Envelope xmlns="factum.se/dab" xmlns:DAB="factum.se/dab"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<AllConfigurationsResponse>
<ConfigurationArray xsi:type="SOAP-ENC:arrayType"
SOAP-ENC:arrayType="xsd:string[2]">
<configuration xsi:type="xsd:string">
<![CDATA[Configuration 1]]>
</configuration>
<configuration xsi:type="xsd:string">
<![CDATA[Configuration 2]]>
</configuration>
</ConfigurationArray>
</AllConfigurationsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>