SOAP::WSDL, wsdl2perl and soap 1.2

Discussion in 'Perl Misc' started by Me, Apr 8, 2010.

  1. Me

    Me Guest

    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
     
    Me, Apr 8, 2010
    #1
    1. Advertising

  2. 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
     
    RedGrittyBrick, Apr 8, 2010
    #2
    1. Advertising

  3. Me

    Me Guest

    On 8 Apr, 11:50, RedGrittyBrick <>
    wrote:
    ....
    > The *Simple* Object Access Protocol *isn't* simple and real-life
    > interoperability is disappointing.


    yep, I am beginning to realise that.
     
    Me, Apr 9, 2010
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dark
    Replies:
    1
    Views:
    4,652
    milfar
    Nov 14, 2008
  2. Chris Bedford
    Replies:
    0
    Views:
    600
    Chris Bedford
    Aug 21, 2003
  3. Stephen Edgecombe

    WSDL.EXE: WSDL Import Directive

    Stephen Edgecombe, Aug 13, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    262
    Stephen Edgecombe
    Aug 13, 2003
  4. RH
    Replies:
    1
    Views:
    276
    Dino Chiesa [Microsoft]
    May 27, 2004
  5. Ted Byers
    Replies:
    1
    Views:
    1,126
    J. Gleixner
    May 8, 2012
Loading...

Share This Page