When you're using rpc/encoded, you don't predefine the structure of the
output message. The name attribute is the name of the <wsdl:output> element,
not the local name of the output message structure. When using rpc/encoded,
the SOAP server generates the response message structure. The SOAP
specification doesn't define naming conventions for this response structure
(it says, "the name of the struct is not significant"). The SOAP server uses
the namespace that you specify in the <wsdl:output> definition, but it
generates its own local name, so you'll just have to experiment to find out
what naming conventions your SOAP server uses.

If you want to predefine the output message structure, you must use
doc/literal. Then the response message will have the format that you define
in your <types> section.

Anne

----- Original Message -----
From: "Bhuvan Gupta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 10:15 AM
Subject: Generating Response DTD for WSDL


>
> Hi All,
>
> I have an application which takes an Input XML , creates a SOAPRequest
> Object, invokes the Webservice , gets the SOAP response XML , converts
> it into native XML format and prints it.
> In order to generate the DTD for the native Response XML, I am using the
> value of attribute "name" of element <wsdl:output> from the WSDL. Thus
> for the following WSDL (this is a part of the WSDL)
>
> E.g
>       wsdl:operation name="getStateName">
>             <wsdl:input name="getStateNameInput">
>                 <soap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
> use="encoded"/>
>             </wsdl:input>
>             <wsdl:output name="getStateNameOutput">
>                 <soap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
> use="encoded"/>
>             </wsdl:output>
>             <soap:operation soapAction="getStateName
> return,java.lang.String,return in,java.lang.String,p0" style="rpc"/>
>         </wsdl:operation>
>
> DTD
> ===
> My Output DTD is
> <!ELEMENT Body ( getStateNameOutput ) >
> <!ELEMENT getStateNameOutput ( return ) >
> <!ELEMENT return ( #PCDATA ) >
>
>
> But the problem here is that the SOAP response XML which I get contains
> the RESULT inside TAG "getStateNameResponse" rather than
> "getStateNameOutput".
>
> I am doubtful whether I am using the correct approach.
> Whats does <wsdl:output name="getStateNameOutput"> signify ?
> Is the response XML in the SOAP envelope contain the output in TAG value
> of soapAction appended with "Response" ?
>
>
> Thanks
> Bhuvan
>

Reply via email to