SOAP::WSDL, wsdl2perl and soap 1.2


M

Me

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
 
Ad

Advertisements

R

RedGrittyBrick

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.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top