-------- Original-Nachricht -------- Datum: Tue, 11 Oct 2011 08:37:25 +0200 Von: "Andreas Brunner" <brunne...@gmx.at> An: java-user@axis.apache.org Betreff: Axis2 Stubs generate invalid SOAP Request
I am using ADB databinding. The object "MyObject" is wrapped because in the original WSDL the element MyRequest also contains other objects. I am using the so called "Document/literal wrapped" style. Here are the lines of the message section from the wsdl: <wsdl:message name="MyRequest"> <wsdl:part name="myRequest" element="types:MyRequest"></wsdl:part> </wsdl:message> -----Ursprüngliche Nachricht----- Von: Thomas Grabietz [mailto:t...@toms-toy.de] Gesendet: Freitag, 07. Oktober 2011 13:54 An: java-user@axis.apache.org Betreff: Re: Which databinding are you using? Why do you wrap your Object "MyObject"? Post the lines of the message section from the wsdl... Try <xsd:element name="MyRequest" type="tns:MyObject"/> <xsd:complexType name="MyObject"> <xsd:sequence> < xsd:element name="firstName" nillable="true" type="string"/ > < xsd:element name="lastName" nillable="true" type="string"/> </ xsd:sequence> </xsd:complexType> Gruß Tom Am 07.10.2011 13:44, schrieb Andreas Brunner: > Hi all, > > I experienced some strange behavior with some stubs generated via Axis2. This > stubs generate an invalid SOAP Request, like the following one: > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> > <soapenv:Body> > <ns2:MyRequest xmlns:ns2="http://www.xyz.com/types"> > > <ns2:http://www.xyz.com/types><ns2:http://www.xyz.com/types>Max</ns2:http://www.xyz.com/types> > > <ns2:http://www.xyz.com/types>Mustermann</ns2:http://www.xyz.com/types> > </ns2:http://www.xyz.com/types> > </ns2: MyRequest > > <soapenv:Body> > </soapenv:Envelope> > > Instead, to be valid, it should be: > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> > <soapenv:Body> > <ns2:MyRequest xmlns:ns2="http://www.xyz.com/types"> > <ns2:MyObject><ns2:firstName>Max</ns2:http://www.xyz.com/types> > <ns2:lastName>Mustermann</ns2:http://www.xyz.com/types> > </ns2:MyRequest> > </ns2: MyRequest > > <soapenv:Body> > </soapenv:Envelope> > > The server answers for the given invalid request with: > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> > <soapenv:Body> > <soapenv:Fault> > <faultcode>soapenv:Server</faultcode> > <faultstring>com.ctc.wstx.exc.WstxUnexpectedCharException: > Unexpected character ':' (code 58) excepted space, or '>' or "/>" > at [row,col {unknown-source}]: [1,222]</faultstring> > <detail/> > </soapenv:Fault> > </soapenv:Body> > </soapenv:Envelope> > > > The types are defined in the following xsd schema fragment: > > <xsd:schema > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:types="http://www.xyz.com/types" > attributeFormDefault="qualified" > elementFormDefault="qualified" > targetNamespace="http://www.xyz.com/types"> > > > <xsd:complexType name="MyObject"> > < xsd:sequence> > < xsd:element name="firstName" > nillable="true" type="string"></ xsd:element> > < xsd:element name="lastName" > nillable="true" type="string"></ xsd:element> > </ xsd:sequence> > </ xsd:complexType> > > > <xsd:element name="MyRequest"> > <xsd:complexType> > <xsd:sequence> > <xsd:element name="myObject" > nillable="false" type="types:MyObject"></xsd:element> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > </xsd:schema> > > I am using the newest version of Axis2 (1.6.1). Please let me know if some > additonal info is needed. > > Greetings, Andreas > > > > -- Für's private http://toms-toy.de/thomas%20grabietz%20...@toms-toy.de%20(0xE43515AC)%20pub.asc GIT d-(---)? s():()> a+ C$>++ UL$>+ P? L>++ E W>+++ N>++$ o K--? w>--- O M>-- V PS>+ PE Y PGP>++$ t 5 X R tv b>+++ DI D G e> h>++ !r y>+ --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org For additional commands, e-mail: java-user-h...@axis.apache.org -- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone -- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org For additional commands, e-mail: java-user-h...@axis.apache.org