From: Scott N. <sni...@sc...> - 2004-11-23 23:19:49
|
Starting with 1.81, NuSOAP de-serializes XML attributes as well as = elements and values. The attributes are de-serialized to associative = array elements with keys set to the name of the attribute with a '!' = prefix. In the case you show, you can ignore the attributes. Scott Nichol Do not send e-mail directly to this e-mail address, because it is filtered to accept only mail from specific mail lists. ----- Original Message -----=20 From: "Markus Markmann" <mma...@gm...> To: <nus...@li...> Sent: Monday, November 22, 2004 5:20 AM Subject: [Nusoap-general] Different behaviour with NuSOAP 1.80 and = NuSOAP 1.81 > Hallo List, >=20 > i have simple WebService running within Apache Axis that i want to = access > via=20 > NuSOAP. Having some practice with NuSOAP and Apache Axis 1.1 before i=20 > encountered a problem within NuSOAP this time. >=20 > Sending the same request with a NuSOAP client revision < 1.81 and a = NuSOAP=20 > client revision 1.81 i receive different parsed responses (the core > responses=20 > are also identical) - see below for details.=20 >=20 > Is this a bug or have i done something wrong tailoring my webservice. >=20 >=20 > Kind regards > Mark >=20 >=20 >=20 > Using NuSOAP 1.80 the parsed response looks as follows (print_r): >=20 > Array > ( > [name] =3D> mark > [agency] =3D> Array > ( > [addresses] =3D> Array > ( > [0] =3D> Array > ( > [zip] =3D> 12345 > [street] =3D> Street 1 > [city] =3D> Hamburg > ) >=20 > [1] =3D> Array > ( > [zip] =3D> 98765 > [street] =3D> Street 99 > [city] =3D> Munich > ) >=20 > ) >=20 > [id] =3D> agency01 > ) >=20 > ) >=20 >=20 > Using NuSOAP 1.81 the parsed response is broken: >=20 > Array > ( > [getUserReturn] =3D> Array > ( > [name] =3D> mark > [agency] =3D> Array > ( > [addresses] =3D> Array > ( > [0] =3D> Array > ( > [zip] =3D> 12345 > [street] =3D> Street 1 > [city] =3D> Hamburg > [!id] =3D> id2 > [!soapenc:root] =3D> 0 > [!soapenv:encodingStyle] =3D> > http://schemas.xmlsoap.org/soap/encoding/ > ) >=20 > [1] =3D> Array > ( > [zip] =3D> 98765 > [street] =3D> Street 99 > [city] =3D> Munich > [!id] =3D> id3 > [!soapenc:root] =3D> 0 > [!soapenv:encodingStyle] =3D> > http://schemas.xmlsoap.org/soap/encoding/ > ) >=20 > ) >=20 > [id] =3D> agency01 > [!id] =3D> id1 > [!soapenc:root] =3D> 0 > [!soapenv:encodingStyle] =3D> > http://schemas.xmlsoap.org/soap/encoding/ > ) >=20 > [!id] =3D> id0 > [!soapenc:root] =3D> 0 > [!soapenv:encodingStyle] =3D> > http://schemas.xmlsoap.org/soap/encoding/ > ) >=20 > [!soapenv:encodingStyle] =3D> = http://schemas.xmlsoap.org/soap/encoding/ > ) >=20 >=20 > -------------- > System detail: > -------------- > Client: NuSOAP Revision 1.81 > Server: Apache Axis 1.2RC1 >=20 > The only method of my WebService: >=20 > public User getUser(String name) throws NotFoundException; >=20 >=20 > The returned object 'User' looks like that: >=20 > ----------------- > | User | > |---------------| > | Agency agency | > | String name | > ----------------- >=20 > ---------------------- > | Agency | > |--------------------| > | Address[] adresses | > | String id | > ---------------------- >=20 > ----------------- > | Adress | > |---------------| > | String city | > | String street | > | String zip | > ----------------- >=20 >=20 > ------------------------------------- > WSDl generated by Apache Axis 1.2RC1: > ------------------------------------- > <?xml version=3D"1.0" encoding=3D"UTF-8"?> > <wsdl:definitions targetNamespace=3D"myTest" xmlns:impl=3D"myTest" > xmlns:intf=3D"myTest" = xmlns:apachesoap=3D"http://xml.apache.org/xml-soap" > xmlns:wsdlsoap=3D"http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:soapenc=3D"http://schemas.xmlsoap.org/soap/encoding/" > xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" > xmlns:tns1=3D"http://webservice.test.de" > xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/"> > <!--WSDL created by Apache Axis version: 1.2RC1 > Built on Sep 29, 2004 (08:29:40 EDT)--> > <wsdl:types> > <schema xmlns=3D"http://www.w3.org/2001/XMLSchema" > targetNamespace=3D"http://webservice.test.de"> > <import namespace=3D"myTest"/> > <import namespace=3D"http://schemas.xmlsoap.org/soap/encoding/"/> > <complexType name=3D"Address"> > <sequence> > <element name=3D"zip" nillable=3D"true" type=3D"xsd:string"/> > <element name=3D"street" nillable=3D"true" type=3D"xsd:string"/> > <element name=3D"city" nillable=3D"true" type=3D"xsd:string"/> > </sequence> > </complexType> > <complexType name=3D"Agency"> > <sequence> > <element name=3D"addresses" nillable=3D"true" > type=3D"impl:ArrayOf_tns1_Address"/> > <element name=3D"id" nillable=3D"true" type=3D"xsd:string"/> > </sequence> > </complexType> > <complexType name=3D"User"> > <sequence> > <element name=3D"name" nillable=3D"true" type=3D"xsd:string"/> > <element name=3D"agency" nillable=3D"true" type=3D"tns1:Agency"/> > </sequence> > </complexType> > <complexType name=3D"NotFoundException"> > <sequence/> > </complexType> > </schema> > <schema xmlns=3D"http://www.w3.org/2001/XMLSchema" = targetNamespace=3D"myTest"> > <import namespace=3D"http://webservice.test.de"/> > <import namespace=3D"http://schemas.xmlsoap.org/soap/encoding/"/> > <complexType name=3D"ArrayOf_tns1_Address"> > <complexContent> > <restriction base=3D"soapenc:Array"> > <attribute ref=3D"soapenc:arrayType" = wsdl:arrayType=3D"tns1:Address[]"/> > </restriction> > </complexContent> > </complexType> > </schema> > </wsdl:types> >=20 > <wsdl:message name=3D"getUserResponse"> > <wsdl:part name=3D"getUserReturn" type=3D"tns1:User"/> > </wsdl:message> >=20 > <wsdl:message name=3D"NotFoundException"> > <wsdl:part name=3D"fault" type=3D"tns1:NotFoundException"/> > </wsdl:message> > =20 > <wsdl:message name=3D"getUserRequest"> > <wsdl:part name=3D"name" type=3D"xsd:string"/> > </wsdl:message> >=20 > <wsdl:portType name=3D"MyInterface"> > <wsdl:operation name=3D"getUser" parameterOrder=3D"name"> > <wsdl:input name=3D"getUserRequest" = message=3D"impl:getUserRequest"/> > <wsdl:output name=3D"getUserResponse" > message=3D"impl:getUserResponse"/> > <wsdl:fault name=3D"NotFoundException" > message=3D"impl:NotFoundException"/> > </wsdl:operation> > </wsdl:portType> >=20 > <wsdl:binding name=3D"myTestSoapBinding" type=3D"impl:MyInterface"> > <wsdlsoap:binding style=3D"rpc" > transport=3D"http://schemas.xmlsoap.org/soap/http"/> > <wsdl:operation name=3D"getUser"> > <wsdlsoap:operation soapAction=3D""/> > <wsdl:input name=3D"getUserRequest"> > <wsdlsoap:body use=3D"encoded" > encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/" > namespace=3D"myTest"/> > </wsdl:input> > <wsdl:output name=3D"getUserResponse"> > <wsdlsoap:body use=3D"encoded" > encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/" > namespace=3D"myTest"/> > </wsdl:output> > <wsdl:fault name=3D"NotFoundException"> > <wsdlsoap:fault name=3D"NotFoundException" use=3D"encoded" > encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/" > namespace=3D"myTest"/> > </wsdl:fault> > </wsdl:operation> > </wsdl:binding> > =20 > <wsdl:service name=3D"MyInterfaceService"> > <wsdl:port name=3D"myTest" binding=3D"impl:myTestSoapBinding"> > <wsdlsoap:address > location=3D"http://localhost:8080/myTest/services/myTest"/> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> >=20 >=20 > ------- > Request > ------- > <?xml version=3D"1.0" encoding=3D"UTF-8"?> > <SOAP-ENV:Envelope > SOAP-ENV:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/" > xmlns:SOAP-ENV=3D"http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" > xmlns:SOAP-ENC=3D"http://schemas.xmlsoap.org/soap/encoding/" > xmlns:si=3D"http://soapinterop.org/xsd" xmlns:impl=3D"myTest"> > <SOAP-ENV:Body> > <impl:getUser xmlns:impl=3D"myTest"> > <name xsi:type=3D"xsd:string">mark</name> > </impl:getUser> > </SOAP-ENV:Body> > </SOAP-ENV:Envelope> >=20 >=20 > -------- > Response > -------- > <soapenv:Envelope = xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"> > <soapenv:Body> > <ns1:getUserResponse > soapenv:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/" > xmlns:ns1=3D"myTest"> > <getUserReturn href=3D"#id0"/> > </ns1:getUserResponse> > <multiRef id=3D"id0" soapenc:root=3D"0" > soapenv:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/" > xsi:type=3D"ns2:User" > xmlns:soapenc=3D"http://schemas.xmlsoap.org/soap/encoding/" > xmlns:ns2=3D"http://webservice.test.de"> > <name>mark</name> > <agency href=3D"#id1"/> > </multiRef> > <multiRef id=3D"id1" soapenc:root=3D"0" > soapenv:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/" > xsi:type=3D"ns3:Agency" xmlns:ns3=3D"http://webservice.test.de" > xmlns:soapenc=3D"http://schemas.xmlsoap.org/soap/encoding/"> > <addresses soapenc:arrayType=3D"ns3:Address[2]"> > <item href=3D"#id2"/> > <item href=3D"#id3"/> > </addresses> > <id>agency01</id> > </multiRef> > <multiRef id=3D"id2" soapenc:root=3D"0" > soapenv:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/" > xsi:type=3D"ns4:Address" xmlns:ns4=3D"http://webservice.test.de" > xmlns:soapenc=3D"http://schemas.xmlsoap.org/soap/encoding/"> > <zip>12345</zip> > <street>Street 1</street> > <city>Hamburg</city> > </multiRef> > <multiRef id=3D"id3" soapenc:root=3D"0" > soapenv:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/" > xsi:type=3D"ns5:Address" xmlns:ns5=3D"http://webservice.test.de" > xmlns:soapenc=3D"http://schemas.xmlsoap.org/soap/encoding/"> > <zip>98765</zip> > <street>Street 99</street> > <city>Munich</city> > </multiRef> > </soapenv:Body> > </soapenv:Envelope> >=20 > --=20 > NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl > GMX DSL-Netzanschluss + Tarif zum superg=FCnstigen Komplett-Preis! >=20 >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real = users. > Discover which products truly live up to the hype. Start reading now.=20 > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Nusoap-general mailing list > Nus...@li... > https://lists.sourceforge.net/lists/listinfo/nusoap-general > |