axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Lawson (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-2023) WSDL2Java generates port code that throws arrays
Date Sat, 18 Jun 2005 18:01:19 GMT
    [ http://issues.apache.org/jira/browse/AXIS-2023?page=comments#action_12313987 ] 

Jeff Lawson commented on AXIS-2023:
-----------------------------------

Fixed by using -w as described in issue 2022.

Thanks.



> WSDL2Java generates port code that throws arrays
> ------------------------------------------------
>
>          Key: AXIS-2023
>          URL: http://issues.apache.org/jira/browse/AXIS-2023
>      Project: Apache Axis
>         Type: Bug
>   Components: WSDL processing
>     Versions: 1.2
>  Environment: Windows 2000 Professsional, Java 1.4.2-b28
>     Reporter: Jeff Lawson

>
> Here's how to get WSD:2Java to generate code that throws an array:
> In WSDL:
>   <element name="ServiceExceptionReport">
>     <complexType>
>       <sequence>
>         <element name="ServiceException" type="abc:ServiceExceptionType" minOccurs="0"
maxOccurs="unbounded"/>
>       </sequence>
>     </complexType>
>   </element>
>   <complexType name="ServiceExceptionType">
>     <sequence>
>       <element name="ErrorCode" type="string"/>
>       <element name="ErrorData" type="string" minOccurs="0" maxOccurs="unbounded"/>
>     </sequence>
>   </complexType>
> that gets used like this:
> <message name="ExceptionMessage">
>   <part name="body" element="abc:ServiceExceptionReport"/>
> </message>
> <message name="MyMethodIn">
>   <part name="parameters" element="abc:MyRequest"/>
> </message>
> <message name="MyMethodOut">
>   <part name="parameters" element="abc:MyResponse"/>
> </message>
>  <portType name="ABCPortType">
>   <operation name="MyMethod">
>    <input message="abc:MyMethodIn"/>
>    <output message="abc:MyMethodOut"/>
>    <fault name="exception" message="abc:ExceptionMessage"/>
>   </operation>
>  </portType>
> WDSL2Java discards ServiceExceptionReport and generates code like:
> public interface ABCPortType extends java.rmi.Remote
> {
>     public abc.MyResponseType myMethod(abc.MyRequestType parameters) throws java.rmi.RemoteException,
abc.ServiceExceptionType[];
> }
> A workaround is to create a superfluous element:
>   <element name="ServiceExceptionReportMessage">
>     <complexType>
>       <sequence>
>         <element ref="abc:ServiceExceptionReport"/>
>      </sequence>
>     </complexType>
>   </element>
> then:
> <message name="ExceptionMessage">
>   <part name="body" element="abc:ServiceExceptionReportMessage"/>
> </message>
> and, perversely enough, WSDL2Java gives:
> public interface ABCPortType extends java.rmi.Remote
> {
>     public abc.MyResponseType myMethod(abc.MyRequestType parameters) throws java.rmi.RemoteException,
abc.ServiceExceptionReportMessage;
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message