Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Webservices and browsers

by jhourcle (Prior)
on Feb 27, 2009 at 02:11 UTC ( #746735=note: print w/ replies, xml ) Need Help??

in reply to Webservices and browsers

The scrpt is not a CGI -- it doesn't emit HTTP headers (Content-type).

A web browser is not a SOAP client -- it doesn't emit the necessary HTTP headers (SOAPAction) or send a SOAP message.

If you want to write a CGI that's also a SOAP client, that's fine -- but you can't just throw any old executable on a webserver and expect it to work.

Try the following.

use CGI; print CGI-header; use SOAP::Lite; print SOAP::Lite -> uri('') -> proxy('') # set this to your SOAP service URL -> hi() -> result;

Comment on Re: Webservices and browsers
Download Code
Replies are listed 'Best First'.
Re^2: Webservices and browsers
by joec_ (Scribe) on Mar 02, 2009 at 09:36 UTC

    Can you tell me if it is possible to consume a perl webservice from within .NET (C#)? Obviously, these simple perl web services dont use WSDLs or XML because, when for example i try to access my web service from C#, i get an error message stating that XML was expected and it "received text/plain" - this was using the example service on the soap lite site, which just returned a simple string and not a SOAP envelope?!.

    I am new to web services and think i need some clarification

    Any help appreciated

    Thanks --Joe


    Eschew obfuscation, espouse eludication!

      The text/plain thing sounds like a problem -- make sure that the CGI is actually executing, and not just the file being returned.

      I've run into a few problems when people tried consuming a SOAP::Lite service using a strictly typed language, and I had to do some work in making sure it serialized correctly -- I had a few items that were strings of numbers, and SOAP::Lite kept marking it as numbers -- I was using RPC/encoded SOAP, and not using SOAP::Data to declare what the values were, as I was getting them from another SOAP call. In the end, I replaced SOAP::Serializer to make sure it sent what I wanted.

      I believe that issues of compatibility have come up in the past on the soaplite mailing list -- you might check their archives, but it's also possible that it's no longer an issue as they've moved away from the overhead of RPC/encoded messages.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://746735]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2015-11-25 16:41 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (683 votes), past polls