RE: client code to access java_first_jaxws on tomcat

2008-02-20 Thread Daniel Lipofsky
Thanks for the speedy replies.
Willem's simple change got my client working, and
Glen's well documented and more complex examples
will probably save my sanity as I progress in this project.
- Dan

 -Original Message-
 From: Daniel Lipofsky [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, February 19, 2008 5:24 PM
 To: cxf-user@incubator.apache.org
 Subject: client code to access java_first_jaxws on tomcat
 
 I am trying to learn CXF, I have installed the java_first_jaxws
 sample on Tomcat 5.5 and can see the wsdl at
 http://localhost:8080/helloworld/services/hello_world?wsdl
 
 But what I don't understand is how I can run webservices
 against that server.  Does anyone have client code that will
 allow me to test?  I tried modifying Client.java like this:
 
 private static final QName SERVICE_NAME
 = new QName(http://server.hw.demo/;, HelloWorld);
 private static final QName PORT_NAME
 = new QName(http://server.hw.demo/;, HelloWorldPort);
 
 public static void main(String args[]) throws Exception {
 Service service = Service.create(SERVICE_NAME);
 String endpointAddress =
 http://localhost:8080/helloworld/services/hello_world?wsdl;;
 service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING,
 endpointAddress);
 HelloWorld hw = service.getPort(HelloWorld.class);
 System.out.println(hw.sayHi(World));
 }
 
 but all I got was
 
 org.apache.cxf.binding.soap.SoapFault:
 http://schemas.xmlsoap.org/wsdl/;,
 the namespace on the definitions element, is not a valid 
 SOAP version.
 
 I tried a bunch of variations too with no success.
 How does one make this work?  (I'd also appreciate
 an example for wsdl_first_soap12 or any of the others)
 
 Thanks,
 Dan
 


Re: client code to access java_first_jaxws on tomcat

2008-02-19 Thread Glen Mazza
Here's a WSDL-first example I created:
http://www.jroller.com/gmazza/date/20071019

For just a pure client, of an already existing web service:
http://www.jroller.com/gmazza/date/20070929

HTH,
Glen

Am Dienstag, den 19.02.2008, 16:24 -0800 schrieb Daniel Lipofsky:
 I am trying to learn CXF, I have installed the java_first_jaxws
 sample on Tomcat 5.5 and can see the wsdl at
 http://localhost:8080/helloworld/services/hello_world?wsdl
 
 But what I don't understand is how I can run webservices
 against that server.  Does anyone have client code that will
 allow me to test?  I tried modifying Client.java like this:
 
 private static final QName SERVICE_NAME
 = new QName(http://server.hw.demo/;, HelloWorld);
 private static final QName PORT_NAME
 = new QName(http://server.hw.demo/;, HelloWorldPort);
 
 public static void main(String args[]) throws Exception {
 Service service = Service.create(SERVICE_NAME);
 String endpointAddress =
 http://localhost:8080/helloworld/services/hello_world?wsdl;;
 service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING,
 endpointAddress);
 HelloWorld hw = service.getPort(HelloWorld.class);
 System.out.println(hw.sayHi(World));
 }
 
 but all I got was
 
 org.apache.cxf.binding.soap.SoapFault:
 http://schemas.xmlsoap.org/wsdl/;,
 the namespace on the definitions element, is not a valid SOAP version.
 
 I tried a bunch of variations too with no success.
 How does one make this work?  (I'd also appreciate
 an example for wsdl_first_soap12 or any of the others)
 
 Thanks,
 Dan



Re: client code to access java_first_jaxws on tomcat

2008-02-19 Thread Willem Jiang

Hi Dan,

You set the wrong endpointAddress.

http://localhost:8080/helloworld/services/hello_world?wsdl; is the 
service wsdl url. 

you need to set the endpointAddress to be 
http://localhost:8080/helloworld/services/hello_world;


Willem 



Daniel Lipofsky wrote:

I am trying to learn CXF, I have installed the java_first_jaxws
sample on Tomcat 5.5 and can see the wsdl at
http://localhost:8080/helloworld/services/hello_world?wsdl

But what I don't understand is how I can run webservices
against that server.  Does anyone have client code that will
allow me to test?  I tried modifying Client.java like this:

private static final QName SERVICE_NAME
= new QName(http://server.hw.demo/;, HelloWorld);
private static final QName PORT_NAME
= new QName(http://server.hw.demo/;, HelloWorldPort);

public static void main(String args[]) throws Exception {
Service service = Service.create(SERVICE_NAME);
String endpointAddress =
http://localhost:8080/helloworld/services/hello_world?wsdl;;
service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING,
endpointAddress);
HelloWorld hw = service.getPort(HelloWorld.class);
System.out.println(hw.sayHi(World));
}

but all I got was

org.apache.cxf.binding.soap.SoapFault:
http://schemas.xmlsoap.org/wsdl/;,
the namespace on the definitions element, is not a valid SOAP version.

I tried a bunch of variations too with no success.
How does one make this work?  (I'd also appreciate
an example for wsdl_first_soap12 or any of the others)

Thanks,
Dan