You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Howard Gao <ho...@iona.com> on 2006/11/13 03:36:56 UTC
[Fwd: cxf issues]
Hello CXF guys,
I'm trying CXF I've got two issues regarding CXF runtime.
First, I started with a simple Java interface:
package com.cxf;
public interface Hello {
String sayHi();
}
Then I add some annotations to make it jax-ws enabled, as
package com.cxf;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.soap.SOAPBinding;
@WebService(name="Hello", portName="HelloPort",
serviceName="HelloService", targetNamespace="http://hello.cxf.com/",
endpointInterface="com.cxf.Hello")
public interface Hello {
@SOAPBinding(parameterStyle=javax.jws.soap.SOAPBinding.ParameterStyle.BARE,
style=javax.jws.soap.SOAPBinding.Style.RPC,
use=javax.jws.soap.SOAPBinding.Use.LITERAL)
@WebMethod(operationName="sayHi", exclude=false)
String sayHi();
}
Then I call CXF java2wsdl to generate a wsdl Called Hello.wsdl. Then I
use cxf's
wsdl2java tool to generate java server/client.
I tried to start the server and got the following exception:
...
INFO: Setting up InstrumentationManager
Exception in thread "main" javax.xml.ws.WebServiceException: Attributes
portName, serviceName and endpointInterface are not allowed in the
@WebService annotation of an SEI.
at
org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxWsImplementorInfo.java:170)
at
org.apache.cxf.jaxws.support.JaxWsImplementorInfo.<init>(JaxWsImplementorInfo.java:55)
at org.apache.cxf.jaxws.EndpointImpl.<init>(EndpointImpl.java:91)
at
org.apache.cxf.jaxws.spi.ProviderImpl.createEndpoint(ProviderImpl.java:57)
at
org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:66)
at javax.xml.ws.Endpoint.publish(Endpoint.java:156)
at com.cxf.HelloServer.<init>(HelloServer.java:37)
at com.cxf.HelloServer.main(HelloServer.java:41)
Then I change the annotation of Hello interface to (just bare @WebService):
@WebService
public interface Hello {
@SOAPBinding(parameterStyle=javax.jws.soap.SOAPBinding.ParameterStyle.BARE,
style=javax.jws.soap.SOAPBinding.Style.RPC,
use=javax.jws.soap.SOAPBinding.Use.LITERAL)
@WebMethod(operationName="sayHi", exclude=false)
String sayHi();
}
After compilation, the server starts up successfully. Then I run the
client, I got:
INFO: Creating Service {http://cxf.com/}HelloService from WSDL.
Exception in thread "main" java.lang.NullPointerException
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(JaxWsServiceFactoryBean.java:251)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(JaxWsServiceFactoryBean.java:233)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(JaxWsServiceFactoryBean.java:213)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:122)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:239)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:178)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:116)
at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:239)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:199)
at javax.xml.ws.Service.getPort(Service.java:94)
at com.cxf.HelloService.getHelloPort(HelloService.java:67)
at com.cxf.HelloClient.main(HelloClient.java:65)
Can you guys take a look and give me some info about what's going on in
the project?
--
Howard Gao