You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Nicholas Quaine <qu...@jpmorgan.com> on 2001/03/01 10:23:35 UTC

RE: How to communicate between Apache-SOAP and MSSOAP

saying that the apache and ms implementations of wsdl are incompatible is
misleading at best

when you employ a wsdl on the client side (using ms soap toolkit) it produces
soap requests that can be received and processed by apache soap server without
the server side knowing about the contents of the wsdl file or even knowing that
the requests were generated using a wsdl file. It simply doesn't care.

It must be said though that there are issues with the soap envelopes that are
produced using this method and having them understood by apache. I have come
across the following issues...

[ Note that my system architecture is as follows : visual basic client using the
high level API of ms apache soap toolkit 2.0 beta 1 running under NT4 and
exploiting a wsdl file talking to an apache soap 2.1 service running under a
tomcat 3.2.1 server on solaris 2.6 ]

1. ensure that your WSDL file specifies UTF-8 encoding - ie. first line should
be : <?xml version="1.0" encoding="UTF-8"?> rather than UTF-16 as you see in
some wsdl file examples

2. the classic obstacle to ms-apache interop is the xsi:type problem. The MS
high level API does not put xsi:type into the request. Apache soap 2.1 has the
functionality to get around this (so you cannot use apache soap 2.0) - the way
to exploit this is described in Sanjiva's change comments available here
http://marc.theaimsgroup.com/?l=soap-dev&m=97901982213396&w=2 (you basically
need to make some additional entries in your deployment descriptor for the
primitives and deploy)

3. Apache will put "Content-Type: text/xml; charset=utf-8" in the response
packet. But microsoft will only want to see "Content-Type: text/xml" if you are
using the high level API (note that this is not a problem if using the low level
API). You will need to put a hack into the apache code or into a tcp/ip tunnel
to remove this from the response packet. Microsoft acknowledges this as a bug
and have said that a fix will be present in MS SOAP Toolkit 2.0 beta 2 (promised
for mid March).

with all this you should be able to get soap calls using primitives as call
paramater and return types
note that arrays and structs as parameter call and return are AFAIK not
supported by microsoft in the high level API until MS SOAP Toolkit 2.0 beta 2
(available mid-march)

regards,
Nick







Richard.Hansen@westgroup.com on 02/28/2001 03:55:06 PM

Please respond to soap-user@xml.apache.org

To:   soap-user@xml.apache.org
cc:   (bcc: Nicholas Quaine)
Subject:  RE: How to communicate between Apache-SOAP and MSSOAP.(stock quot e
      service)




More like incompatible at this time. But I don't really know the details.
This stuff is all pretty new and interoperability seems to be an issue.

Rick

-----Original Message-----
From: Khondker Akhter [mailto:Khondker.Akhter@msdw.com]
Sent: Wednesday, February 28, 2001 2:53 PM
To: soap-user@xml.apache.org
Subject: Re: How to communicate between Apache-SOAP and MSSOAP.(stock quote
service)


so apache implementation of wsdl and ms soap implementation are different??

"Hansen, Richard" wrote:


I have only used the low level API. I don't think the current version of MS
Soap handles Apache WSDL.

Rick


> -----Original Message-----
> From: Khondker Akhter [ mailto:Khondker.Akhter@msdw.com
<ma...@msdw.com> ]
> Sent: Wednesday, February 28, 2001 2:39 PM
> To: soap-user@xml.apache.org
> Subject: Re: How to communicate between Apache-SOAP and MSSOAP.(stock
> quote service)
>
>
> here is what i am trying to do:
>
> run the StockQuoteService in tomcat/apache (works)
> access the service from an thin vb client:
>
> ***********************************************************
> vb client::
>
> Private Sub Form_Load()
>   Dim symbol As String
>   Const WDSL_URL As String =
> " http://mgfrm65:8181/services/StockQuoteService.wsdl
<http://mgfrm65:8181/services/StockQuoteService.wsdl> "
>   'Const name = " urn:xmltoday-delayed-quotes
<urn:xmltoday-delayed-quotes> "
>   symbolTB.Text = "IBM"
> End Sub
>
> Private Sub getQuoteCB_Click()
> Dim ret As Variant
> Dim sc As New MSSOAPLib.SoapClient
> 'Dim sc As Object
> 'Set sc = CreateObject("MSSOAP.SoapClient")
>
>   On Error GoTo do_err
>   symbol = symbolTB.Text
>   quoteL.Caption = symbol
>   Call
> sc.mssoapinit(" http://mgfrm65:8181/services/StockQuoteService.wsdl
<http://mgfrm65:8181/services/StockQuoteService.wsdl> ", _
>                     "StockQuoteService", _
>                     "StockQuotePort")
>   ret = sc.getQuote(symbol)
>   quoteL = ret
> do_cont:
>     Exit Sub
> do_err:
>     MsgBox Err & ": " & Error$
>     MsgBox sc.faultactor & vbCrLf & _
>             sc.faultcode & vbCrLf & _
>             sc.faultstring
>
> End Sub
>
> Private Sub quitB_Click()
> Unload Me
> End Sub
> ***********************************************************
>
> ***********************************************************
> the code for the StockQuoteService.wsdl is:
> <?xml version="1.0"?>
>
> <definitions name="StockQuoteService"
>              targetNamespace=" urn:xmltoday-delayed-quotes
<urn:xmltoday-delayed-quotes> "
>              xmlns:tns=" urn:xmltoday-delayed-quotes
<urn:xmltoday-delayed-quotes> "
>              xmlns=" http://schemas.xmlsoap.org/wsdl/
<http://schemas.xmlsoap.org/wsdl/> "
>              xmlns:xsd=" http://www.w3.org/1999/XMLSchema
<http://www.w3.org/1999/XMLSchema> "
>              xmlns:soap=" http://schemas.xmlsoap.org/wsdl/soap/
<http://schemas.xmlsoap.org/wsdl/soap/> ">
>
>    <message name="getQuoteInput">
>       <part name="symbol" type="xsd:string"/>
>    </message>
>
>    <message name="getQuoteOutput">
>       <part name="quote" type="xsd:float"/>
>    </message>
>
>    <portType name="GetQuote">
>       <operation name="getQuote">
>          <input message="getQuoteInput"/>
>          <output message="getQuoteOutput"/>
>       </operation>
>    </portType>
>
>    <binding name="GetQuoteSoapBinding" type="GetQuote">
>       <soap:binding style="rpc"
>                     transport=" http://schemas.xmlsoap.org/soap/http"/
<http://schemas.xmlsoap.org/soap/http> >
>       <operation name="getQuote">
>          <soap:operation soapAction=""/>
>          <input>
>             <soap:body use="encoded"
>
> encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/
<http://schemas.xmlsoap.org/soap/encoding/>
>
> http://www.ibm.com/namespaces/xmi <http://www.ibm.com/namespaces/xmi> "
>                        namespace=" urn:xmltoday-delayed-quotes"/
<urn:xmltoday-delayed-quotes> >
>          </input>
>          <output>
>             <soap:body use="encoded"
>
> encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/
<http://schemas.xmlsoap.org/soap/encoding/>
>
http://www.ibm.com/namespaces/xmi <http://www.ibm.com/namespaces/xmi> "
                       namespace=" urn:xmltoday-delayed-quotes"/
<urn:xmltoday-delayed-quotes> >
         </output>
      </operation>
   </binding>


   <service name="StockQuoteService">
      <port name="StockQuotePort" binding="GetQuoteSoapBinding">
        <soap:address
location=" http://mgfrm65:8181/soap/servlet/rpcrouter"/
<http://mgfrm65:8181/soap/servlet/rpcrouter> >
      </port>
   </service>


</definitions>
***********************************************************


when i run my client and response from the server is :


HTTP/1.0 400 Bad Request


Content-Length: 536


Date: Wed, 28 Feb 2001 20:28:16 GMT


Servlet-Engine: Tomcat Web Server/3.1 (JSP 1.1; Servlet 2.2; Java 1.2.2;
SunOS 5.5.1 sparc; java.vendor=Sun Microsystems Inc.)


Set-Cookie: JSESSIONID=To1019mC8478576703846645At;Path=/soap


Set-Cookie2:
JSESSIONID=To1019mC8478576703846645At;Version=1;Discard;Path="/soap"


Content-Language: en


Content-Type: text/xml; charset=utf-8


Status: 400


<?xml version='1.0' encoding='UTF-8'?>


<SOAP-ENV:Envelope
xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/> "
xmlns:xsi=" http://www.w3.org/1999/XMLSchema-instance
<http://www.w3.org/1999/XMLSchema-instance> "
xmlns:xsd=" http://www.w3.org/1999/XMLSchema
<http://www.w3.org/1999/XMLSchema> ">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>No Deserializer found to deserialize a ':symbol' using
encoding style ' http://schemas.xmlsoap.org/soap/encoding/
<http://schemas.xmlsoap.org/soap/encoding/> '.</faultstring>
<faultactor>/soap/servlet/rpcrouter</faultactor>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
***********************************************************


what does this mean??








This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.