users@jax-rpc.java.net

Re: Internal wscompile error from custom WSDL

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Wed, 04 May 2005 13:09:37 -0700

Ryan,
If you follow the rules for wrapper style, then in document/literal
JAXRPC will unwrap the outer element and use
its subelements as the parameters. To meet wrapped style you must:

1) input and output messages must have 1 part
2) the input message part must have a element which names is named after
the operation
3) the elements refered to by the input and output message parts must be
a complex type defined
using the zxs:sequence compositor and containing only element declarations.

I've attached a modified WSDL that should work.

<>
Ryan LeCompte wrote:

>Alessio,
>
>Thank you for pointing me in the right direction. It looks like the only
>solution is to create a new complex type that has all of the "parameters"
>that I need. Then the operation just takes a single argument of that type
>with all of the values that I would otherwise have as separate parameters to
>the method.
>
>Thanks,
>Ryan
>
>-----Original Message-----
>From: Alessio Cervellin [mailto:alessio.cervellin_at_sun-cs-italy.com]
>Sent: Wednesday, May 04, 2005 2:28 PM
>To: users_at_jax-rpc.dev.java.net
>Subject: Re: Internal wscompile error from custom WSDL
>
>Ryan LeCompte wrote:
>
>
>
>>Hello all,
>>[CUT]
>>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:
>>
>>
>
>If you are using doc/literal then the input message can have only one part.
>For further info look this thread:
>https://jax-rpc.dev.java.net/servlets/ReadMsg?listName=users&msgNo=2755
>
>---------------------------------------------------------------------
>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
>
>
>---------------------------------------------------------------------
>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
>
>
>


<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:handleItemsType" />
                                     <complexType name="handleItemsType">
                                         <sequence>
                                               <element name="items" type="tns:Items"/>
                                               <element name="itemElement" type="tns:Item"/>
                                         </sequence>
                                     </complexType>

                        </schema>

            </types>

 

            <!-- Message: An abstract definition of the data being transmitted. -->

            <message name="TestWebService_handleItems">

                        <part name="parameters" element="xsdns:handleItems"/>

            </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>