You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by HariNam Singh <hs...@elite.com> on 2001/07/05 21:58:27 UTC

RE: C# and Apache SOAP interoperability... - response vs result

well, still adding to this thread ;-)

I trapped the response from C# II Server service and compared it to the
Apache SOAP service response. The tag that is used inside the body is
different. Apache uses '[serviceName]Response' and C# useses
'[serviceName]Result'. It seems rather strange that there is such a blatant
difference. I would think the spec is clear on this. Can anyone illuminate
me on more background information for this topic?

For clarity, here is the part produced by Apache SOAP:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xm
lns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org
/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:soapReadResponse xmlns:ns1="swifta"
SOAP-ENV:encodingStyle="http://schemas.
xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">C not so sharp</return>
</ns1:soapReadResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


And, here is the part, which is produced by C#. It's another service, but
that shouldn't bother the examination of the structure of the document.:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">   
 <soap:Body>     
  <sayHelloResult xmlns="http://tempuri.org/">       
   <result>buenos dias</result>     
  </sayHelloResult>   
 </soap:Body> 
</soap:Envelope>


-----Original Message-----
From: HariNam Singh [mailto:hsingh@elite.com]
Sent: Thursday, July 05, 2001 8:39 AM
To: 'soap-user@xml.apache.org'
Subject: RE: C# and Apache SOAP interoperability...


Janesh,

here is one of my sample files. It's uncommented, as I kept moving things
around. Also, The Http request works out fine, but it doesn't know, how to
handle the response from Apache SOAP..... Anyway, it may get you started.

C:\Documents and Settings\hsingh\mine>cat Proxy4.cs
namespace Dude
{// Allow easy reference System namespace classes
using System;
using System.Xml.Serialization;
using System.Web.Services.Protocols;
using System.Web.Services;

// This "class" exists only to house entry-point
class MainApp2 : SoapClientProtocol {

   public MainApp2() {
      Console.WriteLine("in constructor");
      this.Url = "http://172.25.3.55:8081/soap/servlet/rpcrouter";
   }

 
[System.Web.Services.Protocols.SoapMethodAttribute(RequestNamespace="swifta"
, ResponseElementName="soapReadResult")]
   public void soapRead(String queue) {
     Console.WriteLine("begin soapRead");
     try {
      this.Url = "http://172.25.3.55:8081/soap/servlet/rpcrouter";
      object[] result = this.Invoke("soapRead", new string[] {queue});
      Console.WriteLine("in soapSend" + result[0]);
     } catch(Exception ex) {
      Console.WriteLine(ex.ToString());
      Console.WriteLine("caught exception" + this.Url);
     }
   }
}

class MainApp {

   // Static method "Main" is application's entry point
   public static void Main() {
      // Write text to the console
      Console.WriteLine("Hello World using C#!");
//      (new MainApp2()).soapSend();
      MainApp2 app2 = new MainApp2();
      app2.soapRead("testqueue@router1");
      Console.WriteLine("after method call");
   }
}
}




-----Original Message-----
From: Janesh Vasudeva [mailto:jvasudeva@asapsolutions.com]
Sent: Wednesday, July 04, 2001 11:53 PM
To: soap-user@xml.apache.org
Subject: Re: C# and Apache SOAP interoperability...


Harinam

I ahve installed .net framework on my machine , now i want to build Soap
Client for interacting with Java Soap server .
What other thing do i need for Soap with C#?
Second send me sample file , if u have?

Janesh Kumar Vasudeva
ASAP Sols Pvt Ltd
B-3 Sector -4 Noida
Ph. No. 91-4443211/3212/3213

----- Original Message -----
From: "HariNam Singh" <hs...@elite.com>
To: <so...@xml.apache.org>
Sent: Tuesday, July 03, 2001 10:16 PM
Subject: RE: C# and Apache SOAP interoperability...


> Janesh,
>
> I don't have my C# client working fully yet. All you need is .NET beta,
> which is a free download from Microsoft. You want to be careful, as there
is
> no uninstall for it. Microsoft explicitly warns that the system is
'useless'
> after the installation for production use.
>
> Then, when you go to the O'Reilly web site, there is a sample chapter for
> the '.NET Framework' book, which just happens to talk exactly about that.
> Microsoft documentation is horrible as usual. To make things even more
fun,
> it occasionally gives you error messages, so that you can't even see
certain
> topics....
>
>
> HariNam
>
> -----Original Message-----
> From: Janesh Vasudeva [mailto:jvasudeva@asapsolutions.com]
> Sent: Monday, July 02, 2001 9:45 PM
> To: soap-user@xml.apache.org; hsingh@elite.com
> Subject: Re: C# and Apache SOAP interoperability...
>
>
> Hi
>
> I am new to C#, I had developed java client successfully to interact with
> soap server, i want to do the same with C#.
> Please tell me what tools, and API's do we need to have C#, and run it as
> soap client.
>
> Thanks
> Janesh
>
> ----- Original Message -----
> From: HariNam Singh <hs...@elite.com>
> To: <so...@xml.apache.org>
> Sent: Monday, July 02, 2001 10:04 PM
> Subject: RE: C# and Apache SOAP interoperability...
>
>
> > Allen,
> >
> > that's good to know. I tried another of my web services, which returns a
> > string. It's the same error message. Any other ideas, or sources, where
to
> > look for information? Somehow, I find the msdn documentation very hard.
> > Even, when there are source code samples, they contain no documentation
at
> > all. Thus making it hard to understand their conecept behind it. I'd
> rather
> > understand, what I am doing, then just copying'n'pasting code and
changing
> > things until it works.
> >
> >
> > HariNam
> >
> > -----Original Message-----
> > From: AByrne@atgf.com [mailto:AByrne@atgf.com]
> > Sent: Monday, July 02, 2001 9:20 AM
> > To: soap-user@xml.apache.org
> > Subject: RE: C# and Apache SOAP interoperability...
> >
> >
> > Microsoft clients can not deal with 'void' returns, the method you are
> > calling must have a return value of something other than type void. Is
> this
> > the problem?
> >
> > Allen
> >
> > -----Original Message-----
> > From: HariNam Singh [mailto:hsingh@elite.com]
> > Sent: Monday, July 02, 2001 10:52 AM
> > To: 'soap-user@xml.apache.org'
> > Subject: C# and Apache SOAP interoperability...
> >
> >
> > ... or just someone not knowing C# well enough ;-)
> >
> > Here is the story. I downloaded Apache SOAP 2.2 and wrote Java web
service
> > for it. The Java client for it works fine as well. As a proof of
concept,
> I
> > wrote a C# client to it. The client can successfully invoke Apache web
> > services. Though, it just can't deal with the response that it gets
back.
> > The MS documentation is either horrible or well hidden ;-) Does anyone
> have
> > some ideas.
> >
> > Please, find below
> > 1. C# source code
> > 2. C# runtime output
> > 3. HTTP response captured by tunnel utility.
> >
> > Thanks a lot,
> > HariNam
> >
> > namespace Dude
> > {// Allow easy reference System namespace classes
> > using System;
> > using System.Xml.Serialization;
> > using System.Web.Services.Protocols;
> > using System.Web.Services;
> >
> > // This "class" exists only to house entry-point
> > class MainApp2 : SoapClientProtocol {
> >
> >    public MainApp2() {
> >       Console.WriteLine("in constructor");
> >       this.Url = "http://172.25.3.55:8081/soap/servlet/rpcrouter";
> >    }
> >
> >
> >
>
[System.Web.Services.Protocols.SoapMethodAttribute(RequestNamespace="swifta"
> > )]
> >    public void soapRead(String queue) {
> >      Console.WriteLine("begin soapRead");
> >      try {
> >       this.Url = "http://172.25.3.55:8081/soap/servlet/rpcrouter";
> >       object[] result = this.Invoke("soapRead", new string[] {queue});
> >       Console.WriteLine("in soapSend" + result[0]);
> >      } catch(Exception ex) {
> >       Console.WriteLine(ex.ToString());
> >       Console.WriteLine("caught exception" + this.Url);
> >      }
> >    }
> > }
> >
> > class MainApp {
> >
> >    // Static method "Main" is application's entry point
> >    public static void Main() {
> >       // Write text to the console
> >       Console.WriteLine("Hello World using C#!");
> > //      (new MainApp2()).soapSend();
> >       MainApp2 app2 = new MainApp2();
> >       app2.soapRead("testqueue@router1");
> >       Console.WriteLine("after method call");
> >    }
> > }
> > }
> >
> > -------------------------------------------------------
> >
> >
> > C:\Documents and Settings\hsingh\mine>Proxy3
> > Hello World using C#!
> > in constructor
> > begin soapSend
> > System.Exception: The request failed with HTTP status code 200 and the
> error
> > mes
> > sage:
> > --
> > <?xml version='1.0' encoding='UTF-8'?>
> > <SOAP-ENV:Envelope
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xm
> > lns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> > xmlns:xsd="http://www.w3.org
> > /1999/XMLSchema">
> > <SOAP-ENV:Body>
> > <ns1:soapSendResponse xmlns:ns1="swifta"
> > SOAP-ENV:encodingStyle="http://schemas.
> > xmlsoap.org/soap/encoding/">
> > </ns1:soapSendResponse>
> >
> > </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > --.
> >    at
> >
System.Web.Services.Protocols.SoapClientProtocol.ReadResponse(SoapClientMe
> > ssage message, HttpClientResponse response)
> >    at System.Web.Services.Protocols.SoapClientProtocol.Invoke(String
> > methodName,
> >  Object[] parameters)
> >    at Dude.MainApp2.soapSend(String queue, String message)
> > caught exceptionhttp://172.25.3.55:8081/soap/servlet/rpcrouter
> > after method call
> >
> > -----------------------------------------------------------------
> >
> > HTTP/1.0
> > 200 OK
> > Content-Type: text/xml;
> > charset=utf-8 Content-Length: 413 Set-Cookie2: JSESSIONID=0nb1rxxrv1;
> > Version=1;
> > Discard;Path="/soap" Set-Cookie: JSESSIONID=0nb1rxxrv1;
> > Path=/soap Servlet-Engine: Tomcat Web Server/3.2.2 (JSP 1.1; Servlet
2.2;
> > Java 1.3.1; Windows 2000 5.0 x86; java.vendor=Sun Microsyste
> > <?xml version='1.0' encoding='UTF-8'?>
> >  <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:soapSendResponse xmlns:ns1="swifta" SOAP-
> >          E NV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> >     </ns1:soapSendResponse>
> >   </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > -----Original Message-----
> > From: Chiranjeevi Paruchur [mailto:CParuchur@orga.com]
> > Sent: Monday, July 02, 2001 7:54 AM
> > To: soap-user@xml.apache.org
> > Subject: Re: Deployment error while running addressbook
> >
> >
> >
> > Thanks Tom,
> >
> > It just worked.
> >
> > Chiran
> >
> >
> >
> >
> >                     Tom Myers
> >
> >                     <tommyers@dream        To:
> soap-user@xml.apache.org
> >
> >                     scape.com>             cc:
> soap-user@xml.apache.org
> >
> >                                            Subject:     Re: Deployment
> error
> > while running addressbook
> >                     02/07/01 16:48
> >
> >                     Please respond
> >
> >                     to soap-user
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > At 03:38 PM 7/2/2001 +0200, Chiranjeevi Paruchur wrote:
> > ... Fault String = Deployment error in SOAP service
'urn:AddressFetcher':
> > class na
> > >me 'samples.addressbook.Address' could not be resolved:
> > samples.addressbook.Addr
> > >ess
> > >
> > >MY CLIENT CLASSPATH
> > >
> > >Client
> >
>
CLASSPATH=/opt/colada/soap-2_2/lib/soap.jar:/opt/colada/javamail/mail.jar:/o
> > pt/c
> >
>
>olada/jaf/activation.jar:/opt/colada/xerces-1_4_1/xerces.jar:/opt/tomcat/li
> > b/:/o
> > >pt/java1.3/tools.jar:.:/opt/colada/soap-2_2
> > >
> > >
> > >MY SERVER CLASSPATH
> > >
> > >Sever
> >
>
CLASSPATH=/opt/colada/soap-2_2/lib/soap.jar:/opt/colada/javamail/mail.jar:/o
> > pt/c
> >
>
>olada/jaf/activation.jar:/opt/colada/xerces-1_4_1/xerces.jar:/opt/tomcat/li
> > b/
> >
> > The Address class is in soap-2_2/samples/addressbook/Address.class, and
is
> > needed by
> > both client and server code. Your client path contains
> /opt/colada/soap-2_2,
> > but the
> > server does not. (or maybe I'm just not seeing something, again.)
> >
> > Tom Myers
> >
> >
>