axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anne Thomas Manes" <>
Subject Re: Targetnamespace confusion with autogenerated WSDL!?
Date Sun, 17 Dec 2006 19:40:52 GMT
Whatever sources you are referencing are in error.

The WSDL defines what the document in the message on the wire looks
like, but that doesn't mean that elements in the document on the wire
must be in the WSDL targetNamespace.

The WSDL defines a set of elements (e.g., messages, portTypes,
operations, bindings, services, and ports). All of these defined
elements are in the WSDL targetNamespace. A <wsdl:message> definition
defines the contents of a message on the wire. In your case:

             <wsdl:message name="echoMessage">
                 <wsdl:part name="part1" element="ns0:echo"/>

indicates that the <soap:Body> should contain an element called
"ns0:echo", as defined in the schema in the <wsdl:types> section, for

              <ns0:echo xmlns:ns0="">
                 <ns0:param0>some string</ns0:param0>

NOTE: This is a document/literal interface, which means that the
message on the wire should conform to the schema that defines the
message contents. The schema for ns0:echo does not define any
attributes, therefore the message that you've created, which contains
"id="o0" c:root="1"", is not valid. These attributes should only be
used when using RPC/encoded.

If you were using an RPC style service, then there is no explicit
definition of the message schema, but you can infer the schema
definition from the message, operation, and binding definitions. It
works like this:

The local name of the child element of the <soap:Body> is the taken
from the operation name in the <wsdl:portType> definition. The
qualifying namespace for the operation name comes from the namespace
attribute in the <soap:body> definition in the <wsdl:binding>. The
child elements of the operation element must be unqualified, and they
take their local names from the names of the <wsdl:part> elements in
the <wsdl:message>.

Hope this helps.


On 12/17/06, Robert Ayzma <> wrote:
> I have made a very simple web service on an Axis2 Tomcat driven server.
> Axis generates the wsdl fine heres a snippet.
> <wsdl:definitions targetNamespace=" ">
> <wsdl:documentation>SimpleService</wsdl:documentation>
> −
>        <wsdl:types>
> −
>        <xs:schema attributeFormDefault="qualified"
> elementFormDefault="qualified"
> targetNamespace="">
> −
>        <xs:element name="echo">
> −
>        <xs:complexType>
> −
>        <xs:sequence>
> <xs:element name="param0" nillable="true" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> −
>        <xs:element name="echoResponse">
> −
>        <xs:complexType>
> −
>        <xs:sequence>
> <xs:element name="return" nillable="true" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> </wsdl:types>
> −
>        <wsdl:message name="echoMessage">
> <wsdl:part name="part1" element="ns0:echo"/>
> </wsdl:message>
> −
>        <wsdl:message name="echoResponse">
> <wsdl:part name="part1" element="ns0:echoResponse"/>
> </wsdl:message>
> −
>        <wsdl:portType name="SimpleServicePortType">
> −
>        <wsdl:operation name="echo">
> <wsdl:input message="axis2:echoMessage" wsaw:Action="urn:echo"/>
> <wsdl:output message="axis2:echoResponse"/>
>  </wsdl:operation>
> </wsdl:portType>
> −
>        <wsdl:binding name="SimpleServiceSOAP11Binding"
> type="axis2:SimpleServicePortType">
> <soap:binding transport="
> style="document"/>
> −
>        <wsdl:operation name="echo">
> ......snippet ends
> I have also made a client that can communicate with the echo service
> but ONLY if I use the targetnamespace of the schema and not the one for
> wsdl definitions, and I have absolutely no idea why.
> The request for the client request looks like this:
> <v:Envelope xmlns:i="
> xmlns:d=""
> xmlns:c=""
> xmlns:v=""><v:Header
> /><v:Body><n0:echo id="o0" c:root="1"
> xmlns:n0=""><param0
> i:type="d:string">Test af Soap
> Webservice</param0></n0:echo></v:Body></v:Envelope>
> The response looks like this:
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="
> /><soapenv:Body><ns:echoResponse
> xmlns:ns=""><ns:return>echo
> value is: Test af Soap
> Webservice</ns:return></ns:echoResponse></soapenv:Body></soapenv:Envelope>
> And all is fine, but if I change the namespace to: "xmlns:ns="
>" instead, then I get a faultcode with unknown
> method echo.
> According to all sorts of books and ressources on the net, the WSDL
> definitions namespace address ALL the elements in the document, so why
> is it that if I change the namespace to the defintions namespace then
> my client gets a faultcode saying that the echo method is not known? I
> am missing out on something here I know so please point me in the right
> direction.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message