Dear all :
I user Aixs2 1.3 .First i user axis2java command build a webservice from a
wsdl, then I delploy it on axis2 under tomcat 5.5.12. Every thing goes well,
but when i call this web service use delphi 2007 , error occured . When call
the web service in delphi, here raise a "
org.apache.axis2.databinding.ADBExcepion:Unexpected
subelement AuthInfo " exception. I had searched achieved mails, some one
said that this error mostly caused by wrong name spaces of wsdl file. I had
checked my wsdl file again and again and valid it wiht netbean and cxf
validate tools, but all those tools said that the wsdl file is correct. I am
fighting with this problem for nearly one week, but do not have any
progress. Can anyone help ? Any idea or suggest will be highly appreciated.
WSDL file and soap message for request and response can be found in the
following.
Thanks
Ryan.
WSDL file
<?xml version ="1.0" encoding ="utf-8"?>
<wsdl:definitions
targetNamespace = "http://example.com"
xmlns:tns ="http://example.com"
xmlns:wsoap12 ="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs ="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xs:schema
targetNamespace="http://example.com"
blockDefault="#all"
elementFormDefault="qualified">
<xs:complexType name="AuthInfo">
<xs:sequence>
<xs:element name="UserName" minOccurs="0"
nillable="true" type="xs:string"/>
<xs:element name="AuthPass" minOccurs="0"
nillable="true" type="xs:string"/>
<xs:element name="Timestamp" minOccurs="0"
nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="HelloResponse" >
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return"
nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Hello" >
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="AuthInfo"
nillable="true" type="tns:AuthInfo"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="HelloWorldMessageOut">
<wsdl:part name="return" element="tns:HelloResponse"/>
</wsdl:message>
<wsdl:message name="HelloWorldMessageIn">
<wsdl:part name="AuthInfo" element="tns:Hello"/>
</wsdl:message>
<wsdl:portType name="Test">
<wsdl:operation name="HelloWorld">
<wsdl:input message="tns:HelloWorldMessageIn"/>
<wsdl:output message="tns:HelloWorldMessageOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TestSoap12Binding" type="tns:Test">
<wsoap12:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<wsdl:operation name="HelloWorld">
<wsoap12:operation
soapAction="http://example.com/Test/HelloWorldRequest"
soapActionRequired="true" style="document"/>
<wsdl:input >
<wsoap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<wsoap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloWorld">
<wsdl:port name="HellowWordSoap12" binding="tns:TestSoap12Binding">
<wsoap12:address location="http://localhost/helloword"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
SOAP for request
<?xml version='1.0' encoding='utf-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body xmlns:NS2="http://example.com" SOAP-ENV:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/">
<NS1:HelloWorld xmlns:NS1="http://example.com">
<AuthInfo href="#1" />
</NS1:HelloWorld>
<NS2:Hello id="1" xsi:type="NS2:Hello">
<AuthInfo href="#2" />
</NS2:Hello>
<NS2:AuthInfo id="2" xsi:type="NS2:AuthInfo">
<UserName xsi:type="xsd:string">test username</UserName>
<AuthPass xsi:type="xsd:string">authpass</AuthPass>
<Timestamp xsi:type="xsd:string">timestamp</Timestamp>
</NS2:AuthInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
SOAP for response
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/
">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>org.apache.axis2.databinding.ADBException: Unexpected
subelement AuthInfo</faultstring>
<detail />
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>