Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Anyone used C# .NET to consume a Perl SOAP::Lite service?

52 views
Skip to first unread message

J. Patrick Brandt

unread,
Aug 4, 2003, 1:52:10 AM8/4/03
to
Hey All -

I have seen posts *close* to this, but most address talking to a .NET
Service from Perl SOAP::Lite. I need to talk to a Perl SOAP::Lite Service
from .NET.

Here is what I have tried:

1) *** Perl consuming C# .NET Service. OK.
2) *** Perl Consuming IIS Perl Service OK (activestate.com)
3) *** C# consuming IIS C# Service OK.
4) *** C# consuming IIS (or Linux) Perl SOAP::Lite Service - NO LUCK.

Case 4 is the big question.

Note: The service doesn't server up WSDL, so I can't just have wsdl.exe
write a proxy for me :-(

Here is a sample Server:
----
#!/usr/local/bin/perl5.8.0 -w

use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI
-> dispatch_to('Demo')
-> handle;

package Demo;

sub new {
bless {}, shift;
};

sub hi {
my ($self) = @_;

return "\nhello, world\n\n";
}

----

Here is a Perl SOAP::Lite Client that works OK:

----
#!/usr/bin/perl -w

use SOAP::Lite +trace => "debug";
# use SOAP::Lite;

print SOAP::Lite
-> uri('Demo')
-> proxy('http://192.168.1.100/cgi-bin/hello_arg.cgi')
-> hi()
-> result;

----

I have a .NET (C#) Client that can call the service, but doesn't display any
results. (Doesn't get any errors either..., it is like a null string is
returned, instead of the expected "hello world".)

----

*** s.cs

using System;

class TestApp
{

[STAThread]
static void Main()
{
SSim ssim = new SSim();


Console.WriteLine("SSim.hi: "+ssim.hi());
}
}


*** ssim.cs:

using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;


[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="SSimSoap",
Namespace="Demo" )]
public class SSim : System.Web.Services.Protocols.SoapHttpClientProtocol {

public SSim() {
this.Url = "http://192.168.1.102/Test/hello_arg.pl";
//this.Url = "http://localhost:8080/Test/hello_arg.pl";
}


[System.Web.Services.Protocols.SoapDocumentMethodAttribute("Demo#hi",
RequestNamespace="Demo",
ResponseNamespace="Demo",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
//Use=System.Web.Services.Description.SoapBindingUse.Encoded,
public string hi() {
object[] results = this.Invoke("hi", new object[0]);
return ((string)(results[0]));
}


*** csc s.cs ssim.cs

----

Curious, I wrote a .NET service and a SOAP::Lite client and had no problem
either...

Does anyone have a simple "hello world" type example of a .NET client
consuming a SOAP::Lite Service?

I suspect it has to do with the 1999 vs 2001 spec usage, or something
simple, but I just don't know.
literal vs encoded, rpc vs document? what?

Thanks!


J. Patrick Brandt

unread,
Aug 5, 2003, 7:59:32 PM8/5/03
to
Here is my own answer. I swear I had tried this before, but this time it
worked (i.e. I get a response from the SOAP::Lite service all the way up
into my C# Client where I can see it.)

Use=System.Web.Services.Description.SoapBindingUse.Encoded, // Was Literal

now you know.

"J. Patrick Brandt" <spam...@null.com> wrote in message
news:avmXa.5874$Ye.5664@fed1read02...

0 new messages