Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > SOAP::WSDL, wsdl2perl and soap 1.2

Reply
Thread Tools

SOAP::WSDL, wsdl2perl and soap 1.2

 
 
Me
Guest
Posts: n/a
 
      04-08-2010
Hi all,
I am trying to generate access classes for a webservice client using
wsdl2perl and I am encountering some problems:
1) The interface class is not created.
the wsdl I have uses soap1.2 namespace, if I change it to use plain
soap ("http://schemas.xmlsoap.org/wsdl/soap/") wsdl2perl manages to
create the interface class but then I get problem number 2

2) When I try to make a call using the autogenerated interface, the
remote server (over which I have no control) responds with:
"Cannot process the message because the content type 'text/xml;
charset=utf-8' was not the expected type 'application/soap+xml;
charset=utf-8'".

wsdl2perl also gives me the following warnings:
"XML Schema element <appinfo> is not implemented yet at /usr/share/
perl5/SOAP/WSDL/Expat/WSDLParser.pm line 254." (I get 4 of these).
and
"found unrecognised attribute {http://www.w3.org/2006/05/addressing/
wsdl}Action (ignored) at /usr/share/perl5/SOAP/WSDL/Base.pm line 130."
The latter comes from this element in the wsdl: '<wsdl:input
wsaw:Action="http://tempuri.org....'
Apparently it is not allowed to use namespaces for attribute names ?
(wsaw is "http://www.w3.org/2006/05/addressing/wsdl" in case that
matters).

I believe the server is a .NET thing.

I am quite unexperienced when it comes to XML and SOAP, any pointer
will be appreciated.

thanks
 
Reply With Quote
 
 
 
 
RedGrittyBrick
Guest
Posts: n/a
 
      04-08-2010
On 08/04/2010 08:15, Me wrote:
> Hi all,
> I am trying to generate access classes for a webservice client using
> wsdl2perl and I am encountering some problems:
> 1) The interface class is not created.
> the wsdl I have uses soap1.2 namespace, if I change it to use plain
> soap ("http://schemas.xmlsoap.org/wsdl/soap/") wsdl2perl manages to
> create the interface class but then I get problem number 2
>
> 2) When I try to make a call using the autogenerated interface, the
> remote server (over which I have no control) responds with:
> "Cannot process the message because the content type 'text/xml;
> charset=utf-8' was not the expected type 'application/soap+xml;
> charset=utf-8'".
>
> wsdl2perl also gives me the following warnings:
> "XML Schema element<appinfo> is not implemented yet at /usr/share/
> perl5/SOAP/WSDL/Expat/WSDLParser.pm line 254." (I get 4 of these).
> and
> "found unrecognised attribute {http://www.w3.org/2006/05/addressing/
> wsdl}Action (ignored) at /usr/share/perl5/SOAP/WSDL/Base.pm line 130."
> The latter comes from this element in the wsdl: '<wsdl:input
> wsaw:Action="http://tempuri.org....'
> Apparently it is not allowed to use namespaces for attribute names ?
> (wsaw is "http://www.w3.org/2006/05/addressing/wsdl" in case that
> matters).
>
> I believe the server is a .NET thing.
>
> I am quite unexperienced when it comes to XML and SOAP, any pointer
> will be appreciated.



I've not tried wsdl2perl but I have generated Perl clients for non-Perl
SOAP services and .Net clients for Perl SOAP services.

SOAP 1.2 tends to choke a few tools I've tried. I had to resort to trial
and error on one occasion.

Perl modules such as SOAP::Lite are oriented to RPC/encoded style of
SOAP calls whereas .Net is oriented towards Doc/Literal.

RPC/encoded example

<soap:envelope>
<soap:body>
<ns:methodName>
<param xsi:type="xsd:int">123</param>

DOC/Literal example

<soap:envelope>
<soap:body>
<param>123</param>


Doc/Literal/Wrapped is a kind of combination of these two styles.

In past cases I've found the easiest approach is to use a sniffer
(Wireshark is good) on a .Net client and tweak my Perl client until the
on-the-wire packets match those of the .Net client. Obviously you can't
do this if you don't have a sample .Net client (or can't generate one
with .Net tools or mono etc).

There's also a difference in the way the HTTP SOAPAction header is
constructed.

$request->header(SOAPAction => qq("$uri#$method")); # perl service
$request->header(SOAPAction => qq("$uri/$method")); # java service
$request->header(SOAPAction => qq("")); # java service

Some services don't care about the SOAPAction header, others do. Experiment.

The *Simple* Object Access Protocol *isn't* simple and real-life
interoperability is disappointing.

--
RGB
 
Reply With Quote
 
 
 
 
Me
Guest
Posts: n/a
 
      04-09-2010
On 8 Apr, 11:50, RedGrittyBrick <(E-Mail Removed)>
wrote:
....
> The *Simple* Object Access Protocol *isn't* simple and real-life
> interoperability is disappointing.


yep, I am beginning to realise that.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wsdl2perl.pl doesn't completely parse the WSDL file for all its types Ted Byers Perl Misc 1 05-08-2012 09:47 PM
How to make soap request and receive soap response from php soapservice Ivan S ASP .Net 0 08-13-2008 03:35 PM
SOAP and .NET: <env: vs <soap: Nick Gauthier Ruby 0 02-13-2008 04:36 PM
To SOAP or Not To SOAP? mooseshoes XML 3 09-21-2003 04:38 PM
SOAP Client creation in ASP.NET using MS SOAP Toolkit Sham Ramakrishnan ASP .Net 2 07-01-2003 11:29 AM



Advertisments