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 annie lu <an...@yahoo.com> on 2001/04/26 20:40:07 UTC

Access java webservice from .net

Hi, all
I am using Tomcat-Soap server to deploy java code to
webservice, and it's working well. 
I have a question, is it possible to consume java web
services from visual studio.net, I mean from vb.net or
c#. 

Thanks!
Annie.

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Re: Access java webservice from .net

Posted by Scott Nichol <sn...@computer.org>.
> I think microsoft soap api is diffrent from apache
> soap api. In .net,use url path to the web service, but
> in apache soap, use urn-service ID.
> I really want to call java web service from .net, or
> call .net web service from java, but I don't know how
> to do it.

I am pasting below a previous message from this list that I saved which contains some
information on .NET interoperability.

Scott Nichol

>>>>
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.
<<<<



Re: Access java webservice from .net

Posted by annie lu <an...@yahoo.com>.
I think microsoft soap api is diffrent from apache
soap api. In .net,use url path to the web service, but
in apache soap, use urn-service ID.
I really want to call java web service from .net, or
call .net web service from java, but I don't know how
to do it.

Annie.

--- Scott Nichol <sn...@computer.org> wrote:
> You will be able to.  I do not know about the
> interoperability of the current
> .NET framework beta, though, as I have not seen many
> messages here regarding
> that.  On the other hand, there has been much
> discussion here with respect to
> interoperability with the SOAP Toolkit. 
> Instructions or examples for SOAP
> Toolkit client and server coding have appeared on
> this list, and I have personal
> experience with SOAP Toolkit client code.
> 
> Scott
> 
> ----- Original Message -----
> From: "annie lu" <an...@yahoo.com>
> To: <so...@xml.apache.org>
> Sent: Thursday, April 26, 2001 2:40 PM
> Subject: Access java webservice from .net
> 
> 
> > Hi, all
> > I am using Tomcat-Soap server to deploy java code
> to
> > webservice, and it's working well.
> > I have a question, is it possible to consume java
> web
> > services from visual studio.net, I mean from
> vb.net or
> > c#.
> >
> > Thanks!
> > Annie.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - buy the things you want at great
> prices
> > http://auctions.yahoo.com/
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Re: Access java webservice from .net

Posted by Scott Nichol <sn...@computer.org>.
You will be able to.  I do not know about the interoperability of the current
.NET framework beta, though, as I have not seen many messages here regarding
that.  On the other hand, there has been much discussion here with respect to
interoperability with the SOAP Toolkit.  Instructions or examples for SOAP
Toolkit client and server coding have appeared on this list, and I have personal
experience with SOAP Toolkit client code.

Scott

----- Original Message -----
From: "annie lu" <an...@yahoo.com>
To: <so...@xml.apache.org>
Sent: Thursday, April 26, 2001 2:40 PM
Subject: Access java webservice from .net


> Hi, all
> I am using Tomcat-Soap server to deploy java code to
> webservice, and it's working well.
> I have a question, is it possible to consume java web
> services from visual studio.net, I mean from vb.net or
> c#.
>
> Thanks!
> Annie.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/