users@jax-rpc.java.net

RE: wscompile and multiple exceptions

From: Bill Keicher <wkeicher_at_endeca.com>
Date: Wed, 15 Sep 2004 14:58:52 -0400

hmmm.....using your example code, I get the following error from wscompile:
error: in message "operationException", part "faultDetail" must specify a
"type" attribute.

If a type attribute is used with an element attribute in the part element,
there is an error since they are mutually exclusive...perhaps I am
overlooking something painfully obvious.

-----Original Message-----
From: Marc Hadley [mailto:Marc.Hadley_at_Sun.COM]
Sent: Wednesday, September 15, 2004 1:29 PM
To: Bill Keicher
Subject: Re: wscompile and multiple exceptions


Sure, something like:

<!-- WSDL extract -->
<types>
     <xsd:schema targetNamespace="...">
         <xsd:element name="faultDetail" type="faultDetailType"/>
         <xsd:type name="faultDetailType">
             <xsd:complexType>
                 <xsd:sequence>
                     <xsd:element name="majorCode" type="xsd:int"/>
                     <xsd:element name="minorCode" type="xsd:int"/>
                 </xsd:sequence>
             </xsd:complexType>
         </xsd:type>
     </xsd:schema>
</types>

<message name="operationException">
     <part name="faultDetail" element="tns:faultDetail"/>
</message>


<portType name="StockQuoteUpdater">
     <operation name="setLastTradePrice">
         <input .../>
         <output .../>
         <fault message="tns:operationException"/>
     </operation>
</portType>

Note the use of the element attribute in the part instead of the type
attribute. To fix your WSDL you'd need to declare a global element for
each type and the change the parts to refer to those elements instead
of the types.

Marc.

On Sep 15, 2004, at 1:07 PM, Bill Keicher wrote:

> Since I am relatively new to this, could you provide me with an example
> illustrating a WS-I compatible fault message?
>
> Much Appreciated,
> Bill
>
> -----Original Message-----
> From: Marc Hadley [mailto:Marc.Hadley_at_Sun.COM]
> Sent: Wednesday, September 15, 2004 11:57 AM
> To: users_at_jax-rpc.dev.java.net
> Subject: Re: wscompile and multiple exceptions
>
>
> For WS-I compatibility you should define your fault messages with a
> single part that references a global element. Looks to me like your
> fault messages meet the first requirement but not the second (they
> refer to types rather than elements).
>
> Marc.
>
> On Sep 15, 2004, at 11:41 AM, Bill Keicher wrote:
>
>> Version info:
>> jax-rpc standard implementation (1.1.2, build R23) - came with JWSDP
>> 1.4
>>
>> and i attached the file for your enjoyment...
>>
>>
>> -----Original Message-----
>> From: Doug Kohlert [mailto:Doug.Kohlert_at_Sun.COM]
>> Sent: Wednesday, September 15, 2004 11:27 AM
>> To: users_at_jax-rpc.dev.java.net
>> Subject: Re: wscompile and multiple exceptions
>>
>>
>> Bill,
>> Can you include the entire WSDL? Also what version of JAXRPC are you
>> using?
>>
>> Bill Keicher wrote:
>>
>>> Hey Everyone,
>>>
>>> I am new to WSDL and web services. Whenever I define multiple
>>> exceptions
>> to
>>> be thrown from a given web service method in WSDL, wscompile
>>> complains with
>>> the following error:
>>> ns1_fault_QNAME=new QName("urn:blah", "fault"); is already defined,
>>> which
>>> leads me to believe only one exception can be thrown from a given
>>> method.
>>> Axis, however, compiles the WSDL without a problem. So my question
>>> is,
>> does
>>> wscompile only support one exception per method or is there something
>>> wrong
>>> with my WSDL?
>>>
>>> here's the port type and soap stuff from the wsdl:
>>> <complexType name="EDIException">
>>> <sequence>
>>> <element name="message" nillable="true" type="xsd:string"/>
>>> </sequence>
>>> </complexType>
>>> <complexType name="SubEDIException">
>>> <sequence>
>>> <element name="message" nillable="true" type="xsd:string"/>
>>> </sequence>
>>> </complexType>
>>>
>>>
>>> <wsdl:operation name="AddContent" parameterOrder="in0 in1">
>>>
>>> <wsdl:input message="impl:addContentRequest"
>>> name="addContentRequest"/>
>>>
>>> <wsdl:output message="impl:addContentResponse"
>>> name="addContentResponse"/>
>>>
>>> <wsdl:fault message="impl:EDIException" name="EDIException"/>
>>>
>>> <wsdl:fault message="impl:SubEDIException"
>> name="SubEDIException"/>
>>>
>>> </wsdl:operation>
>>> ---------------------------------
>>>
>>> <wsdl:operation name="AddContent">
>>>
>>> <wsdlsoap:operation soapAction=""/>
>>>
>>> <wsdl:input name="addContentRequest">
>>>
>>> <wsdlsoap:body
>>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>> namespace="urn:foo" use="encoded"/>
>>>
>>> </wsdl:input>
>>>
>>> <wsdl:output name="addContentResponse">
>>>
>>> <wsdlsoap:body
>>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>> namespace="urn:foo" use="encoded"/>
>>>
>>> </wsdl:output>
>>>
>>> <wsdl:fault name="EDIException">
>>>
>>> <wsdlsoap:fault
>>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>> name="EDIException" namespace="urn:foo" use="encoded"/>
>>>
>>> </wsdl:fault>
>>>
>>> <wsdl:fault name="SubEDIException">
>>>
>>> <wsdlsoap:fault
>>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>> name="SubEDIException" namespace="urn:foo" use="encoded"/>
>>>
>>> </wsdl:fault>
>>>
>>> </wsdl:operation>
>>>
>>> -------------------------------
>>> William Keicher
>>> Software Engineer
>>> Endeca
>>>
>>> T: 617-621-7250
>>> F: 617-577-7766
>>> E: wkeicher_at_endeca.com
>>> -------------------------------
>>>
>>>
>>> This email message and any attachments are confidential to Endeca. If
>>> you
>>> are not the intended recipient, please notify Endeca immediately --
>>> by
>>> replying to this message or by sending an email to: legal_at_endeca.com
>>> -- and
>>> destroy all copies of this message and any attachments. Thank you.
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>>
>>>
>>>
>>>
>>
>> --
>> -------------------------------
>> Doug Kohlert
>> Sun MicroSystems, Inc.
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>>
>> This email message and any attachments are confidential to Endeca. If
>> you
>> are not the intended recipient, please notify Endeca immediately -- by
>> replying to this message or by sending an email to: legal_at_endeca.com
>> -- and
>> destroy all copies of this message and any attachments. Thank you.
>>
>>
>> <export.wsdl>---------------------------------------------------------
>> -
>> -----------
>> 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
>>
> ---
> Marc Hadley <marc.hadley at sun.com>
> Web Products, Technologies and Standards, Sun Microsystems.
>
>
> ---------------------------------------------------------------------
> 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
>
> This email message and any attachments are confidential to Endeca. If
> you
> are not the intended recipient, please notify Endeca immediately -- by
> replying to this message or by sending an email to: legal_at_endeca.com
> -- and
> destroy all copies of this message and any attachments. Thank you.
>
---
Marc Hadley <marc.hadley at sun.com>
Web Products, Technologies and Standards, Sun Microsystems.
This email message and any attachments are confidential to Endeca. If you
are not the intended recipient, please notify Endeca immediately -- by
replying to this message or by sending an email to: legal_at_endeca.com -- and
destroy all copies of this message and any attachments. Thank you.
  



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