on 11-05-2012 10:04 PM
One of the scenarios that I'm currently working on requires handling SOAP Fault exception message.
I found several SOAP fault message samples online. But, if I generate XSD from the XML and import into PI (7.3),
the import is failing with the following Error:
"Unable to convert imported document to WSDL
Reason:
Error when parsing an XML document (The markup in the document following the root element must be well-formed.)Check selected category"
Can somebody please share with me XSD of a SOAP Fault Exception message which can be imported in PI 7.3?
Thank you for your time!
Hi Crazy Lad,
As far as i know the SOAP Fault Element is a tag inside the SOAP envelope. If you don't need to map a value i won't try to construct an XSD with the SOAP envolture, because the XSD should be only for the payload. I will use an XSL mapping to constuct this tag and finallly in the SOAP adapter i will check the box "Do Not Use SOAP Envelope", for that the PI won't introduce their own tags.
However, if you want to do an XSD for the SOAP envelope, there are some online tools that you can use. For example, for this XML:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>
<faultstring xsi:type="xsd:string">
Failed to locate method (ValidateCreditCard) in class
(examplesCreditCard) at /usr/local/ActivePerl-5.6/lib/
site_perl/5.6.0/SOAP/Lite.pm line 1555.
</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
You could obtain this XSD:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--W3C Schema generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" targetNamespace="http://schemas.xmlsoap.org/soap/envelope/" elementFormDefault="qualified">
<xs:complexType name="faultcodeType" mixed="true">
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="faultstringType" mixed="true">
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="BodyType">
<xs:sequence>
<xs:element name="Fault" type="SOAP-ENV:FaultType"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Envelope">
<xs:complexType>
<xs:sequence>
<xs:element name="Body" type="SOAP-ENV:BodyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="FaultType">
<xs:sequence>
<xs:element name="faultcode" type="SOAP-ENV:faultcodeType"/>
<xs:element name="faultstring" type="SOAP-ENV:faultstringType"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Finally, pay attention the import procedure as Treivor Naidoo comments.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Inaki, thank you for your response. I was able to import the XSD you provided. I have used the imported definition in an inbound interface. I have created a message mapping between the fault message of inbound and the outbound interfaces. I've provided this message mapping in the "Fault" tab of the Operation Mapping. While testing the fault scenario, I see in the Integration Engine Monitor that the SOAP Fault exception is triggered by the SOAP Receiver (due to an invalid action name in the SOAP receiver channel). But, the Fault message mapping isn't kicking in. Is there anything I should do to trigger it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
check the note for SOAP FAQ - 856597 it has detailed explanation...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.