Hello,

Please look at these two scenarios:

Scenario 1:
----------------
In Apache SOAP, the client application invokes the call using the following
code.

     Call.invoke("url","");

The implementation of Call , builds the SOAP message for us before it is
posted to SOAP server. The Call object takes care of scanning the
parameters and building the SOAP-BODY with appropriate data types.

When I invoked a web service that accepts a String as a function
paramenter, using the following code built the SOAP document like this.

       params.addElement(new Parameter("symbol", String.class,
                                    symbol, null));
    call.setParams(params);

<SOAP-ENV:Envelope xmlns:SOAP-ENV
="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi
="http://www.w3.org/1999/XMLSchema-instance"; xmlns:xsd
="http://www.w3.org/1999/XMLSchema";>
<SOAP-ENV:Body>
<ns1:GetLastTradePrice xmlns:ns1="Some-URI">
<symbol xsi:type="xsd:string">DIS</symbol>
</ns1:GetLastTradePrice>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

But in the above code , it forces my client code to know that my web
service function accepts a String as the parameter datatype.

Scenario 2:
---------------
Lets assume, my client does not use  any SOAP specific APIs. It has to buid
the SOAP document of its own and post it to SOAP server.

It builds the document that look like this,

<SOAP-ENV:Envelope xmlns:SOAP-ENV
="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi
="http://www.w3.org/1999/XMLSchema-instance"; xmlns:xsd
="http://www.w3.org/1999/XMLSchema";>
<SOAP-ENV:Body>
<ns1:GetLastTradePrice xmlns:ns1="Some-URI">
<symbol>DIS</symbol>
</ns1:GetLastTradePrice>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

If I post this document to APACHE SOAP server , it does not invoke the
appropriate web service method, because this document does not say the
<symbol> data type.

The usage of "Call" object forces me to specify the parameter datatypes at
the client side. What if, I want my SOAP client code to be independent of
server side method signature. I just want to send a pure XML document in
SOAP-BODY which won't specify any data types.


Any suggestions.

Thanks,
Sekar.



Reply via email to