Don Markham

Greenhorn
+ Follow
since Dec 27, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Don Markham

I am using Axis 1.3 and document binding style/literal wrapped use when generating XML code, which is required by the web service. I used WSDL2Java to create the Java stubs.

The XML that is sent to the web service is correct. The XML that is returned generates an "invalid element" error on the first field of an array. More specifically, an address array is returned and the error occurs on the first of seven fields (all string) of the array.

I have seen references to this issue and some suggestions as to how the problems can be addressed. Nothing is specific enough to help me get past the problem.

The error is:
- Exception:
org.xml.sax.SAXException: Invalid element in [namespace]._OffersResponse - Predir
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at [namespace].OffersServiceSoapStub.queryOffers(OffersServiceSoapStub.java:526)
at [namespace].TestClient.main(TestClient.java:119)
org.xml.sax.SAXException: Invalid element in [namespace]._OffersResponse - Predir
18 years ago
I keep getting the following error when I attempt to contact a web service with an invoke(arguments) command. Predir is the first string in an array that is returned.

- Exception:
org.xml.sax.SAXException: Invalid element in com.go2broadband.www.V4_0._QueryOffersResponse - Predir
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.go2broadband.www.V4_0.QueryOffersServiceSoapStub.queryOffers(QueryOffersServiceSoapStub.java:526)
at com.go2broadband.www.V4_0.TestClient.main(TestClient.java:119)
org.xml.sax.SAXException: Invalid element in com.go2broadband.www.V4_0._QueryOffersResponse - Predir

I found this reference at: http://openadaptor.openadaptor.org/pg/soap_components.htm
"Returning Complex Objects
It is likely that most SOAP calls will return complex objects rather than primitives. It is a relatively easy process to write your own extension of AbstractSOAPCall to cater for this.

All you have to do is create a simple deserialiser Bean that mirrors the returned object (ie. have accessor methods for each attribute in the returned object) and then add the following code to your SOAP Call prior to invoking it:

QName qn = new QName("urn:BeanService", "WeatherSummary");

call.registerTypeMapping(WeatherSummary.class,
qn,
new BeanSerializerFactory(WeatherSummary.class, qn),
new BeanDeserializerFactory(WeatherSummary.class, qn));

call.setReturnType(qn);

Note: if your Bean does not have an accessor method for all attributes int he return object then you will get an "org.xml.sax.SAXException: Invalid element in ...." exception"

I believe the stub is doing all of this before the invoke, yet...the error. Any help would be greatly appreciated.
18 years ago