I am trying to understand why xrpcc and wsdeploy create different
WSDL files when presented with the same service definitions in
JWSDP 1.0_01 (and probably JWSDP 1.0 as well).
Suppose I want to create a web service called MyService that I first
define in terms of two Java interfaces called A and B. I create the
A.java and B.java files and a config.xml file that refers to both
of them and for which the targetNamespace and typeNamespace are set
to urn:MyService/wsdl and urn:MyService/types, respectively. I
compile A.java and B.java and then run xrpcc on the config.xml file.
What I get is a MyService.wsdl in which any types I define are in
namespace urn:MyService/types and the other definitions are in
urn:MyService/wsdl. The WSDL defines two portTypes corresponding to
A and B and then SOAP bindings for A and B, ports for A and B and
a single service called MyService that contains A and B.
This is all exactly what I would expect.
When it comes to wsdeploy, however, I can't figure out how to get the
same result.
In this case, I compile A.java and B.java and create a jaxrpc-ri.xml
in which I define two endpoints called A and B (since an endpoint is
logically the same as a WSDL portType), which use the classes for A and
B as their interfaces respectively and point to an implementation class
called MyServiceImpl, which implements the methods of both interfaces.
I also create a web.xml file and build all this into a WAR file.
When I run wsdeploy on this WAR and take a look inside, I don't have
a MyService.wsdl. What I have is:
- A.wsdl, which now defines A as both a port and a service.
- B.wsdl, which similarly defines B as both a port and a service.
- In A.wsdl, the namespaces are now urn:MyService/wsdlA and
urn:MyService/typesA and similarly for B.wdsl.
This is not at all the mapping that I expected and it is totally
different from what xrpcc does. It seems strange that each Java
interface is effectively made into a service of its own. Quite apart
from the fact that this is undesirable, if I have any common value
types, they get redefined in each WSDL file but in different
namespaces!
Any potential implementor of a client who uses the ?WSDL
query string to get the WSDL will retrieve two WSDL files, one for
each port. This just doesn't seem to fit with my understanding of
WSDL. Perhaps I have missed something?
Could somebody at Sun comment on why this difference exists? Is there
some way to create the jaxrpc-ri.xml file so that I can get the same
result as I did with xrpcc? The JWSDP tutorial is not helpful here,
since it only shows services with a single associated portType
(endpoint).
There is also another oddity that appears when using wscompile -import.
Suppose I have a Java interface that contains a method that requires
a user-defined value type as a parameter. When I use xrpcc to create the
WSDL file from this, it correctly creates a complexType in the types
section to hold the members of the value type. When I then use
wscompile -import to create Java interface definitions from this
(as somebody might do if they grab my WSDL file), it
correctly generates the methods that refer to the Java class that
represents the complexType, but it does NOT create the Java class file
for that value type - resulting in compilation errors. Is this a bug,
or is there some other command line option I need to use with -import?
Kim Topley
Keyboard Edge Limited
kt_at_topley.demon.co.uk