[
https://issues.apache.org/jira/browse/AXIS2-2325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492932
]
Jorge Fernández commented on AXIS2-2325:
----------------------------------------
Hi again,
I'm bringing some updates:
I said that in the message definitions, faults had the wrong prefix but it was
the full name which was wrong. See below:
<wsdl:message name="DataAccessFault">
<wsdl:part name="part1" element="ax21:DataAccessFault" />
</wsdl:message>
and it should be
<wsdl:message name="DataAccessFault">
<wsdl:part name="part1" element="xsd:DataAccessFaultFault" />
</wsdl:message>
I edited manually the wsdl dropping the repeated elements in the messages
definitions and the types definitions and I got the
edited_API.wsdl
In spite of the changes, I get a wrong request exception from the service
instead of he one I'm throwing.
In the zip file I attach a simple client and service and the code generated.
As you can see on it, I build the exception like this:
ValidationFaultException exception = new ValidationFaultException();
ValidationFault fault = new ValidationFault();
//ValidationFault0 fault35 = new ValidationFault0();
ValidationFaultFault faultfault=new ValidationFaultFault();
fault.setDescription("hola");
faultfault.setValidationFault(fault);
exception.setFaultMessage(faultfault);
throw exception;
And when debugging I can see the variable exception that has 4 attributes:
cause, detailedMessage,faultMessage and StackTrace. The former one is a
ValidationFaultExcepion. So cause attribute has the same
ValidationFaultException inside and this is recursive.
I tried defining them like this, but I'm still having problems:
<xs:element name="DataAccessFault" nillable="true" type="ns0:DataAccessFault"/>
<xs:element name="InvalidArgumentValueFault" nillable="true"
type="ns0:InvalidArgumentValueFault"/>
<xs:element name="ValidationFault" nillable="true" type="ns0:ValidationFault"/>
That was like this:
<xs:element name="DataAccessFault">
<xs:complexType>
<xs:sequence>
<xs:element name="DataAccessFault" nillable="true"
type="ns0:DataAccessFault"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InvalidArgumentValueFault">
<xs:complexType>
<xs:sequence>
<xs:element name="InvalidArgumentValueFault"
nillable="true" type="ns0:InvalidArgumentValueFault"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ValidationFault">
<xs:complexType>
<xs:sequence>
<xs:element name="ValidationFault" nillable="true"
type="ns0:ValidationFault"/>
</xs:sequence>
</xs:complexType>
</xs:element>
> Java2WSDL does not generate faults correctly
> --------------------------------------------
>
> Key: AXIS2-2325
> URL: https://issues.apache.org/jira/browse/AXIS2-2325
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: codegen
> Affects Versions: 1.1.1
> Environment: Windows XP Java 1.5, Eclipse 3.2.2, Axis2 Eclipse Plugin
> 1.2.1
> Reporter: Jorge Fernández
> Assigned To: Deepal Jayasinghe
> Attachments: API.java, API.java, API.wsdl, API.wsdl, API.wsdl,
> API.wsdl, axis2-2325patch.txt, DataAccessFault.java,
> IncorrectPasswordFault.java, IncorrectUserFault.java, ValidationFault.java
>
>
> The first problem is that in the WSDL generated my fault name is ignored and
> instead it's compound from the operation name and "Fault".
> Also if I throw two exceptions from one operation, in the WSDL only one
> appears and with the name I said before.
> I attach the API from where I build the WSDL, the Faults classes and the WSDL
> generated.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]