facebook

Trouble Creating Sprint WS Client

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #313920 Reply

    _mass_nerder
    Member

    I followed the example found here:
    http://www.myeclipseide.com/documentation/quickstarts/ME4STutorialImportWS/me4swebservicearticle.html

    When running the Java client in step #7 I receive the following exception:

    INFO: No cxf.xml configuration file detected, relying on defaults.
    Exception in thread “main” javax.xml.ws.WebServiceException: Port {http://ws.cdyne.com/WeatherWS/}WeatherSoap not found.
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:308)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:299)
    at javax.xml.ws.Service.getPort(Service.java:92)
    at com.crowley.jaxws.WeatherSoapClient.getService(WeatherSoapClient.java:116)
    at test.Test.main(Test.java:15)

    Has anyone else encountered this? I generated a regular jax-ws client and everything worked just fine.

    #313921 Reply

    _mass_nerder
    Member

    Oops typo in the title! Sprint == Spring.

    #314127 Reply

    jayperkins
    Member

    It appears that the problem occurs when the WeatherSoapClient class tries to find the wsdl resource when you are running as a simple Java class from a main method, it will not find it because of the leading slash in the url:
    URL url = WeatherSoapClient.class.getClassLoader().getResource(“/wsdls/com/cdyne/ws/wsdl/asmx/weather/weatherws/weatherws.wsdl”);

    However, when you run as a webapp the WebAppClassloader finds the resource regardless of whether there is a leading slash or not.

    You can remove the leading slash from the WeatherSoapClient.getDefaultWSDLURL() method where it calls getResource() to get around the problem. I will enter a bug in JIRA as it appears we should not be generating a leading slash.

    Let me know if this doesn’t solve the problem.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Trouble Creating Sprint WS Client

You must be logged in to post in the forum log in