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

Re: [soaplite] Re: Calling a web service - please help

Expand Messages
  • Duncan Cameron
    ... That is what SOAP::Lite does by default. You need the on_action() method to override that default. As I explained previously - on_action(sub { join( / ,
    Message 1 of 10 , Jul 1, 2002
    • 0 Attachment
      On 2002-07-01 soapnewby wrote:
      >--- In soaplite@y..., rjray@b... wrote:
      >>... look to see what the server is
      >> expecting as a SOAPAction for the given operation.
      >
      >The .wsdl file says
      ><soap:operation
      >soapAction="http://net.trustnet.com/ScorecardService3/AddItem"
      >style="document" />
      >
      >When I try this simpler version of the code:
      >
      >SOAP::Lite
      > -> uri('http://net.trustnet.com/ScorecardService3/')
      > -> proxy
      >('http://net.trustnet.com/ScorecardService3/ScorecardGenerator.asmx')
      > -> AddItem (SOAP::Data->name('vchScript' => 'xxx')->type
      >('string'),
      > SOAP::Data->name('dtLastRan' => '06/26/2002')->type('string'),
      > SOAP::Data->name('chSuccessFail' => 's')->type('string'),
      > SOAP::Data->name('vchAttempted' => '2')->type('string'),
      > SOAP::Data->name('vchFailed' => '1')->type('string'),
      > SOAP::Data->name('vchErrorMsg' => 'ppp')->type('string'),
      > SOAP::Data->name('iCategory' => 1)->type('int'));
      >
      >The trace error message says:
      ><faultstring>System.Web.Services.Protocols.SoapException: Server did
      >not recognize the value of HTTP Header SOAPAction:
      >http://net.trustnet.com/ScorecardService3/#AddItem.
      >
      >==========
      >
      >Why does it append a "#"??
      >
      That is what SOAP::Lite does by default. You need the on_action()
      method to override that default. As I explained previously

      ->on_action(sub { join('/', @_)})

      does the job. All it is doing is joining your uri with your method.
      In your example above, you already have a trailing '/' on your uri
      so you want to join with an empty string:

      ->on_action(sub { join('', @_)})

      The other problem with your example is that your method won't be in the
      correct namespace. You do need something like

      ->call(SOAP::Data->name('AddItem')->attr({xmlns => 'your namespace'})

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