Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

axis:complex types

3 views
Skip to first unread message

Clyde

unread,
Apr 7, 2003, 9:11:48 AM4/7/03
to
Trying to get a client to work that accesses a web service that sends
back complex data type. I have no experience with using complex types
and trying to get a head start for a workshop at my users group. We
want to write the code and not use the WSDL2Java utility.

I have created a javabean class (Weather) that holds the fields sent
back from the service, but when I connect, I eventually get a
SAXException. Where can I find more help about using complex types in
rpc & document style calls?

The WSDL is at http://ws2.serviceobjects.com/fw/FastWeather.asmx?WSDL


- Exception:
org.xml.sax.SAXException: Invalid element in jsl.clients.Weather -
LastUpdated


The serializers are setup in the client as:

// Set up serialization encoding for the object
QName qname = new QName(namespaceUri, "Weather");

BeanSerializerFactory bsf = new BeanSerializerFactory(Weather.class,
qname);
BeanDeserializerFactory bdf =
new BeanDeserializerFactory(Weather.class, qname);

call.registerTypeMapping(Weather.class, qname, bsf, bdf);
call.addParameter("ns1:PostalCode",
org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);

call.addParameter("ns1:LicenseKey",
org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);

call.addParameter("GetWeatherByZipResponse", qname,
javax.xml.rpc.ParameterMode.OUT);

call.setReturnType(qname);

The service's response is:
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Sun, 06 Apr 2003 23:04:26 GMT
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/xml; charset=utf-8
Content-Length: 857
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetWeatherByZipResponse
xmlns="http://www.serviceobjects.com/">
<GetWeatherByZipResult>
<LastUpdated>6:53 PM EDT April 6, 2003</LastUpdated>
<TemperatureF>65</TemperatureF>
<Windchill>N/A</Windchill>
<HeatIndex>N/A</HeatIndex>
<Humidity>93%</Humidity>
<Dewpoint>63</Dewpoint>
<Wind>ENE at 10</Wind>
<Pressure>30.01</Pressure>
<Conditions>Thunderstorm Mist </Conditions>
<Visibility> 2</Visibility>
<Sunrise>07:16 AM (EDT)</Sunrise>
<Sunset>08:00 PM (EDT)</Sunset>
<City>Atlanta</City>
<State>Georgia</State>
<Moonrise>10:01 AM (EDT)</Moonrise>
<Moonset>12:42 AM (EDT)</Moonset>
</GetWeatherByZipResult>
</GetWeatherByZipResponse>
</soap:Body>
</soap:Envelope>

===end===

(detail of errror)
at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:252)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeAxisFault
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: org.xml.sax.SAXException: Invalid element in
jsl.clients.Weather - LastUpdated
faultActor: null
faultDetail:
stackTrace: org.xml.sax.SAXException: Invalid element in
jsl.clients.Weather - LastUpdated
at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:252)
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)

0 new messages