You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Michael <mt...@optonline.net> on 2011/01/01 16:26:35 UTC

Problem executing my CXF client

Why am I getting the following error when I execute my web service client?
Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at:
        http://localhost:9090/SimpleWebServicePort?wsdl.
.....
Caused by: java.io.FileNotFoundException: http://localhost:9090/SimpleWebServicePort?wsdl

The following are several questions related to supporting data for the above error:
1) Why is WSDL location generated with port 9090?
2) Why are namespaces generated in the reverse order of my Java package?
3) Why is the WSDL location in the @WebServiceClient annotation generated with the port
   for the WSDL when the WSDL is clearly called simplewebservice.wsdl as can be seen
   from the Tomcat log extract?

*** ENVIRONMENT ***
Java JDK 1.6.0_20
Java EE 6
CXF 2.3.0
Tomcat 6.0
Eclipse Helios (with WTP which includes CXF plug-ins and facets)
Windows XP

*** WSDL GENERATED FROM MY JAVA FIRST CODE BY CXF USING ECLIPSE HELIOS ***
<wsdl:service name="SimpleWebServiceService">
  <wsdl:port name="SimpleWebServicePort"
             binding="tns:SimpleWebServiceServiceSoapBinding">
    <soap:address location="http://localhost:9090/SimpleWebServicePort"/>
  </wsdl:port>
</wsdl:service>

*** EXTRACT FROM TOMCAT CATALINA LOG ***
Jan 1, 2011 9:04:39 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean
                       buildServiceFromWSDL
INFO: Creating Service {http://ws.simple.org/}SimpleWebServiceService from WSDL:
      wsdl/simplewebservice.wsdl

*** MY ENTIRE CLIENT CODE ***
public class SimpleWebService_SimpleWebServicePort_Client
{
    public static void main(String args[]) throws Exception
    {
     SimpleWebServiceService swss = new SimpleWebServiceService( );
     SimpleWebService sws = swss.getSimpleWebServicePort( );
     System.out.println( sws.sayHello( ) );
    } 
}

*** EXTRACT OF CLASS CREATED BY GENERATING CLIENT FROM WSDL ***
@WebServiceClient(name = "SimpleWebServiceService", 
                  wsdlLocation = "http://localhost:9090/SimpleWebServicePort?wsdl",
                  targetNamespace = "http://ws.simple.org/") 
public class SimpleWebServiceService extends Service
{
    public final static URL WSDL_LOCATION;
    public final static QName SERVICE = new QName("http://ws.simple.org/", "SimpleWebServiceService");
    public final static QName SimpleWebServicePort = new QName("http://ws.simple.org/", "SimpleWebServicePort");
    static
    {
        URL url = null;
        try
        {
            url = new URL("http://localhost:9090/SimpleWebServicePort?wsdl");
        }
        catch (MalformedURLException e)
        {
            System.err.println("Can not initialize the default wsdl from http://localhost:9090/SimpleWebServicePort?wsdl");
            // e.printStackTrace();
        }
        WSDL_LOCATION = url;
    }

Re: Problem executing my CXF client

Posted by Ramesh <pr...@podar.net>.
Hi,

I am also the same exception while i try to hit my CXF webservice from my
client in eclipse


 javax.xml.ws.WebServiceException: No Content-type in the header!
	at
com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:143)
	at
com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:74)
	at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:559)
	at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:518)

Is this issue resolved, Kindly help me in this regard

Thanks in Advance

Ramesh

--
View this message in context: http://cxf.547215.n5.nabble.com/Problem-executing-my-CXF-client-tp3324225p4963246.html
Sent from the cxf-user mailing list archive at Nabble.com.