servicemix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattrpav <>
Subject Re: CXF and undefined SOAPFaults
Date Thu, 08 Jan 2009 22:46:52 GMT

UPDATE -- My goal is to be able to set the text in the 'faultstring' element. 
MS .NET does not handle custom faults really well.  Instead of deserializing
back to an object, it passes in a DOMElement.  In the interest in maximum
compatibility, I'd like to be able to just set the 'faultstring', which
makes life easier for .NET users.

Note --  the <faultstring> gets set to 'Fault occured', but I do not set
that anywhere.  Additionally,  the 'My Message' text is never returned in
the SOAP.


<!-- XSD -->
	<xs:element name="ErrorMessage" type="cmn:ErrorMessage" />
	<xs:complexType name="ErrorMessage">
			<xs:element name="ErrorMessage" type="xs:string" />
<!-- WSDL -->
	<!-- Message -->
	<wsdl:message name="FaultMessage">
		<wsdl:part name="parameters" element="cmn:ErrorMessage"></wsdl:part>
	<!--  Port -->
	<wsdl:portType name="CrmPort">
		<wsdl:operation name="GetCustomer">
			<wsdl:input message="ws:GetCustomer" />
			<wsdl:output message="ws:GetCustomerResponse" />
            <wsdl:fault name="FaultMessage" message="ws:FaultMessage" />
	<!--  Binding -->
	<wsdl:operation name="GetCustomer">
		<soap:operation soapAction="" />
			<soap:body use="literal" />
			<soap:body use="literal" />
		<wsdl:fault name="FaultMessage">
			<soap:fault name="FaultMessage" use="literal" />
<!--  Returns -->
<soap:Envelope xmlns:soap="">
			<faultstring>Fault occured</faultstring>
				<ns3:ErrorMessage xmlns=""
					<ns3:ErrorMessage>Customer 7777 not found.</ns3:ErrorMessage>
<!-- Java -->
  public com.airband.crm.xml.Customer getCustomer(int customerId) throws
FaultMessage    { 
        try {
        	logic = new CrmLogic();
        	return logic.getCustomer(customerId);
        } catch (Exception ex) { 
            com.airband.common.xml.ObjectFactory of = new
            ErrorMessage em = of.createErrorMessage();
            throw new FaultMessage("My message", em);

View this message in context:
Sent from the ServiceMix - User mailing list archive at

View raw message