You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org> on 2005/07/12 16:19:45 UTC
[jira] Resolved: (AXIS-2023) WSDL2Java generates port code that throws arrays
[ http://issues.apache.org/jira/browse/AXIS-2023?page=all ]
Davanum Srinivas resolved AXIS-2023:
------------------------------------
Resolution: Invalid
closing as per last comment
> 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