cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jimma (JIRA)" <>
Subject [jira] Created: (CXF-257) PortType can have its own targetnamespace and different from the service one
Date Tue, 21 Nov 2006 02:21:02 GMT
PortType can have its own targetnamespace and different from the service one

                 Key: CXF-257
             Project: CXF
          Issue Type: Bug
          Components: JAX-WS Runtime, Tooling
            Reporter: jimma

When building the model from a java class using jaxws,
the PortType QName must be inferred from the @WebService
annotation on the SEI.

For example

@WebService( serviceName = "SoapService",
                       targetNamespace = "urn:greeter:service"
                       endpointInterface =
"org.apache.hello_world_soap_http.Greeter" )
public class GreeterImpl {

@WebService( name = "Greeter", targetNamespace = "urn:greeter:port" )
public interface Greeter {

must lead to a service QName of "{urn:greeter:service}SoapService",
and a PortType QName of "{urn:greeter:port}Greeter".

Due to wsdl spec, the generated wsdl must be splitted in two with
an import statement, so that the PortType can have its own
targetNamespace, different from the Service one.

The PortType QName can be easily fixed in the JaxWsServiceConfiguration with
the following code:
    public QName getInterfaceName() {
        Class<?> epi = implInfo.getEndpointClass();
        WebService ws = null;
        if (epi != null) {
            ws = epi.getAnnotation(WebService.class);
        if (ws != null && != null && > 0)
            String name =;
            String nsuri = ws.targetNamespace();
            if (nsuri == null || nsuri.length() == 0) {
                nsuri =
ServiceUtils.makeNamespaceFromClassName(epi.getName(), "http");
            return new QName(nsuri, name);
        return null;

However, the tooling needs some refactoring to be able to output
two different wsdls, but I think there was a plan to use to service
model ...

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message