Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 86492 invoked from network); 3 Jan 2011 19:16:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jan 2011 19:16:36 -0000 Received: (qmail 36347 invoked by uid 500); 3 Jan 2011 19:16:35 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 36308 invoked by uid 500); 3 Jan 2011 19:16:35 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 36300 invoked by uid 99); 3 Jan 2011 19:16:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jan 2011 19:16:35 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.85.173.253] (HELO server.dankulp.com) (64.85.173.253) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jan 2011 19:16:30 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id 407F018775A; Mon, 3 Jan 2011 14:16:09 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter-users@cxf.apache.org.mvVM5BNlBp Received: from dilbert.dankulp.com (c-24-91-72-253.hsd1.ma.comcast.net [24.91.72.253]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTPSA id 007D918775A; Mon, 3 Jan 2011 14:16:07 -0500 (EST) From: Daniel Kulp To: users@cxf.apache.org Subject: Re: Problem executing my CXF client Date: Mon, 3 Jan 2011 14:17:31 -0500 User-Agent: KMail/1.13.5 (Linux/2.6.36; KDE/4.5.4; x86_64; ; ) Cc: Michael References: <99663D0D00344CB58267E5899D170ED6@FAMDESKTOP> In-Reply-To: <99663D0D00344CB58267E5899D170ED6@FAMDESKTOP> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201101031417.31900.dkulp@apache.org> X-Old-Spam-Status: No, score=-102.9 required=3.0 tests=ALL_TRUSTED,BAYES_00, SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.3.1 On Sunday 02 January 2011 7:57:15 am Michael wrote: > I've made some progress on my original question(see thread below), that is > the question relating to why my client code was failing to access the > WSDL. I tried several variations of changes to the soap:address location > element of the WSDL and come up with the correct URL, verified by trying > to access the WSDL on Tomcat from my browser, which I was able to do. > > First I would still like someone to answer the other questions I posted, if > possible. > > Also, now I getting the following error when I execute my client code: Uhh... this isn't using CXF on the client side. This is using the JAX-WS stack built into the JDK. Make sure the CXF jars are there. 1) Why is WSDL location generated with port 9090? I think that is just a default that is in the wsdl generator.. The java2ws command line tool has a "-address" flag that can be used to specify what gets output, but the Eclipse tooling may not allow setting that. > 2) Why are namespaces generated in the reverse order of my Java package? This algorithm is dictated by the JAX-WS and JAXB specs. > 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? Again, it depends on how Eclipse is passing the wsdl location to the tools. If it's being called with the URL of the running service, it would be the http://..... URL (with ?wsdl). If it's calling it with the file off the filesystem, it would likely be some sort of "file:/" URL. The command line tool does have a "-wsdlLocation" flag to allow setting the value that is stuck in the annotation. Again, I'm not sure what the Eclipse tools are setting. Dan > Exception in thread "main" javax.xml.ws.WebServiceException: No > Content-type in the header! at > com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Un > known Source) at > com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processReq > uest(Unknown Source) at > com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unk > nown Source) at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown > Source) at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source) > at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source) at > com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source) at > com.sun.xml.internal.ws.client.Stub.process(Unknown Source) at > com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source) at > com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown > Source) at > com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown > Source) at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown > Source) at $Proxy28.sayHello(Unknown Source) > at org.simple.ws.Client.main(Client.java:9) > > Can someone help out with this? > > Thanks!!! > ----- Original Message ----- > From: Michael > To: users@cxf.apache.org > Sent: Saturday, January 01, 2011 10:26 AM > Subject: 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 > *** > binding="tns:SimpleWebServiceServiceSoapBinding"> > > > > > *** 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; > } -- Daniel Kulp dkulp@apache.org http://dankulp.com/blog