cancel
Showing results for 
Search instead for 
Did you mean: 

.Net sample or guidance?

paul_r_jacobs
Champ in-the-making
Champ in-the-making
Can anyone shed light on connecting to the Web Services API from .Net?  In particular, setting up the CallbackHandler for the ticket?
1 REPLY 1

jneeve
Champ in-the-making
Champ in-the-making
I haven't done it in .net, but I've done it in Coldfusion…

Call the authenticationService startSession method which returns a ticket.

https://servername/alfresco/api/AuthenticationService?wsdl

Then, create a WS security header and pass back that header along with the returned ticket and a timestamp. The soap body contains the action you want to perform (ie: getUser)

I had it working, but I'm having a bit of trouble with the timestamps….


<?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>