You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Alexander Grivnin <ag...@mercury.com> on 2007/01/11 01:22:23 UTC

[Axis2] JiBX with Faults

Hi,

 We are using JiBX serialization mechanism (from 1.1.1-RC1) and decided
to add custom faults to the WSDL. For some reason the wsdl2java
compilation fails complaining that it does not find any corresponding
mapping for the fault type.

 Any ideas?

Thanks in advance,
Alex


Here is the WSDL fragment:
--------------------------

<wsdl:message name="PPMFaultMessage">
	<wsdl:part name="fault" element="common:PPMFault"/>
</wsdl:message>
...
<wsdl:operation name="fetchRequests">
	<wsdl:input message="axis2:fetchRequestsMessage"/>
	<wsdl:output message="axis2:fetchRequestsResponseMessage"/>
		<wsdl:fault name="PPMFaultException"
message="axis2:PPMFaultMessage"/>
</wsdl:operation>


The xsd fragment:
-----------------

<complexType name="PPMFault">
	<sequence>
		<element name="message" type="xs:string"/>
	</sequence>
</complexType>


The mapping fragment:
---------------------

<binding xmlns:common="http://mercury.com/ppm/common/1.0">

	<namespace uri="http://mercury.com/ppm/common/1.0"
prefix="common"  />

<mapping abstract="true" class="com.mercury.PPMFault" type-name="common:
PPMFault" ordered="false" >
        <value name="message" field="message" usage="optional"/>
</mapping>



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] JiBX with Faults

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Hi Alex,

Because of the way Axis2 handles faults, you need to use a non-abstract 
mapping for the fault element even when unwrapping. I'll post an example 
on the JiBX-Axis2 wiki page later today to illustrate.

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Alexander Grivnin wrote:
> Hi,
>
>  We are using JiBX serialization mechanism (from 1.1.1-RC1) and decided
> to add custom faults to the WSDL. For some reason the wsdl2java
> compilation fails complaining that it does not find any corresponding
> mapping for the fault type.
>
>  Any ideas?
>
> Thanks in advance,
> Alex
>
>
> Here is the WSDL fragment:
> --------------------------
>
> <wsdl:message name="PPMFaultMessage">
> 	<wsdl:part name="fault" element="common:PPMFault"/>
> </wsdl:message>
> ...
> <wsdl:operation name="fetchRequests">
> 	<wsdl:input message="axis2:fetchRequestsMessage"/>
> 	<wsdl:output message="axis2:fetchRequestsResponseMessage"/>
> 		<wsdl:fault name="PPMFaultException"
> message="axis2:PPMFaultMessage"/>
> </wsdl:operation>
>
>
> The xsd fragment:
> -----------------
>
> <complexType name="PPMFault">
> 	<sequence>
> 		<element name="message" type="xs:string"/>
> 	</sequence>
> </complexType>
>
>
> The mapping fragment:
> ---------------------
>
> <binding xmlns:common="http://mercury.com/ppm/common/1.0">
>
> 	<namespace uri="http://mercury.com/ppm/common/1.0"
> prefix="common"  />
>
> <mapping abstract="true" class="com.mercury.PPMFault" type-name="common:
> PPMFault" ordered="false" >
>         <value name="message" field="message" usage="optional"/>
> </mapping>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org