users@jax-rpc.java.net

wsdeploy generates distinct WSDLs for each service endpoint

From: Tony Sung <subscription_at_monotonic.net>
Date: Tue, 09 Nov 2004 23:55:27 +0800

Dear All,

I have a problem on using wsdeploy to create a jaxrpc service WAR file.
The scenario is as followed:

I have defined a service that comprises 4 service endpoints and
generated the WSDL file that looks like the following:

<definitions name="Horn" targetNamespace="http://foo.com/wsdl"...>
   ...
   <portType name="ServerManagement">...</portType>
   <portType name="AccountManagement">...</portType>
   <portType name="JobManagement">...</portType>
   <portType name="ClientAccess">...</portType>
     ...
   <binding name="ServerManagementBinding" type="tns:ServerManagement">
     <operation name="authenticate">
       <soap:operation soapAction=""/>
       <input><soap:body ... namespace="http://foo.com/wsdl"/></input>
       <output><soap:body ... namespace="http://foo.com/wsdl"/></output>
    </operation>
     ...
   </binding>
   ...
   <service name="Horn">
     <port name="ServerManagementPort"
binding="tns:ServerManagementBinding">... </port>
     <port name="AccountManagementPort"
binding="tns:AccountManagementBinding">... </port>
     <port name="JobManagementPort"
binding="tns:JobManagementBinding">... </port>
     <port name="ClientAccessPort" binding="tns:ClientAccessBinding">...
</port>
   </service>
</definitions>

Then I use wscompile to import the above WSDL to generate the java
interfaces and implemented. Finally I use wsdeploy with the following
deployment descriptor to process the WAR file:

<webServices ... targetNamespaceBase="http://foo.com/wsdl"
typeNamespaceBase="http://foo.com/types">

     <endpoint ... interface="com.foo.horn.AccountManagement"
implementation="com.foo.hornix.endpoint.AccountManagementImpl"/>
     <endpoint ... interface="com.foo.horn.ClientAccess"
implementation="com.foo.hornix.endpoint.ClientAccessImpl"/>
     <endpoint ... interface="com.foo.horn.JobManagement"
implementation="com.foo.hornix.endpoint.JobManagementImpl"/>
     <endpoint ... interface="com.foo.horn.ServerManagement"
implementation="com.foo.hornix.endpoint.ServerManagementImpl"/>

     <endpointMapping endpointName="AccountManagement"
urlPattern="/AccountManagement"/>
     <endpointMapping endpointName="ClientAccess"
urlPattern="/ClientAccess"/>
     <endpointMapping endpointName="JobManagement"
urlPattern="/JobManagement"/>
     <endpointMapping endpointName="ServerManagement"
urlPattern="/ServerManagement"/>

</webServices>

The resulting WAR file, however, consists of 4 WSDL which describes each
of the 4 service endpoints as belong of individual distinct services. On
of the WSDL looks like the following:

<definitions name="ServerManagement"
targetNamespace="http://foo.com/wsdl/ServerManagement" ...>
   ...
   <portType name="ServerManagement"></portType>
   ...
   <binding name="ServerManagementBinding" type="tns:ServerManagement">
     <operation name="authenticate">
       <soap:operation soapAction=""/>
       <input><soap:body ...
namespace="http://foo.com/wsdl/ServerManagement"/></input>
       <output><soap:body ...
namespace="http://foo.com/wsdl/ServerManagement"/></output>
     </operation>
     ...
   </binding>
   <service name="ServerManagement">
     <port name="ServerManagementPort"
binding="tns:ServerManagementBinding">...</port>
   </service>
</definitions>

In comparing to the original WSDL, not only ServerManagementPort is now
under the service name "ServerManagement", but its namespace is now
http://foo.com/wsdl/ServerManagement instead of http://foo.com/wsdl.
This actually makes clients derived from the original WSDL unable to
perform RPC on this service implementation.

May anyone please kindly let me know what's going wrong and instructs me
of the solutions?

Thanks a lot!

Tony

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net