You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Bozhong Lin (JIRA)" <ji...@apache.org> on 2006/12/06 07:49:27 UTC

[jira] Updated: (CXF-257) PortType can have its own targetnamespace and different from the service one

     [ http://issues.apache.org/jira/browse/CXF-257?page=all ]

Bozhong Lin updated CXF-257:
----------------------------

        Fix Version/s: 2.0-RC
    Affects Version/s: 2.0-RC

> PortType can have its own targetnamespace and different from the service one
> ----------------------------------------------------------------------------
>
>                 Key: CXF-257
>                 URL: http://issues.apache.org/jira/browse/CXF-257
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime, Tooling
>    Affects Versions: 2.0-RC
>            Reporter: jimma
>             Fix For: 2.0-RC
>
>
> 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:
>     @Override
>     public QName getInterfaceName() {
>         Class<?> epi = implInfo.getEndpointClass();
>         WebService ws = null;
>         if (epi != null) {
>             ws = epi.getAnnotation(WebService.class);
>         }
>         if (ws != null && ws.name() != null && ws.name().length() > 0) {
>             String name = ws.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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira