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

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

Expand Messages
  • Bruno Baguette
    Nov 5, 2004
      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 !

      --
      Bruno BAGUETTE

      ==== 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_credentials { 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 ====
    • Show all 2 messages in this topic