SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring

    [Also posted in comp.lang.perl.moderated]

    Hello,

    I have a problem with a SOAP client written in Perl (source at the end).
    I've tried both ways (by commenting TRIAL ONE or SECOND TRIAL), and I
    get exactly the same results.

    When I see the trace of that script, I notice that there is a # sign
    before the method I try to invoque.

    I think that that # sign may be responsible of the SOAP error I get :
    System.Web.Services.Protocols.SoapException: Server did not recognize
    the value of HTTP Header SOAPAction: #GetProperties.

    If I see the trace of the SOAP::Lite module, I see that it send
    #GetProperties instead of GetProperties :
    SOAPAction: "http://schemas.dataswitch.be/service/2.7/export/#GetProperties"

    Is there a way to avoid that # sign in the sent SOAPAction by the
    SOAP::Lite module ?

    Thanks _very_ much in advance for your help !

    ==== CODE ====

    use SOAP::Lite +trace;
    use strict;

    # Skarabee userid/passwd
    my $UserId = "xxx";
    my $Password = "xxx";

    my $PropertiesList;

    sub SOAP::Transport::HTTP::Client::get_basic_credentia ls { return
    ($UserId => $Password) };

    my $SOAPService = new SOAP::Lite();
    $SOAPService->service('file:./myfile.wsdl');
    $SOAPService->proxy('http://www.HOSTNAME.be/service/v27/export.asmx');
    $SOAPService->on_fault(sub { my($soap, $res) = @_; die ref $res ?
    $res->faultstring : $soap->transport->status, "\n"; });

    # TRIAL ONE
    $PropertiesList = $SOAPService -> GetProperties(Token =>0) -> result();
    print('Results : ['.$PropertiesList.']');

    # SECOND TRIAL
    my $response = $SOAPService
    ->call(SOAP::Data->name('GetProperties')
    ->attr( { xmlns => 'http://www.HOSTNAME.be/service/2.7/export/' } )
    => # Argument(s) listed next
    SOAP::Data->name(Token => 0));
    if ($response->fault)
    {
    printf "A fault (%s) occurred: %s\n", $response->faultcode,
    $response->faultstring;
    }
    else
    {
    print "Resultats : [" . $response->result ."]\n";
    }

    ==== CODE ====

    --
    Bruno BAGUETTE - [email]bouchon@alussinan.org[/email]
    S'i'n'a è'ne saquî qui n'doit nin mârtchi, è'n mârtch'rè nîn.
    Bruno Baguette Guest

  2. Similar Questions and Discussions

    1. problem with SOAP::Lite and mod_perl
      Hi, I'm stuck. I'm trying to connect to a simple SOAP service via SOAP::Lite, e.g. my $soap = SOAP::Lite->new (uri => $soapaction, proxy =>...
    2. Writing a HTML/ASP SOAP client for a SOAP::Lite destination
      How would I go about writing a SOAP client in either HTML or classic asp? The SOAP "listener" was written in Perl with SOAP::Lite in Unix and I am...
    3. SOAP::Lite install problem
      I am trying to install SOAP::Lite on a Sun box. I tried installing the module using the following command and got the error "don't know what it...
    4. SOAP::Lite XML-Problem
      Hello, I am having difficulty figuring out how to create a multiref using SOAP::Lite. Below is an example of some code that I would like to...
    5. SOAP::Lite HELP!
      I've written soap clients before but never anything this complicated. Here are the links PIRP: http://homer.meso.com/crap/PIRP_Schema_v1.xsd...
  3. #2

    Default Re: SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPAction string

    Hi Bruno,

    In article <2v1vp0F2fa8fhU1@uni-berlin.de>,
    Bruno Baguette <bouchon@alussinan.org> wrote:
    > I have a problem with a SOAP client written in Perl (source at the end).
    > I've tried both ways (by commenting TRIAL ONE or SECOND TRIAL), and I
    > get exactly the same results.
    >
    > When I see the trace of that script, I notice that there is a # sign
    > before the method I try to invoque.
    >
    > I think that that # sign may be responsible of the SOAP error I get :
    > System.Web.Services.Protocols.SoapException: Server did not recognize
    > the value of HTTP Header SOAPAction: #GetProperties.
    >
    > If I see the trace of the SOAP::Lite module, I see that it send
    > #GetProperties instead of GetProperties :
    > SOAPAction: "http://schemas.dataswitch.be/service/2.7/export/#GetProperties"
    >
    > Is there a way to avoid that # sign in the sent SOAPAction by the
    > SOAP::Lite module ?
    >
    > Thanks _very_ much in advance for your help !
    I had the same problem, the solution can be found quite easy using
    Google. One usefull url:

    [url]http://www.dotnettalk.net/Calling__Net_web_service_using_a_PERL_client_-6[/url]
    301906-1296-a.html

    The gist of the solution is specifiying an on_action method that builds
    the SOAPAction string:

    use SOAP::Lite +trace => 'debug';

    ....

    $SOAPService->on_action(sub{join '/',
    'http://schemas.dataswitch.be/service/2.7/export', $_[1]});

    ....

    This should build the right SOAPAction, look at the output to see the
    actual value for SOAPAction being used to see if it's correct.

    btw. you're probably using SOAP::Lite to talk to a .Net soap service,
    there are more issues with this (you have to use named parameters for
    instance). Check out
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsoap/h[/url]
    tml/soapliteperl.asp for more.

    Cheers,

    Bas.
    Bas Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139