When you consider the soap message it only has the detail element.
<ns1:faultMessage xmlns:ns1="http://ws.example.com/types"> <ns1:message>UserException:id is not valid</ns1:message> </ns1:faultMessage> So only the element (in part ) details present in the soap message. In Axis2 what we does is keep a map for fault element qname and fault message name (basically generated class) in you case client must have this map which can be populated using the wsdl. key -> elementQName value --> faultMessageQname using this map client can resolve the fault message corresponding to the received element QName. Please see an Axis2 generated Stub. but this method has one problem. i.e Two fault messages can refer to the same elementQname. eg. <wsdl:message name="FaultMessage1"> <wsdl:part name="FaultMessage" element="tns:faultMessage"/> </wsdl:message> <wsdl:message name="FaultMessage2"> <wsdl:part name="FaultMessage" element="tns:faultMessage"/> </wsdl:message> for this case we can't use the above technique( Acutally Axis2 does not support this as well) for this case we have to use the fault action to map the fault to correct fault message. Amila. On 7/26/07, jaypee_p <[EMAIL PROTECTED]> wrote:
My consumer is SAP XI client. Below is the sequence for fault message is processed in XI XI Sequence 1.First step is to identify the wsdl:Message element with the namespace http://ws.example.com/service 2.The next step is to go to the part element in http://ws.example.com/types and map the fault message. To be simple in your case http://ws.example.com/service is the namespace of Fault Message and http://ws.example.com/types is the namespace of the fault message payload (Fault XML Message). So even though the Fault XML Message has the namespace http://ws.example.com/types ,but if the fault namespace doesnot come with http://ws.example.com/service then Fault will not be triggered and processed in XI. My axis server is sending a fault response like below. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/ " xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.generalException</faultcode> <faultstring/> <detail> <ns1:faultMessage xmlns:ns1="http://ws.example.com/types"> <ns1:message>UserException:id is not valid</ns1:message> </ns1:faultMessage> <ns2:exceptionName xmlns:ns2="http://xml.apache.org/axis/">com.example.ws.types.FaultMessage </ns2:exceptionName> <ns3:hostname xmlns:ns3="http://xml.apache.org/axis/">mymachine</ns3:hostname> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> They are facing the error like "Not able to match the message namespace from the fault response with the namespace "http://ws.example.com/service". " How to resolve this? -- View this message in context: http://www.nabble.com/WSDL-message-Validation-with-part-element-tf4140600.html#a11804216 Sent from the Axis - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Amila Suriarachchi, WSO2 Inc.
