cancel
Showing results for 
Search instead for 
Did you mean: 

requested resource (/alfresco/s/api/login) is not available

jmetzger
Champ in-the-making
Champ in-the-making
I think that I am close to sending a message to the Alfresco public CMIS server, but something isn't quite right.  My endpoint is:
http://cmis.alfresco.com/alfresco/s/api/login

My request message is:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.alfresco.org/ws/service/authentication/1.0">
   <soapenv:Header>
   </soapenv:Header>
   <soapenv:Body>
      <ns:startSession>
         <ns:username>admin</ns:username>
         <ns:password>admin</ns:password>
      </ns:startSession>
   </soapenv:Body>
</soapenv:Envelope>

The response  is:
<html><head><title>Apache Tomcat/6.0.29 - Error report</title><style><!–H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}–></style> </head><body><h1>HTTP Status 404 - /alfresco/s/api/login</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/alfresco/s/api/login</u></p><p><b>description</b> <u>The requested resource (/alfresco/s/api/login) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.29</h3></body></html>

What am I doing wrong?

Thanks,
Jim Metzger
8 REPLIES 8

jpotts
World-Class Innovator
World-Class Innovator
Does /alfresco/s/api/login accept SOAP? I think that is instead a RESTful web script, so the syntax would be to do a GET against it with something like:

http://cmis.alfresco.com/s/api/login?u=admin&pw=admin

And expect back XML that includes a ticket.

Jeff

jmetzger
Champ in-the-making
Champ in-the-making
Thanks, Jeff – that makes a lot of sense.  The problem is that I *want* to send a SOAP message.  How can I find out what Alfresco's endpoint is for their web service API?

jpotts
World-Class Innovator
World-Class Innovator
Ah, I see. In that case, try http://cmis.alfresco.com/api/login.

The URL you were using that has an "s" in it indicates that you are using a web script which is always going to be RESTful.

You might see if looking at the wsdl helps you. It lives here:
$TOMCAT_HOME/webapps/alfresco/wsdl

Jeff

jmetzger
Champ in-the-making
Champ in-the-making
I think we are getting closer …
I tried accessing http://cmis.alfresco.com/webapps/alfresco/wsdl, and got the following:
Axis HTTP Servlet
Hi, you have reached the AXIS HTTP Servlet. Normally you would be hitting this URL with a SOAP client rather than a browser.
In case you are interested, my AXIS transport name appears to be 'http'

If I use soapUI to send a soap message to that endpoint, I am back to the message saying that the resource is not available.

jpotts
World-Class Innovator
World-Class Innovator
If your goal is to get a ticket, try pointing your SOAP client at: http://cmis.alfresco.com/api/login

If your goal is to read the WSDL for the AuthenticationService, point your browser to: http://cmis.alfresco.com/api/AuthenticationService?wsdl

Jeff

jmetzger
Champ in-the-making
Champ in-the-making
Excellent!  I copied the wsdl, imported it into soapUI, and now I can send a soap message to http://cmis.alfresco.com/api/AuthenticationService:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.alfresco.org/ws/service/authentication/1.0">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:startSession>
         <ns:username>admin</ns:username>
         <nsSmiley Tongueassword>admin</nsSmiley Tongueassword>
      </ns:startSession>
   </soapenv:Body>
</soapenv:Envelope>

And here is what I got back:
<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>
      <startSessionResponse xmlns="http://www.alfresco.org/ws/service/authentication/1.0">
         <startSessionReturn>
            <username>admin</username>
            <ticket>TICKET_8fe8e7ff4613f0731274d618dd0df12f59e329cc</ticket>
            <sessionid>E03D6F8A36ADE84B77C1C245DB9BF3BE</sessionid>
         </startSessionReturn>
      </startSessionResponse>
   </soapenv:Body>
</soapenv:Envelope>

So that is really good news.  What I don't understand yet is how to apply that ticket value in a call to the CMIS repository.  Does it go in the soap:Header somehow?  Better yet, is there a way to provide my login credentials along with my soap request?  My real goal is to send CMIS requests, with or without a ticket.

Thanks for your patience and help,
Jim

jmetzger
Champ in-the-making
Champ in-the-making
Woo Hoo!  I got it to work!  Here is my request that I built by parroting code from other posts:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
   <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>2012-05-30T23:54:15.985Z</wsu:Created>
            <wsu:Expires>2012-05-31T01:52:36.221Z</wsu:Expires>
         </wsu:Timestamp>
         <wsse:UsernameToken>
            <wsse:Username>admin</wsse:Username>
            <wsse:Password
               Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <ns:getRepositories>
      </ns:getRepositories>
   </soapenv:Body>
</soapenv:Envelope>

And here is the response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsu:Timestamp wsu:Id="Timestamp-1800908370" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsu:Created>2012-05-30T23:54:17.887Z</wsu:Created>
            <wsu:Expires>2012-05-30T23:59:17.887Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <getRepositoriesResponse xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns3="http://www.alfresco.org">
         <repositories>
            <repositoryId>371554cd-ac06-40ba-98b8-e6b60275cca7</repositoryId>
            <repositoryName>Main Repository</repositoryName>
         </repositories>
      </getRepositoriesResponse>
   </soap:Body>
</soap:Envelope>

Now I need to figure out *WHY* it worked.  Is there a good reference for the oasis WSSE spec, and especially how Altova uses it?  Is it just a feature of the app server?

Thanks again,
Jim

jpotts
World-Class Innovator
World-Class Innovator
Hey, I'm glad you got it working!

Check with Google on WSSE resources. Here's one that looks decent: http://msdn.microsoft.com/en-us/library/ms977327.aspx

Jeff