Hi everyone!
How can I change the Schema use by Apache Soap when I make a call?
The big story is that I consume a .NET service with Apache Soap. The
service answer back with a "dateTime" but Apache doesn't understand this.
I've send date before with other Apache service and MS Soap service and
they always use "timeInstant" and it works. I know "dateTime" is from
Schema 2001 but it should be supported in Apache. It's surely supported but
I don't know how to set it up.
Thanks!
Steeve...
---------------------------------------------------------------------
Here's the stack trace, it should give you a good idea of my point.
[SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to
deserial
ize a 'http://www.w3.org/2001/XMLSchema:dateTime' using encoding
style 'http://s
chemas.xmlsoap.org/soap/encoding/'.;
targetException=java.lang.IllegalArgumentEx
ception: No Deserializer found to deserialize
a 'http://www.w3.org/2001/XMLSchem
a:dateTime' using encoding
style 'http://schemas.xmlsoap.org/soap/encoding/'.]
at org.apache.soap.rpc.Call.invoke(Call.java:246)
at DUJClient.getServerTime(DUJClient.java:274)
at DUJClient.main(DUJClient.java:474)
---------------------------------------------------------------------
The request:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:GetServerTime xmlns:ns1="urn:DUJS/" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<ServiceST xsi:type="xsd:timeInstant">1970-01-01T00:00:00Z</ServiceST>
</ns1:GetServerTime>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
---------------------------------------------------------------------
The answer:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:DUJS/" xmlns:types="urn:DUJS/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/
">
<tns:GetServerTimeResponse>
<GetServerTimeResult xsi:type="xsd:dateTime">2001-07-
26T16:31:55.8788912-04:00</GetServerTimeResult>
</tns:GetServerTimeResponse>
</soap:Body>
</soap:Envelope>
---------------------------------------------------------------------