Hello all,
I'm running across various issues with the "wscompile" utility in JWSDP 1.5.
The problem mainly arises when I have a "message" element in my custom WSDL
that has more than one "part" inner elements (basically I want a generated
method with multiple parameters). I've written a simple test WSDL file that
can be used to illustrate the problem. Note that this is a document/literal
web service that I'm passing as input to wscompile so that the corresponding
Java objects can be generated. The wscompile command that I'm using is:
wscompile -gen:server -model model -f:wsi -f:unwrap -f:documentliteral -keep
-s generated -d output/server -verbose -classpath . config.xml
Note that I want the generated methods to use Item[] for method arguments
and not the generated "Items" object. The following WSDL file illustrates
the problem. If you take out the "param_two" from the message
"TestWebService_handleItems" then wscompile generates the proper artifacts.
However, if you add an extra parameter ("part_two") as the WSDL is currently
written, then wscompile outputs the following error:
[CustomClassGenerator: generating JavaClass for: Item]
[CustomClassGenerator: generating JavaClass for: Items]
[LiteralObjectSerializerGenerator: writing serializer/deserializer for:
Item]
[LiteralObjectSerializerGenerator: writing serializer/deserializer for:
Items]
error: generator error: internal error (should not happen):
tie.generator.002
Note that it still appears to generate all of the proper Java artifacts,
except now the main endpoint interface that it generates uses the "Items"
object as a parameter instead of "Item[]". Is there something wrong in the
way that I'm writing the WSDL? I've also noticed that if I don't use the
name of the operation as the element name for the "Items" complex type, then
the generated endpoint interface uses "Items" and not "Item[]".
Can anyone point me in the right direction here?
Thank you,
Ryan
Test.wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<!-
File: Test.wsdl
-->
<definitions name="TestWebService"
targetNamespace="urn:com.test.webservice/1.0.0/wsdl"
xmlns:tns="urn:com.test.webservice/1.0.0/wsdl"
xmlns:xsdns="urn:com.test.webservice/1.0.0/types"
xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="
http://schemas.xmlsoap.org/wsdl/">
<!-- Types: Provides data type definitions used to describe the
messages exchanged. -->
<types>
<schema
targetNamespace="urn:com.test.webservice/1.0.0/types"
xmlns:tns="urn:com.test.webservice/1.0.0/types"
xmlns="
http://www.w3.org/2001/XMLSchema">
<complexType name="Items">
<sequence>
<element
name="arrayOfItems" type="tns:Item" nillable="false"
minOccurs="1" maxOccurs="unbounded">
</element>
</sequence>
</complexType>
<complexType name="Item">
<sequence>
<element
name="itemIdentifier" type="string" nillable="false"/>
<element
name="itemName" type="string" nillable="true"/>
</sequence>
</complexType>
<element name="handleItems"
type="tns:Items" />
<element name="itemElement"
type="tns:Item"/>
</schema>
</types>
<!-- Message: An abstract definition of the data being
transmitted. -->
<message name="TestWebService_handleItems">
<part name="param_one" element="xsdns:handleItems"/>
<part name="param_two" element="xsdns:itemElement"/>
</message>
<!-- PortType: An abstract definition of the operations. -->
<portType name="TestWebServicePortType">
<operation name="handleItems">
<input
message="tns:TestWebService_handleItems"/>
</operation>
</portType>
<!-- Binding: The concrete protocol and data format for the
operations and messages. -->
<binding name="TestWebServiceBinding"
type="tns:TestWebServicePortType">
<soap:binding
transport="
http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="handleItems">
<soap:operation
soapAction="TestWebService/handleItems"/>
<input>
<soap:body use="literal"/>
</input>
</operation>
</binding>
<service name="TestWebService">
<port name="TestWebServicePort"
binding="tns:TestWebServiceBinding">
<soap:address
location="REPLACE_WITH_ACTUAL_URL"/>
</port>
</service>
</definitions>
Config.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<configuration xmlns="
http://java.sun.com/xml/ns/jax-rpc/ri/config">
<wsdl location="C:/test/Test.wsdl"
packageName="com.test "/>
</configuration>