cancel
Showing results for 
Search instead for 
Did you mean: 

perl

mojo-jojo
Champ in-the-making
Champ in-the-making
The wiki lists perl as one of the languages that can be used with the API. 

Are you still planning on this? When can we expect some example code?
4 REPLIES 4

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

There are no plans at the moment to produce any Perl examples.

This is the sort of area we would like the community to support us, especially those who have, in this case, Perl expertise.

Cheers,
Roy

peterwilson
Champ in-the-making
Champ in-the-making
Im working on some Perl at the moment and will be happy to provide my code as examples, I'm using SOAP:Lite but am getting stuck with the security header. I get the ticket from the AuthenticationService without issue, its just making the header for the calls I am having problems with giving me security processing failed (actions number mismatch) but I dont know what the header is I am trying to generate.

This is the debug info I have so far, and I cant get past this error.

SOAP::Transport::HTTP::Client::send_receive: POST http://www.xxx.co.uk:8080/alfresco/api/AuthenticationService
Accept: text/xml
Accept: multipart/*
Content-Length: 510
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.alfresco.org/ws/service/authentication/1.0/startSession"

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlnsSmiley FrustratedOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlnsSmiley FrustratedOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><startSession xmlns=""><parameters>admin</parameters><c-gensym4 xsi:type="xsd:string">xxx</c-gensym4></startSession></SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Connection: close
Date: Fri, 27 Jun 2008 11:37:50 GMT
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Client-Date: Fri, 27 Jun 2008 11:43:54 GMT
Client-Peer: 64.69.167.147:8080
Client-Response-Num: 1
Set-Cookie: JSESSIONID=4F3248FD04551320DE1B6B1771278D5D; Path=/alfresco

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"><soapenv:Body><startSessionResponse xmlns=""><ns1:startSessionReturn xmlns:ns1="http://www.alfresco.org/ws/service/authentication/1.0"><ns1:username>admin</ns1:username><ns1:ticket>TICKET_ac782c6f0b76725310a42b3a4a448d076cc94cc0</ns1:ticket><ns1:sessionid>4F3248FD04551320DE1B6B1771278D5D</ns1:sessionid></ns1:startSessionReturn></startSessionResponse></soapenv:Body></soapenv:Envelope>
SOAP::Transport::HTTP::Client::send_receive: POST http://www.files.sala-international.co.uk:8080/alfresco/api/RepositoryService
Accept: text/xml
Accept: multipart/*
Content-Length: 1889
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.alfresco.org/ws/service/repository/1.0/getStores#getStores"

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlnsSmiley FrustratedOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlnsSmiley FrustratedOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
  <SOAP-ENV:Header
  >
    <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1"
    >
      <UsernameToken xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
      >
        <Username xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xsi:type="xsd:string"
        >admin</Username>
        <Password xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xsi:type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsdSmiley TongueasswordText"
        >TICKET_ac782c6f0b76725310a42b3a4a448d076cc94cc0</Password>
        <Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xsi:type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:Created"
        >2008-5-27T11:43:55</Created>
        <Expires xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xsi:type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:Expires"
        >2008-5-27T12:43:55</Expires>
        <Nonce xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xsi:type="xsd:string"/></UsernameToken></Security></SOAP-ENV:Header>
  <SOAP-ENV:Body
  >
    <namesp1:getStores xmlns:namesp1="http://www.alfresco.org/ws/service/repository/1.0/getStores'/></SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Connection: close
Date: Fri, 27 Jun 2008 11:37:50 GMT
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Client-Date: Fri, 27 Jun 2008 11:43:55 GMT
Client-Peer: 64.69.167.147:8080
Client-Response-Num: 1
Set-Cookie: JSESSIONID=4611A6570D2C13913EBDB32C42D8DE34; Path=/alfresco

<?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:Body><soapenv:Fault><faultcode>soapenvSmiley Frustratederver.generalException</faultcode><faultstring>WSDoAllReceiver: security processing failed (actions number mismatch)</faultstring><detail><ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">WSDoAllReceiver: security processing failed (actions number mismatch)

   at org.apache.ws.axis.security.WSDoAllReceiver.invoke(WSDoAllReceiver.java:351)

   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)

   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)

   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)

   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)

   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)

   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)

   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)

   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)

   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)

   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)

   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)

   at java.lang.Thread.run(Thread.java:595)

</ns1:stackTrace><ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">www</ns2:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

Regards

Peter

gressho
Champ in-the-making
Champ in-the-making
Hi,

I don't know anything about Perl but your security header misses the Timestamp element which should include the Created and Expired
elements instead of UsernameToken. The Nonce should be removed.
Hope this helps…

Best wishes

Werner

jarregui
Champ in-the-making
Champ in-the-making
Hello,

I'm currently trying to use perl to access my Alfresco repository… did you suceed?  Could you please send me some examples (no matter if they don't work well)?

Thanks,

Javier