Hummm. I can't see the problem whatever it is. Are you using WSDL2Java to generate stubs? If not, try doing that and look at the stubs generated to see what is what.
-- Tom Jordahl Macromedia Server Development -----Original Message----- From: Steve Pannier [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2003 12:44 PM To: [EMAIL PROTECTED] Subject: RE: SAXException: Invalid Element error in AXIS client But I get the same error when my response message contains "string1" and "string2". I suspect I've got something amiss in either a prefix or a namespace in the response, but I can't pinpoint it. Here's the SOAP response from my latest test: <?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> <ns1:GetStringResponse soapenv:encodingStyle ="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://wsdl_temp.test.com"> <ns1:outVar> <ns1:string1 xsi:type="xsd:string">Test String1 Value</ns1:string1> <ns1:string2 xsi:type="xsd:string">Test String2 Value</ns1:string2> </ns1:outVar> </ns1:GetStringResponse> </soapenv:Body> </soapenv:Envelope> And the error message from my client: org.xml.sax.SAXException: Invalid element in com.test.wsdl_temp.wsdl_temp.JI_GetString - string1 at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:263) at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:94 9) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:718) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:322) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:346) at org.apache.axis.client.Call.invoke(Call.java:2234) at org.apache.axis.client.Call.invoke(Call.java:2133) at org.apache.axis.client.Call.invoke(Call.java:1656) at com.steve.soapgw.wsdl_temp.SoapGWPortSoapBindingStub.getString(SoapGWPortSoapBindingStub.java:142) at com.steve.soapgw.wsdl_temp.TestClient.main(TestClient.java:41) Any other ideas? Steve Pannier Jacada, Inc. (763) 201-0002 Ext. 219 [EMAIL PROTECTED] http://www.jacada.com > Your WSDL says the elements are named "string1" and "string2" but the XML in > the response has them as "String1" and "String2". > > Case counts in XML. > > -- > Tom Jordahl > Macromedia Server Development > > -----Original Message----- > From: Steve Pannier [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 27, 2003 6:45 PM > To: [EMAIL PROTECTED] > Subject: SAXException: Invalid Element error in AXIS client > > I'm using an Axis1.1RC2 client to invoke a method that returns a structure > containing 2 strings. I'm getting the following error from my client: > > > org.xml.sax.SAXException: Invalid element in > com.test.wsdl_temp.JI_GetString - String1 > at > org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java > :263) > at > org.apache.axis.encoding.DeserializationContextImpl.startElement(Deserialization > ContextImpl.java:94 > 9) > at > org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198) > at > org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:718) > at > org.apache.axis.message.RPCElement.deserialize(RPCElement.java:322) > at > org.apache.axis.message.RPCElement.getParams(RPCElement.java:346) > at org.apache.axis.client.Call.invoke(Call.java:2234) > at org.apache.axis.client.Call.invoke(Call.java:2133) > at org.apache.axis.client.Call.invoke(Call.java:1656) > at > com.test.wsdl_temp.SoapGWPortSoapBindingStub.getString(SoapGWPortSoapBindingStub > .java:142) > at com.test.wsdl_temp.TestClient.main(TestClient.java:31) > > > Here's the SOAP response message: > > HTTP/1.1 200 OK > Content-Type: text/xml; charset=utf-8 > Date: Thu, 27 Mar 2003 21:51:09 GMT > Server: Apache Coyote/1.0 > Connection: close > > <?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> > <ns1:GetStringResponse soapenv:encodingStyle > ="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1 > ="http://wsdl_temp.test.com"> > <ns1:OutVar> > <ns1:String1 xsi:type="xsd:string">Test String1 Value</ns1:String1> > <ns1:String2 xsi:type="xsd:string">Test String2 Value</ns1:String2> > </ns1:OutVar> > </ns1:GetStringResponse> > </soapenv:Body> > </soapenv:Envelope> > > > The WSDL I used to create my test client is below. > > > <?xml version="1.0" encoding="UTF-8"?> > <wsdl:definitions targetNamespace="http://wsdl_temp.test.com" xmlns > ="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap > ="http://xml.apache.org/xml-soap" xmlns:impl="http://wsdl_temp.test.com" > xmlns:intf="http://wsdl_temp.test.com" xmlns:soapenc > ="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl > ="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap > ="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd > ="http://www.w3.org/2001/XMLSchema"> > <wsdl:types> > <schema targetNamespace="http://wsdl_temp.test.com" xmlns > ="http://www.w3.org/2001/XMLSchema"> > <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> > <complexType name="Strings_MLM"> > <sequence> > <element name="string1" nillable="true" type="xsd:string"/> > <element name="string2" nillable="true" type="xsd:string"/> > </sequence> > </complexType> > <complexType name="JI_GetString"> > <sequence> > <element name="outVar" nillable="true" type="impl:Strings_MLM"/> > </sequence> > </complexType> > </schema> > </wsdl:types> > > <wsdl:message name="GetStringRequest"> > </wsdl:message> > <wsdl:message name="GetStringResponse"> > <wsdl:part name="GetStringReturn" type="intf:JI_GetString"/> > </wsdl:message> > <wsdl:portType name="SoapGW"> > <wsdl:operation name="GetString"> > <wsdl:input message="intf:GetStringRequest" name > ="GetStringRequest"/> > <wsdl:output message="intf:GetStringResponse" name > ="GetStringResponse"/> > </wsdl:operation> > </wsdl:portType> > <wsdl:binding name="SoapGWPortSoapBinding" type="intf:SoapGW"> > <wsdlsoap:binding style="rpc" transport > ="http://schemas.xmlsoap.org/soap/http"/> > <wsdl:operation name="GetString"> > <wsdlsoap:operation soapAction=""/> > <wsdl:input name="GetStringRequest"> > <wsdlsoap:body encodingStyle > ="http://schemas.xmlsoap.org/soap/encoding/" namespace > ="http://wsdl_temp.test.com" use="encoded"/> > </wsdl:input> > <wsdl:output name="GetStringResponse"> > <wsdlsoap:body encodingStyle > ="http://schemas.xmlsoap.org/soap/encoding/" namespace > ="http://wsdl_temp.test.com" use="encoded"/> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:service name="SoapGW"> > <wsdl:port binding="intf:SoapGWPortSoapBinding" name="SoapGWPort"> > <wsdlsoap:address location > ="http://10.150.5.147:8091/JISOAP/SoapGW"/> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > > > > Any ideas as to what the problem is? Is the SOAP response formatted > incorrectly? Or could something be wrong in the WSDL file? > > > Steve Pannier > Jacada, Inc. > (763) 201-0002 Ext. 219 > [EMAIL PROTECTED] > http://www.jacada.com > >
