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

How to add authHeader to soap request ?

Expand Messages
  • Richter, Tobias
    Hi *, I try to write a simple Perl SOAP Client for these services: http://almdemo.polarion.com/polarion/ws/services/SessionWebService?wsdl
    Message 1 of 1 , Dec 12, 2011
    • 0 Attachment
      Hi *,

      I try to write a simple Perl SOAP Client for these services:

      http://almdemo.polarion.com/polarion/ws/services/SessionWebService?wsdl
      http://almdemo.polarion.com/polarion/ws/services/TrackerWebService?wsdl
      http://almdemo.polarion.com/polarion/ws/services/ProjectWebService?wsdl


      My script looks like this now:
      ---snip---
      ...
      my $SessionWebServicesoap = SOAP::Lite
      -> proxy($SessionWebServiceURI)
      -> uri($SessionWebServiceURI);

      my $TrackerWebServicesoap = SOAP::Lite
      -> proxy($TrackerWebServiceURI)
      -> uri($TrackerWebServiceURI);

      my $ProjectWebServicesoap = SOAP::Lite
      -> proxy($ProjectWebServiceURI)
      -> uri($ProjectWebServiceURI);

      my $response;

      print "\n";

      #get session
      my $session = $SessionWebServicesoap->logIn(
      SOAP::Data->name('userName')->value($user),
      SOAP::Data->name('password')->value($password)
      );
      my $sessionID = $session->{'_content'}[2][0][4]{'sessionID'};
      print "session is: ".$sessionID."\n";

      my $authHeader = SOAP::Header->name('sessionID')->value($sessionID);

      $response = $ProjectWebServicesoap->getProject("productbacklog");
      die $response->faultstring if ($response->fault);
      my $IObject = $response->result;
      print $response->result, "\n";

      $response = $TrackerWebServicesoap->createWorkItem($IObject,$authHeader);
      die $response->faultstring if ($response->fault);
      print $response->result, "\n";


      exit;
      ---snap---


      Unfortunately I always get the following error message:
      session is: 9109123277697179703
      Project=HASH(0x6b6c4e0)
      com.polarion.platform.security.PermissionDeniedException: Permission com.polarion.persistence.object.WorkItem.key.created.modify denied for user null in context null at soap6.pl line 56.


      Do you have an idea how to add the session ID to my SOAP-Request Header?

      I think somebody had the same problem with python's suds here:
      https://fedorahosted.org/suds/ticket/233


      Thank you.

      Best regards,
      Tobias


      This email is intended solely for the use of the individual to whom it is addressed and may contain confidential and/or privileged material. Any views or opinions presented are solely those of the author and do not necessarily represent those of AGCO. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. Neither AGCO nor the sender accepts any responsibility for viruses and it is your responsibility to scan and virus check the e-mail and its attachment(s) (if any).
    Your message has been successfully submitted and would be delivered to recipients shortly.