Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] Problem of # sign added by SOAP::Lite in the sent SOAPAction string

Expand Messages
  • Duncan Cameron
    ... The SOAPAction should be specified in your WSDL file as an attribute on the element. If you are calling a dot Net service then you may get
    Message 1 of 2 , Nov 6, 2004
    • 0 Attachment
      On 2004-11-05 at 22:55:22 Bruno Baguette wrote:

      >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 ?

      The SOAPAction should be specified in your WSDL file as an attribute on
      the <soap:operation> element.

      If you are calling a dot Net service then you may get more success by
      not using the WSDL directly. Simply get the necessary information from
      the WSDL and then use the proxy() and uri() calls on SOAP::Lite. In this
      case you will need to override the on_action method to concatenate with
      '/' the two parameters. Taking your second example and modifying it to
      be something like

      my $s = SOAP::Lite
      ->proxy('http://www.HOSTNAME.be/service/v27/export.asmx')
      ->uri('http://schemas.dataswitch.be/service/2.7/export')
      ->on_action(sub { "$_[0]/$_[1]" })
      ;

      then like you have in that example for calling the service

      ># 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";
      >}

      Regards
      Duncan
    Your message has been successfully submitted and would be delivered to recipients shortly.