You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Shu <sh...@esker.fr> on 2001/03/20 10:08:03 UTC

RE: Apache SOAP Client and .NET Web Service

MS.NET Web Services specify neither encoding style nor xsi:type for return
values in its Response Envelope.

So, Apache-SOAP Client throws an exception:
No Deserializer found to deserialize a
'http://schemas.xmlsoap.org/soap/envelope/:Parameter' using encoding style
'null'.

Apache-SOAP Client needs to register all necessary type mappings before
making call to server. Example:
    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    ParameterSerializer ps = new ParameterSerializer();
    StringDeserializer sd = new StringDeserializer();
    // For encoding style

smr.mapTypes(null,RPCConstants.Q_ELEM_PARAMETER,Parameter.class,null,ps);
    // For xsi:type
    smr.mapTypes(null,new QName("","name"),null,null,sd);
    call.setSOAPMappingRegistry(smr);

Herve

> -----Message d'origine-----
> De : Brian Ingenito [mailto:BIngenito@extremelogic.com]
> Envoyé : lundi 19 mars 2001 20:27
> À : shu@esker.fr
> Objet : RE: Apache SOAP Client and .NET Web Service
>
>
> This was exactly what was wrong...thanks.  One more thing.  I'm getting
> that nasty error about no deserializer being found for encoding style
> 'null'.  I tried the SOAPMappingRegistry code found in the post by
> Silvio Fiorito with the subject 'RE: SOAP Fault when invoking a MS web
> service from an Apache client' and it still gives the same error.  Any
> thoughts?  I'm hoping the beta 2 release of .NET eliminates the need for
> these changes.
>
> -Brian
>
> -----Original Message-----
> From: Shu [mailto:shu@esker.fr]
> Sent: Monday, March 19, 2001 10:53 AM
> To: soap-user@xml.apache.org
> Subject: RE: Apache SOAP Client and .NET Web Service
>
>
> If you changed in TransportMessage "text/xml" for the content type,
> Apache-SOAP to MS.NET can work without another modification.
>
> If the method to invoke is getQuote, MS.NET Web Service using managed
> code
> (here C#) takes by default:
> 	"http://tempuri.org/getQuote" as Soap action
> 	"http://tempuri.org/" as request namespace.
> 	"http://tempuri.org/" as response namespace.
> 	"getQuote" as request element name
> 	"getQuoteResult" as response element name
>
> >From your description, it seems your use these default values for server
> and
> no matched values in client.
>
> To solve your problem, in your server code, you must use
> System.Web.Services.Protocols.SoapMethodAttribute like this:
> 	[
> SoapMethod(Action="http://1zf3701:8080/StockQuoteService/getQuote",
>
> RequestNamespace="http://1zf3701:8080/StockQuoteService/Quote.asmx",
>
> ResponseNamespace="http://1zf3701:8080/StockQuoteService/Quote.asmx",
> 	  ResponseElementName="getQuoteResponse") ]
> 	[ WebMethod(EnableSession=false) ]
> 	public long getQuot(string name)
> 	{
> 		...
> 	}
>
> Hope this helps
>
> Herve
>
>
> > -----Message d'origine-----
> > De : Brian Ingenito [mailto:BIngenito@extremelogic.com]
> > Envoyé : vendredi 16 mars 2001 13:56
> > À : soap-user@xml.apache.org
> > Objet : RE: Apache SOAP Client and .NET Web Service
> >
> >
> > This was excellent.  I've changed SoapEncUtils to not include the
> > xsi:type, and I changed TransportMessage to hardcode "text/xml" for
> the
> > content-type.  I have one more edit left before I'm up and running.
> > .NET doesn't accept the Apache generated namespace in the method
> > element.
> >
> > Apache Generated (after my edits):
> >
> > <SOAP-ENV:Body>
> > <ns1:getQuote
> > xmlns:ns1="http://1zf3701:8080/StockQuoteService/Quote.asmx"
> > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> > <Ticker>msft</Ticker>
> > </ns1:getQuote>
> > </SOAP-ENV:Body>
> >
> > .NET really doesn't like the namespace within the getQuote element.
> If
> > I change this body to the following and post through telnet it works
> > great.
> >
> > <SOAP-ENV:Body>
> > <getQuote xmlns="http://tempuri.org/">
> > <Ticker>msft</Ticker>
> > </getQuote>
> > </SOAP-ENV:Body>
> >
> > So...  the obvious question is how do I edit the Apache SOAP bits to
> > produce the .NET compatible namespace above?
> >
> > -Brian
> >
> > -----Original Message-----
> > From: Øyvind Habberstad [mailto:oyvindhabberstad@hotmail.com]
> > Sent: Thursday, March 15, 2001 4:31 PM
> > To: soap-user@xml.apache.org
> > Subject: RE: Apache SOAP Client and .NET Web Service
> >
> >
> > Hi, if you want to get rid of the xsi:type follow the description in
> > this
> > URL:
> > http://marc.theaimsgroup.com/?l=soap-dev&m=97901982213396&w=2
> >
> > I haven't tried to talk to .NET Web Services, but I'm talking to Web
> > Services made in MSSOAP Toolkit 2.0 beta2 from ApacheSOAP and the
> other
> > way
> > around.
> >
> > Oyvind.
> >
> >
> > >From: "Paul.Clifford" <Pa...@upco.co.uk>
> > >Reply-To: soap-user@xml.apache.org
> > >To: "'soap-user@xml.apache.org'" <so...@xml.apache.org>
> > >Subject: RE: Apache SOAP Client and .NET Web Service
> > >Date: Thu, 15 Mar 2001 15:14:54 -0000
> > >
> > >The SOAPAction should be detailed in the sdl file of the .NET
> Service.
> > >
> > >This aside, I am still aware of the problem with the xsi:type
> > parameters
> > >within element tags. Java/Apache clients place this in the soap
> > envelope,
> > >but MS Services don't expect it, and cause problems.
> > >
> > >Similar to when calling Apache Services from MS Clients.
> > >
> > >Hope this helps
> > >
> > >Paul Clifford
> > >UPCO
> > >Direct Line: 0113 20 10 636
> > >Fax: 0113 20 10 666
> > >Mobile: 07973 396031
> > >mailto:paul.clifford@upco.co.uk
> > >http://www.upco.co.uk
> > >
> > >The contents of this email are intented for the named addressees and
> > may
> > >contain confidential information and / or privileged material. If
> > received
> > >in error, please contact UPCO on +44 (0) 113 20 10 600 and then
> delete
> > the
> > >entire email from your system. Unauthorised review, distribution,
> > >disclosure
> > >or other use of this information could constitute a breach of
> > confidence.
> > >Your co-operation in this matter is greatly appreciated.
> > >
> > >
> > >
> > >-----Original Message-----
> > >From: Brian Ingenito [mailto:BIngenito@extremelogic.com]
> > >Sent: 15 March 2001 15:06
> > >To: soap-user@xml.apache.org
> > >Subject: Apache SOAP Client and .NET Web Service
> > >
> > >
> > >Has anyone successfully called a .NET web service from an Apache SOAP
> > >client?  No matter what I use for Actions and Targets, I always get
> an
> > >error saying that the server doesn't recognize the SOAPAction.
> > >
> > >Is there any example code for this floating around?
> > >
> > >-Thanks
> > >Brian
> >
> >
> ________________________________________________________________________
> > _
> > Get Your Private, Free E-mail from MSN Hotmail at
> > http://www.hotmail.com.