cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marty Saxton" <>
Subject RE: attempting HelloWorld service, getting NULL return value
Date Wed, 18 Jul 2007 17:44:57 GMT
Yes, something is up with the client, and it's only in jax-ws frontend.
The simple front end works.  I am using CXF 2.0-incubator.

Here's my main.  The 1st hunk of code uses the classes generated from
the java2wsdl tool.  This is the one that is returning the null.  The
2nd hunk of code uses the simple front end, and it works fine.

public static void main(String[] args) {

	HelloWorldImplService hws = new HelloWorldImplService();
	HelloWorld hw = hws.getHelloWorldImplPort();
	String s = hw.sayHi("asdf");
	final String SERVICE_URL =
	ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
	HelloWorld helloWorldClient = (HelloWorld) factory.create();	
	s = helloWorldClient.sayHi("asdf");

Here's the HelloWorld interface that was generated by java2wsdl (run
from the maven plugin).  The one thing that is suspect is the
targetNamespace for @WebResult is empty string.  I think it should be

@WebService(targetNamespace = "http://test.twowire/", name =
public interface HelloWorld {

    @WebResult(targetNamespace = "", name = "return")
    @RequestWrapper(localName = "sayHi", targetNamespace =
"http://test.twowire/", className = "twowire.test.SayHi")
    @ResponseWrapper(localName = "sayHiResponse", targetNamespace =
"http://test.twowire/", className = "twowire.test.SayHiResponse")
    public java.lang.String sayHi(
        @WebParam(targetNamespace = "", name = "arg0")
        java.lang.String arg0

Here is the WSDL (which was generated via wsdl2java):

<?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:definitions
name="HelloWorldImplService" targetNamespace="http://test.twowire/">
<xsd:schema xmlns="http://test.twowire/"
attributeFormDefault="unqualified" elementFormDefault="unqualified"
<xsd:element name="sayHi" type="sayHi"/>
<xsd:complexType name="sayHi">
<xsd:element minOccurs="0" name="arg0" type="xsd:string"/>
<xsd:element name="sayHiResponse" type="sayHiResponse"/>
<xsd:complexType name="sayHiResponse">
<xsd:element minOccurs="0" name="return" type="xsd:string"/>
  <wsdl:message name="sayHiResponse">
    <wsdl:part element="ns1:sayHiResponse" name="parameters">
  <wsdl:message name="sayHi">
    <wsdl:part element="ns1:sayHi" name="parameters">
  <wsdl:portType name="HelloWorld">
    <wsdl:operation name="sayHi">
      <wsdl:input message="ns1:sayHi" name="sayHi">
      <wsdl:output message="ns1:sayHiResponse" name="sayHiResponse">
  <wsdl:binding name="HelloWorldImplServiceSoapBinding"
    <soap:binding style="document"
    <wsdl:operation name="sayHi">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="sayHi">
        <soap:body use="literal"/>
      <wsdl:output name="sayHiResponse">
        <soap:body use="literal"/>
  <wsdl:service name="HelloWorldImplService">
    <wsdl:port binding="ns1:HelloWorldImplServiceSoapBinding"
      <soap:address location="http://localhost:8080/hello/HelloWorld"/>

Thanks in advance!

-----Original Message-----
From: Liu, Jervis [] 
Sent: Tuesday, July 17, 2007 9:09 PM
Subject: RE: attempting HelloWorld service, getting NULL return value

Hi Marty, as you said, you've examined the message flowing between
client and client and it is correct, in this case, must be sth wrong
with your client. You may want to send us your client code, so that we
can take a quick look to see what happened there.


-----Original Message-----
From: Marty Saxton []
Sent: 2007?7?18? 3:35
Subject: attempting HelloWorld service, getting NULL return value

I am using CXF as both the client and server, and I'm just trying to get
the following simple service working:
public interface HelloWorld {
    String sayHi(String text);
The implementation just returns "Hello " + text.  I examined the XML
flowing between the client & server and it appears correct, the server
is returning a correct message.  On the client side, using the jax-ws
frontend, I get a null instead of a string for the return value.  I must
be doing something terribly wrong, but I'm not sure where to begin
debugging this problem.
Thanks in advance!

IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4,

View raw message