cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco wsdl contains incorrect endpoints

damonrand
Champ in-the-making
Champ in-the-making
Hi there,

Here is our wsdl location..
   https://alfresco.company.com/alfresco/wsdl/authentication-service.wsdl

Can someone please tell me how to make sure the location in the Alfresco WSDL points to our external address rather than localhost???

Thanks!


<wsdl:service name="AuthenticationService">
   <wsdl:documentation>Provides simple authentication capability.
</wsdl:documentation>
   <wsdl:port binding="auth:AuthenticationServiceSoapBinding"
name="AuthenticationService">
     <wsdlsoap:address location="http://localhost:
8080/alfresco/api/AuthenticationService"/>
   </wsdl:port>
</wsdl:service>


Damon.
6 REPLIES 6

douggreen
Champ in-the-making
Champ in-the-making
I'm working on a Drupal module that interfaces with Alfresco.  Damon had posted this question to the forum on my behalf, but now that I have forum access, I'll pick up the thread.  This is a long post, so to summarize, I have two problems:

1.  server not found because endpoint is changed to a local ip address.
2.  Failed to parse query

The source of the localhost reference in the original posting of this question came from the fact that I manually downloaded the wsdl from our alfresco server, and it had this snipet:


   <wsdl:service name="AuthenticationService">
      <wsdl:documentation>Provides simple authentication capability.</wsdl:documentation>
      <wsdl:port binding="auth:AuthenticationServiceSoapBinding" name="AuthenticationService">
         <wsdlsoap:address location="http://localhost:8080/alfresco/api/AuthenticationService'/>
      </wsdl:port>
   </wsdl:service>

However, I've gotten a little further along.  I upgraded the php libraries from 1.2 to 1.4.  I looked at Examples/QueryExecuter/queryExecuter.php and created the following function.


function alfresco_test_api_page() {
  // … Drupal specific code to setup $server, $user, $pass
  // $server points to the alfresco server

  try {
    // Login
    $session = Session::create($user, $pass, $server .'/api');

    // Get the children of the company home
    if ($currentStore = new SpacesStore($session)) {
      $nodes = $session->query($currentStore, null);
    }

    $session->close();
  }
  catch (Exception $e) {
    // … Drupal specific code to handle the error
  }

  return print_r($nodes, TRUE);
}

1.  I get an error that it can't find the server which it's looking for at http://128.1.32.82:8080.  I don't know where it's getting this address from.

So as a temporary hack, just to see if I could get more, I added a line to AlfrescoWebService.php to replace the bad ip address with a good one.

2.  Now the server doesn't like my query:


[detail] => stdClass Object
  (
   [RepositoryFault] => stdClass Object
    (
     [errorCode] => 0
     [message] => Failed to parse query:
    )

   [exceptionName] => org.alfresco.repo.webservice.repository.RepositoryFault
   [stackTrace] =>
   at org.alfresco.repo.webservice.repository.RepositoryWebService.query(RepositoryWebService.java:233)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   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:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:831)
   at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:652)
   at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1203)
   at java.lang.Thread.run(Thread.java:595)

   [hostname] => alpaca
  )

    damonrand
    Champ in-the-making
    Champ in-the-making
    Hi Luis,

      Doug and I are using 2.0 enterprise.. We can upgrade to 2.1 but if you have a way to make the soap interface work in 2.0 that would be cool. 😉

    Damon.

    rwetherall
    Confirmed Champ
    Confirmed Champ
    Hi,

    The PHP library has under gone some more development effort in the 2.1 timescale and I'd strongly recommend taking the new version that's now available.

    Although we will be testing this new version of the PHP library against 2.1 repository I am fairly confident it will also work against a 2.0 repository since no changes (that i can think of at this moment) have been made to the web service API's.

    Have a look here http://wiki.alfresco.com/wiki/Alfresco_PHP_API for documentation on the updated PHP API (this documentation should expand over the coming weeks)

    Cheers,
    Roy

    damonrand
    Champ in-the-making
    Champ in-the-making
    Ok, cool. Thanks Roy.

    Damon.

    damonrand
    Champ in-the-making
    Champ in-the-making
    Hi guys,
         We have now run up 2.1 R1 and the soap wsdl seems to still have localhost installed..


       <wsdl:service name="AuthenticationService">
          <wsdl:documentation>Provides simple authentication capability.</wsdl:documentation>
          <wsdl:port binding="auth:AuthenticationServiceSoapBinding" name="AuthenticationService">
             <wsdlsoap:address location="http://localhost:8080/alfresco/api/AuthenticationService'/>
          </wsdl:port>
       </wsdl:service>

    Any ideas? Should I log a Jira issue?

    Damon.

    damonrand
    Champ in-the-making
    Champ in-the-making
    Actually I found a solution.. We need to add ProxyPreserveHost=on to our reverse proxy. See this page for reasons why.
      http://www.atlassian.com/software/jira/docs/v3.7.2/apacheintegration.html

    Damon.