Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

SOAP::Lite server with c sharp client

by grifhis (Novice)
on Apr 24, 2014 at 14:40 UTC ( #1083612=perlquestion: print w/replies, xml ) Need Help??
grifhis has asked for the wisdom of the Perl Monks concerning the following question:

Hello! I have problems with Web Service "Soap Lite". I need to have a soap lite server compatible with Soap client c sharp. But the client has null response. In the server prompt i see the request (from c sharp) and the response (from perl) and it seems correct but i found no response in the client. I see the xml response and request, they are different in the xml tags, is there a way to manipulate the perl response so i can send a "soap xml" with different tags? here is my code:

use strict; use warnings; system("color 1e"); use SOAP::Lite + trace => 'all'; #use SOAP::Lite; #use SOAP::Schema::WSDL; my $IP = ''; #--------------------------------------------------------------------- +--------------------- # parametr my $input = 'invio di test...'; #--------------------------------------------------------------------- +------ # service... my $client = SOAP::Lite ->service("http://$IP/eCHS/html/SERVICE/e-serv +ice.wsdl"); #--------------------------------------------------------------------- +------ # QUERY per eCHS.... my $result = $client->test_query( $input ); + # query 1 #--------------------------------------------------------------------- +------ # PROMPT print "---------------------------------------"; print "\n [ Web Service Client - eCHS]\n"; print "---------------------------------------\n"; print "\n\n> result: ".$result; # float print "\n\n\n\n"; system("pause"); #--------------------------------------------------------------------- +----- exit;

here is the c sharp client:

// SERVICE REFERENCE-SPECIFIC CODE MyService.FUNCTIONPortClient soapClient = new MyService.FUNCTIONPortC +lient (); result = soapClient.test_query("test from c# ! "); try { this.output.Text = "Querying the Web Service... answer: " + + result; } catch (Exception error) { this.output.Text = error.Message; }

of course i used "service reference" in c sharp.. any suggestion is appreciated...

Replies are listed 'Best First'.
Re: SOAP::Lite server with c sharp client
by Anonymous Monk on Apr 24, 2014 at 23:36 UTC

    ...any suggestion is appreciated...

    I don't know C# (dont have it), but where in your C# code is the "URL" specified?

      In C# the url is in "Service Reference" configuration. It takes the url of the WSDL file... The problem is that the XML response sent from server perl is different from the XML response aspected from C#. I use this code in PM file to return the response from server:

      # $return elaborated my $response = SOAP::Data -> new() ->name('response') ->prefix('') ->type('string') ->uri('FUNCTION') ->value($result); return $response;

      I need to know how the server can make a correct XML response for DotNet. Probably the solution is a better use of "SOAP::Data -> new()" to write the correct tags and header...

        The problem is .... I need to know how the server can make a correct XML response for DotNet. Probably the solution is a better use of "SOAP::Data -> new()" to write the correct tags and header...

        Kinda almost but not really -- DotNet is not a SOAP message format ... you need to learn more about SOAP :)

        Does you message (the SOAP::Data...) stuff matches your advertised WSDL? If it doesn't you should adjust WSDL until it advertises the correct "stuff".

        If the xml generated and WSDL are close enough, its most likely the SOAP message styles ( RPC/ENCODED/RPC/LITERAL/DOCUMENT/LITERAL ) that aren't matching ...

        There are a bunch of suggestions on that starting at Microsoft .NET client with SOAP::Lite Server including Modify your .NET server, if possible

        Yes, I can't really help and I do hate SOAP :)

Re: SOAP::Lite server with c sharp client
by sundialsvc4 (Abbot) on Apr 24, 2014 at 15:44 UTC

    Okay, well, there is only one way to chase this sort of thing down:   put on your sleuthing hat.   We can presume that the software on both sides knows very well how to do SOAP, so it’s gonna turn out to be something stupid.   ;-)   Let’s go find it . . .

    1. First, dump exactly what you think your app is sending, and make extremely sure that it is sending it.   Is it a legitimate SOAP payload?   (Yeah?   Well then, prove it.   Don’t assume anything.   Prove everything.)
    2. Now to the Microsoft side.   Is there really a connection?   Does the C# app produce any sort of counter or input to indicate that it is actually receiving anything?   Does it, or any library package that it is using, make any entries in the Application Event-Log?   Check that viewer ... Microsoft apps often carry on quite a chat-storm in the event log viewer.
    3. Dummy-up a little client in Perl and see if your server actually responds as expected to that.
    4. Still stumped?   Try a tool like Wireshark.   See the connection being made, the information being sent, the response coming back.   Note that Wireshark cannot decrypt an SSL connection, but it can do traffic analysis.   You should see that “ping” followed promptly by that “pong,” and both ping-pong balls should be of a believable size.   (A very-short return-ball is probably an error message.   If the TCP/IP stack refuses to successfully send or receive the messages, you should clearly see that, too.)

    Resist the temptation to whack yourself on the forehead, when you find the problem.   If you do say "doh!!" (and it is fairly likely that you will, in situations like this), then please do so quietly.   ;-)

      (Yeah? Well then, prove it. Donít assume anything. Prove everything.)

      If only you would live by the creeds you seek to recommend to others.

      The only things you have ever proved here at PM is that you know almost nothing about Perl or program development; and you are incapable of constructing a single, short, working perl program. Both are proved by the empirical evidence of your posting history.

      The only other proof associated with you is that 99% of what you write here serves no useful purpose.

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1083612]
Approved by ww
and !@monks...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-04-24 13:27 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (439 votes). Check out past polls.