Axis 1.2.1, as a client, seems to be failing to
deserialize responses properly and completely fails when parsing a date returned
from an Axis 1.1 document/literal service. Listed below are 3 scenarios
where the same WSDL was used to
generate the client and serverside bindings using WSDL2Java. I ended up
making a change to one of the WSDL2Java classes to get this working. This
may or may not need to be filed as a bug and I'm not sure if the change I made
is safe or if it just solves my problem.
I found through debugging that during
deserialization that axis 1.2.1 would always
end up stepping into lines 291-297 of the BeanDeserializer where the
comment states that it is an error if the
deserializer is not found at this point. After comparing the generated 1.1 and 1.2.1 binding classes I
found that making the following change
fixed my problem. I've also attached the WSDL used
below.
$ diff ./axis-1_2_1/src/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java ./axis-1_2_1/src/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java.orig
363,369c363
< if (elemType != null &&
< elemType.getRefType() != null &&
< elemType.getRefType().getQName() != null) {
< pw.println(" elemField.setXmlType("
< + Utils.getNewQName(elemType.getRefType().getQName()) + ");");
< } else {
< pw.println(" elemField.setXmlType("
---
> pw.println(" elemField.setXmlType("
371d364
< }
If someone could take a look and let me know if I
should be doing something else I would appreciate it. Unfortunately having
everyone upgrade to 1.2.1 is not an option right now so I really need this type
of interoperability to work.
thanks,
-mike
-mike
<wsdl:definitions xmlns="http://test.axis.com/wsdl2java/" xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test.axis.com/wsdl2java/" name="axisTest">
<wsdl:types>
<xs:schema targetNamespace="http://test.axis.com/wsdl2java/" xmlns="http://test.axis.com/wsdl2java/" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:element name="testString" type="xs:string"/>
<xs:element name="testDate" type="xs:date"/>
<xs:complexType name="WSDLTest_Type">
<xs:sequence>
<xs:element ref="testString" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="WSDLTestResponse_Type">
<xs:sequence>
<xs:element ref="testDate" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getWSDLTest" type="WSDLTest_Type"/>
<xs:element name="getWSDLTestResponse" type="WSDLTestResponse_Type"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="GetWSDLTestRequestMessage">
<wsdl:part name="getWSDLTestRequest" element="getWSDLTest"/>
</wsdl:message>
<wsdl:message name="GetWSDLTestResponseMessage">
<wsdl:part name="getWSDLTestResponse" element="getWSDLTestResponse"/>
</wsdl:message>
<wsdl:portType name="GetWSDLTestPortType">
<wsdl:operation name="getWSDLTest">
<wsdl:input message="GetWSDLTestRequestMessage"/>
<wsdl:output message="GetWSDLTestResponseMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="GetWSDLTestSoapBinding" type="GetWSDLTestPortType">
<soapbind:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getWSDLTest" >
<soapbind:operation style="document" soapAction="http://service.wellsfargo.com/provider/pcs/account/2004/"/>
<wsdl:input>
<soapbind:body parts="getWSDLTestRequest" use="literal"/>
</wsdl:input>
<wsdl:output>
<soapbind:body parts="getWSDLTestResponse" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="GetWSDLTestService">
<wsdl:port name="getWSDLTest" binding="GetWSDLTestSoapBinding">
<soapbind:address location="http://localhost:7001/services/getWSDLTest/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Axis 1.1 Client --> Axis 1.1
Service
Request:
<?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>
<getWSDLTest xmlns="http://test.axis.com/wsdl2java/">
<testString>Test String</testString>
</getWSDLTest>
</soapenv:Body>
</soapenv:Envelope>
Request:
<?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>
<getWSDLTest xmlns="http://test.axis.com/wsdl2java/">
<testString>Test String</testString>
</getWSDLTest>
</soapenv:Body>
</soapenv:Envelope>
Response:
<?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>
<getWSDLTestResponse xmlns="http://test.axis.com/wsdl2java/">
<testDate>2005-07-12</testDate>
</getWSDLTestResponse>
</soapenv:Body>
</soapenv:Envelope>
<?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>
<getWSDLTestResponse xmlns="http://test.axis.com/wsdl2java/">
<testDate>2005-07-12</testDate>
</getWSDLTestResponse>
</soapenv:Body>
</soapenv:Envelope>
Result: works!!
Axis 1.2.1 Client --> Axis 1.1
Service
Request:
<?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>
<getWSDLTest xmlns="http://test.axis.com/wsdl2java/">
<testString xsi:type="xsd:string">Test String</testString>
</getWSDLTest>
</soapenv:Body>
</soapenv:Envelope>
Request:
<?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>
<getWSDLTest xmlns="http://test.axis.com/wsdl2java/">
<testString xsi:type="xsd:string">Test String</testString>
</getWSDLTest>
</soapenv:Body>
</soapenv:Envelope>
Response:
<?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>
<getWSDLTestResponse xmlns="http://test.axis.com/wsdl2java/">
<testDate>2005-07-12</testDate>
</getWSDLTestResponse>
</soapenv:Body>
</soapenv:Envelope>
Result: Client fails to deserialize with
`java.lang.NumberFormatException: Invalid date/time`
Axis 1.2.1-fix Client --> Axis 1.1
Service
Request:
<?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>
<getWSDLTest xmlns="http://test.axis.com/wsdl2java/">
<testString>Test String</testString>
</getWSDLTest>
</soapenv:Body>
</soapenv:Envelope>
Request:
<?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>
<getWSDLTest xmlns="http://test.axis.com/wsdl2java/">
<testString>Test String</testString>
</getWSDLTest>
</soapenv:Body>
</soapenv:Envelope>
Response:
<?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>
<getWSDLTestResponse xmlns="http://test.axis.com/wsdl2java/">
<testDate>2005-07-12</testDate>
</getWSDLTestResponse>
</soapenv:Body>
</soapenv:Envelope>
Result:
works!!
