I started with a WSDL file, ran WSDL2Java to generate both client
& server sources. I successfully deployed the web service with
stubbed methods. I'm running the TCPMonitor and request & response
look fine as far as I can tell. But the client blows up with an
exception from SimpleDeserializer.
The type returned by my (RPC-style) web service call is vehicleType:
<types>
<xsd:schema targetNamespace="http://manheim.com/simulcast/vehicle">
<xsd:simpleType name="numericString">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]+"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="vehicleOption">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="value" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="vehicleType">
<xsd:sequence>
<xsd:element name="id" type="xsd:string"/> <!-- VIN or other id
-->
<xsd:element name="make" type="xsd:string"/>
<xsd:element name="model" type="xsd:string"/>
<xsd:element name="year" type="ms:numericString"/>
<xsd:element name="odometer" type="ms:numericString"/>
<xsd:element name="extColor" type="xsd:string" minOccurs="0"/>
<xsd:element name="intColor" type="xsd:string" minOccurs="0"/>
<xsd:element name="bodyStyle" type="xsd:string" minOccurs="0"/>
<xsd:element name="engine" type="xsd:string" minOccurs="0"/>
<xsd:element name="fuel" type="xsd:string" minOccurs="0"/>
<xsd:element name="transmission" type="xsd:string" minOccurs="0"/>
<!-- all additional options as name/value pairs -->
<xsd:element name="option" type="ms:vehicleOption" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
The response looks like the following. I was wondering about the 'xmlns=""'
on vehicle:
<soapenv:Body>
<GetResponse xmlns="http://manheim.com/simulcast/vehicle">
<vehicle xmlns="">
<id>VIN</id>
<make>Audi</make>
<model>S4 Quattro</model>
<year>2001</year>
<odometer>012345</odometer>
<extColor>Black</extColor>
<intColor>Tan</intColor>
<transmission>5-speed</transmission>
</vehicle>
</GetResponse>
</soapenv:Body>
And the exception is:
org.xml.sax.SAXException: SimpleDeserializer encountered a child element,
which
is NOT expected, in something it was trying to deserialize.
at
org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDe
serializer.java:189)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Dese
rializationContextImpl.java:963)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.ja
va:198)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElemen
t.java:722)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
at org.apache.axis.client.Call.invoke(Call.java:2272)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at com.manheim.simulcast.vehicle.TestClient.main(TestClient.java:98)
Any help would be greatly appreciated,
Russ