cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with SOAP SECURITY HEADER

ramos69
Champ in-the-making
Champ in-the-making
Hi, I'm trying to use the revertVersion method from the AuthoringService.

I'm having trouble whith the Soap security header… Can someone give me an example or tell me how I create it?

Thanks..
3 REPLIES 3

jcustovic
Champ in-the-making
Champ in-the-making
Could you give some more information on the problem, like stack trace or some kind of Exception description?

ramos69
Champ in-the-making
Champ in-the-making
The problem is that it keeps saying that there is none securityheader..
~
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.alfresco.org/ws/service/authoring/1.0" xmlns:ns1="http://www.alfresco.org/ws/model/content/1.0">
   <soapenv:Header>

</soapenv:Header>
   <soapenv:Body>
      <ns:revertVersion>
         <ns:node>
            <!–Optional:–>
            <ns1:store>
               <!–Optional:–>
               <ns1:scheme>workspace</ns1:scheme>
               <!–Optional:–>
               <ns1:address>SpacesStore</ns1:address>
            </ns1:store>
            <!–Optional:–>
            <ns1:uuid>0a9b18f4-b70a-4290-8b07-28d781f3d0a7</ns1:uuid>
            <!–Optional:–>
            <ns1:path>/app:company_home/app:user_homes/sys:ramos/cm:Black (1).jpg</ns1:path>
         </ns:node>
         <ns:versionLabel>1.1</ns:versionLabel>
      </ns:revertVersion>
   </soapenv:Body>
</soapenv:Envelope>


and the response
<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>soapenv:Server.generalException</faultcode>
         <faultstring>WSDoAllReceiver: Request does not contain required Security header</faultstring>
         <detail>
            <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">WSDoAllReceiver: Request does not contain required Security header
   at org.apache.ws.axis.security.WSDoAllReceiver.invoke(WSDoAllReceiver.java:175)
   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:637)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:619)</ns1:stackTrace>
            <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">FEDREPSERVER.com</ns2:hostname>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>


I've tried a lot os headers.. but nothing work..

jcustovic
Champ in-the-making
Champ in-the-making
You have to make sure you have a valid ticket. This means that you have to authenticate. Try using this code:

try {
WebServiceFactory.setEndpointAddress(alfrescoUrl);
AuthenticationUtils.startSession(alfrescoUsername, alfrescoPassword); // Start session
String ticket = AuthenticationUtils.getTicket();
System.out.println(ticket); // Make sure u get a valid ticket

your code for accessing alfresco web service

} finally {
AuthenticationUtils.endSession(); // End session
}