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

Please Help, Need to add several namespaces to Envelope using Perl

Expand Messages
  • James
    I ve taken over some code for my company and need some help. We have a soap lite script which is called from another module. The calling module contains the
    Message 1 of 1 , Jun 21, 2012
    View Source
    • 0 Attachment
      I've taken over some code for my company and need some help. We have a soap lite script which is called from another module. The calling module contains the following:

      $self->{path} = '/TktServices/services/TicketSoapHttpPort';
      $self->{method_name} = 'getTicketRequest';
      $self->{method_attr} = {
      "xmlns"=> 'http://xxxx.xxx.com/ticket/v1' }

      This in turns calls the underlying module containing the soap calls.
      There is an entry in the module that issues this:

      my $data = SOAP::Data->name($self->{method_name})->attr($self->{method_attr});


      And then he enters the data and parameters in this way:

      $self->{request} = $soap->serializer->envelope(method => $data, @params);

      I need to add several namespaces to the envelope in order to get this to work. However am I using the correct command. Is there a way to add it to the serializer->envelope above.

      $soap->serializer->namespaces({
      "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"=>"xmlns:m2",
      "http://xxxx.xxx.com/ticket/v1"=>"xmlns:q0",
      "http://xxx.xxx.com/commonheader/v3"=>"xmlns:q1",
      "http://xxxxxxx.xxxx.xxx.com/ticket"=>"xmlns:q2",
      });

      Cause when I run the script I don't see these namespaces in the envelope.

      Also there is this entry in the header:

      <soapenv:Header>

      <m2:Security xmlns:m2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">


      Questions:

      1) Can I add this namespace to the header?
      2) Is there a difference between adding the namespace to the envelope versus the header?
      3) If I were to be successful on adding the namespaces do i need to add the attr to this header name or does the namespace take care of it:

      ("m2:Security")->attr({'xmlns:m2'=>'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'})


      Please help.
    Your message has been successfully submitted and would be delivered to recipients shortly.