Re: SOAP::Lite & WSDL Problem
by ForgotPasswordAgain (Vicar) on Aug 27, 2008 at 08:32 UTC
|
...
use SOAP::Lite +trace => 'all';
...
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Ser
+ver Error.
...
<soap:Fault>
<faultcode>soap:VersionMismatch</faultcode>
<faultstring>System.Web.Services.Protocols.SoapException: Possib
+le SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.o
+rg/wsdl/soap/ was unexpected. Expecting http://schemas.xmlsoap.org/so
+ap/envelope/.
at System.Web.Services.Protocols.SoapServerProtocol.CheckHelperVers
+ion()
at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters(
+)
at System.Web.Services.Protocols.WebServiceHandler.Invoke()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessReque
+st()</faultstring>
<detail />
</soap:Fault>
You might want to look in the "INTEROPERABILITY" section in the SOAP::Lite docs. Note that there's also a SOAP::WSDL module that I've noticed being worked on recently but haven't tried yet. | [reply] [d/l] |
Re: SOAP::Lite & WSDL Problem
by tilly (Archbishop) on Aug 27, 2008 at 16:04 UTC
|
I had a similar problem last year. After trying several things I gave up on doing WSDL in Perl and wrote my project in Java.
Since then XML::Compile has come on the scene. I have heard better things about its WSDL support than previously Perl modules, but I have not personally tried it. Still it is worth a shot. | [reply] |
Re: SOAP::Lite & WSDL Problem
by Khen1950fx (Canon) on Aug 27, 2008 at 17:39 UTC
|
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite;
use SOAP::WSDL;
my $soap = SOAP::Lite->service('http://www.webservicex.net/globalweat
+her.asmx?WSDL');
$soap->GetCitiesByCountry('Singapore');
print $soap, "\n";
| [reply] [d/l] |
|
|
"worked" how? It doesn't print anything useful.
| [reply] |
Re: SOAP::Lite & WSDL Problem
by Perlbotics (Archbishop) on Aug 27, 2008 at 18:57 UTC
|
Works 'somehow' under perl 5.8.8 (SuSE Linux 10.2).
Versions: SOAP::Lite v0.60, WSDL v2.00.05
When dumping the response using Data::Dumper, I get:
...
'System.Web.Services.Protocols.SoapException: Server was unable to p
+rocess request. ---> System.Data.SqlClient.SqlException: Procedure or
+ function \'getWCity\' expects parameter \'@CountryName\', which was
+not supplied.
at WebServicex.GlobalWeather.GetCitiesByCountry(String CountryName)
...
So, there seems to be a problem with the query or what the WDSL module made with it?
I guess, you already checked connectivity- and name resolution issues like i.e. telnetting port 80 of 209.162.186.60?
| [reply] [d/l] [select] |
Re: SOAP::Lite & WSDL Problem
by morgon (Priest) on Nov 29, 2009 at 23:34 UTC
|
I have exactly the same problem.
The thing is that SOAP::Lite uses the wrong namespace in the envelope here.
The funny thing is that if you do this:
my $soap = SOAP::Lite->service("http://www.webservicex.net/globalweath
+er.asmx?WSDL");
print Dumper($soap->serializer->{_namespaces});
you can see that the proper namespace is actually registered but it later seems to get overwritten in the serializer...
Explicitely calling register_ns does not change a thing, so I really think it is a bug.
I finally got it working (without WSDL alas) like this:
use strict;
use SOAP::Lite +trace => "debug";
my $address = 'http://www.webservicex.net/globalweather.asmx';
my $action = "http://www.webserviceX.NET/GetCitiesByCountry";
my $namespace = 'http://www.webserviceX.NET';
my $call = "GetCitiesByCountry";
my $soap = SOAP::Lite
->uri($namespace)
->on_action(sub { $action } )
->proxy($address);
my $arg = SOAP::Data->name(CountryName => "Singapore");
$soap->call($call => $arg);
Quite a lot of work for such a simple thing - is this because .NET is quirky or is it that SOAP::Lite (I have 0.710.10) has problems with WSDL (or am I simply being stupid?). | [reply] [d/l] [select] |
Re: SOAP::Lite & WSDL Problem
by Chewy (Initiate) on Jan 10, 2010 at 19:53 UTC
|
I ran into the same problem with a WSDL provided by a Sun Glassfish server, the result is just empty, whereas I expect to get "Hello Chewy"
Using python suds this works without problems.
My code:
use SOAP::Lite +trace => "debug";
use SOAP::WSDL;
use Data::Dumper;
my $soap = SOAP::Lite->service("http://172.16.15.148:8081/Webservice/W
+ebserviceService?wsdl");
print Dumper($soap->serializer->{_namespaces});
print "\n\nRESULT:\n".Dumper $soap->hello('Chewy')."\n\n";
Result (shortened):
$VAR1 = {
'http://www.w3.org/2001/XMLSchema' => 'xsd',
'http://schemas.xmlsoap.org/soap/encoding/' => 'soapenc',
'http://www.w3.org/2001/XMLSchema-instance' => 'xsi',
'http://schemas.xmlsoap.org/soap/envelope/' => 'soap'
};
SOAP::Transport::HTTP::Client::send_receive: POST http://172.16.15.148
+:8081/Webservice/WebserviceService HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 567
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
__cut__
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/
+soap/envelope/"><S:Body><ns2:helloResponse xmlns:ns2="http://Webservi
+ces/"/></S:Body></S:Envelope>
RESULT:
$VAR1 = '
';
Is there any way I can make Perl use this WSDL. I also used stubmaker.pl (SOAP::Lite) and then using the created packages. However also there the results are empty. | [reply] [d/l] [select] |
Re: SOAP::Lite & WSDL Problem
by rahed (Scribe) on Aug 28, 2008 at 19:54 UTC
|
There are issues with generating a soap call directly from wsdl.
I get an answer with this code:
$soap = SOAP::Lite->new(
uri => ("http://www.webserviceX.NET"),
proxy => ('http://www.webservicex.com/globalweather.asmx')
+,
);
$soap->on_action(sub{join '/',@_ });
my $city = SOAP::Data->name(CountryName => 'Singapore');
my $som = $soap->GetCitiesByCountry($city);
if (my $match = $som->match('/Envelope/Body/GetCitiesByCountryResponse
+/')) {
print "match is OK: $match\n";
my $result = $som->valueof('//GetCitiesByCountryResponse/GetCitiesBy
+CountryResult');
print Dumper($result);
} else {
print "match not OK: $match\n";
}
printing...
match is OK: 1
$VAR1 = '<NewDataSet>
<Table>
<Country>Singapore</Country>
<City>Singapore / Paya Lebar</City>
</Table>
<Table>
<Country>Singapore</Country>
<City>Singapore / Changi Airport</City>
</Table>
</NewDataSet>';
| [reply] [d/l] [select] |
|
|
| [reply] |
|
|
To be clearer - I have a service that responds fine to my hand-crafted XML sent using LWP, but b0rks when I try to access it via SOAP::Lite. I suspect the WSDL stuff is the key to what's going wrong, but unfortunately I don't have the 'proxy' URL available to me.
| [reply] |
|
|
I saw some people had poor results with generating xml code directly from service description.
I tried several times to verify and wasn't successful as well but didn't dig into.
I prefer coding the message through SOAP::Data class manually.
| [reply] |