Announcement Announcement Module
Collapse
No announcement yet.
Hosting the Spring Contract-first web service tutorial example on Cloud Foundry Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hosting the Spring Contract-first web service tutorial example on Cloud Foundry

    Hi,
    I have successfully built and deployed the STS contract-first web services tutorial to Cloud Foundry. Cloud Foundry gave me a URL address: "http://ws-tutorial.cloudfoundry.com".

    In the tutorial the Web Service Client originally used the following URL to contact the service: http://localhost:8080/ws-tutorial/services

    I now changed the URL address in the Web Service Client to: "http://ws-tutorial.cloudfoundry.com" - the address I was given for the application by Cloud Foundry

    However I am getting a "connection refused: connect" message when I run the client.

    My question is: Is my URL address incorrect - should I put "/ws-tutorial/services" on the end of it - though this doesn't work either.

    And in general can a web service that runs locally on an instance of Tomcat be deployed to Cloud Foundry without any changes to the code?

  • #2
    in fact you can get answer from reviewing "Remote Systems".
    double click your application, go to "application" page, then click "Remote System View".

    Comment


    • #3
      Remote View

      Yes I tried this - I can see my application in Remote System View. Under VMware Cloud Foundry I can see a folder called ws-tutorial#0. In this folder there are folders logs and tomcat. However I still doen't know the URL my client should use to call the service. Is the information visible somewhere in Remote System View. The URL ws-tutorial.cloudfoundry.com doesn't work in my client.

      Thanks

      Comment


      • #4
        The url to access a spring web service that is deployed on tomcat server would be some things like this
        • server_url/web_app_context/servlet_mapping_for_msg_dispatch_servlet

        Now getting back to the issue with your web service deployment, I suggest you look at your application's web.xml, You need to find the mapping for (MessageDispatcherServlet), A typical mapping would be


        Code:
        <servlet>
         <servlet-name>spring-ws</servlet-name>
           <servlet-class> 
               org.springframework.ws.transport.http.MessageDispatcherServlet
            </servlet-class>
            <init-param>
                         //init config
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
        
        <servlet-mapping>
          <servlet-name>spring-ws</servlet-name>
          <url-pattern>/webservices/*</url-pattern>
        </servlet-mapping>
        If I deploy a web app with above servlet mapping and context root of ws-tutorial to my local tomcat server, I would be accessing a web service on the server using this url

        Comment

        Working...
        X