cancel
Showing results for 
Search instead for 
Did you mean: 

Security header in WSDL

ibarbaric
Champ in-the-making
Champ in-the-making
Hello!
I am a beginner in WS world and am trying to use Alfresco WS API from SAP  (ABAP) environment. I generated WS client proxy class by using Alfresco's WSDL files. I called START_SESSION and got correct response (username, ticket, session id).
However, when attempting to call administration service GET_USER method, I get:
SoapFaultCode:1  WSDoAllReceiver: Request does not contain required Security header
. How should I pass security header, since it is not defined by WSDL and therefore not part of method parameters in my proxy class? Should I do something with ticked and session id? Please explain  with examples.
Thanks in advance for all hints!
Regards,
Igor Barbaric
5 REPLIES 5

ibarbaric
Champ in-the-making
Champ in-the-making
I resolved it myself, thanks…
Igor

joncard
Champ in-the-making
Champ in-the-making
I'm in the same position and would appreciate the answer.

ibarbaric
Champ in-the-making
Champ in-the-making
Hi, Jonathan!
I found the solution by using java samples which can be downloaded from Alfresco site. I started the getUser sample and used NetTool program for TCP tunneling to see how the correct SOAP must look. Then I composed the header manually.
Here's an example of correct SOAP:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
         <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsu:Created>2007-06-01T16:04:22.609Z</wsu:Created>
            <wsu:Expires>2007-06-01T16:04:22.609Z</wsu:Expires>
         </wsu:Timestamp>
         <wsse:UsernameToken>
            <wsse:Username>ticket</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">TICKET_ff573fcb-1048-11dc-9deb-c7d31f435ffc</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>

   <soapenv:Body>
      <nr1:getUser xmlns:nr1="http://www.alfresco.org/ws/service/administration/1.0" xmlns:nr2="http://www.alfresco.org/ws/model/content/1.0">
         <nr1:userName>ADMIN</nr1:userName>
      </nr1:getUser>
   </soapenv:Body>
</soapenv:Envelope>
Hope this helps.
Regards,
Igor

joncard
Champ in-the-making
Champ in-the-making
Thanks

netranger
Champ in-the-making
Champ in-the-making
Hi!

I am with the same issue… What should I put in timestamp field? Because I get this error: WSSecurityEngine: Invalid timestamp The security semantics of message have expired.

Can you help me plz?