on 04-06-2020 7:16 PM
Hi Experts,
We are expecting a Fault response as mentioned below, in case of any failure.
Interface is SAP ECC--> SAP PI --> SOAP(Sync)
<soapenv:Body>
<soapenv:Fault>
<Faultcode>Internal Server Error</Faultcode>
<Faultstring>Exception 8240986231</Faultstring>
</soapenv:Fault>
</soapenv:Body>
We are using the standard FaultMessage Structure shown below and XSLT mapping to extract and send to ECC but it is not working and we are getting transformation error when testing in Operation Mapping.
Error:- Transformer exception occurred when executing XSLT FaultMessage (urn:ariba.XXX, -1, 597a66f0-78b0-11e6-) error logs for detailsTransformer exception occurred when executing XSLT FaultMessage
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:template match="//soapenv:Fault">
<standard>
<faultText>
<xsl:value-of select="faultcode"/>
</faultText>
<faultDetail>
<text>
<xsl:value-of select="faultstring"/>
</text>
</faultDetail>
</standard>
</xsl:template>
</xsl:stylesheet>
I tried with normal one to one graphical mapping as well - there I am getting error related to soapenv prefixes in the fault response.Please suggest.
Thanks,
Nidhi Srivastava
The problem here is that the XML response from the web service server is not valid XML.
I do not know if this is caused by the SAP PO adapter.
Could you test the web service using SOAP UI?
If the fault message is sent wrong from the server, there should be a fix on the server.
The correct Fault message should have a SOAP envelope:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Body>
<SOAP:Fault>
<faultcode>SOAP:Server</faultcode>
<faultstring>Server Error</faultstring>
</SOAP:Fault>
</SOAP:Body>
</SOAP:Envelope>
If this is missing, it won't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nidhi Srivastava,
I tried both your "structure.txt" XMLs in an offline tool and came up with this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenv="http://soapenv.sap"
exclude-result-prefixes="soap xsd xsi soapenv"
version="1.0">
<xsl:template match="text()"/>
<xsl:template match="/soap:Envelope/soap:Header/*[namespace-uri()='XXX' and local-name()='Headers']/*[namespace-uri()='XXX' and local-name()='partition']">
<successPartition>
<xsl:value-of select="."/>
</successPartition>
</xsl:template>
<xsl:template match="soapenv:Body/soapenv:Fault/Faultcode">
<errorResponse>
<xsl:value-of select="."/>
</errorResponse>
</xsl:template>
</xsl:stylesheet>
If I apply this to your 2 different XMLs I get this:
success message
<?xml version="1.0" encoding="UTF-8"?>
<successPartition>pr</successPartition>
error message
<?xml version="1.0" encoding="UTF-8"?>
<errorResponse>Internal Server Error</errorResponse>
Try it in Stefan Grube's page, it is working.
I hope that helps,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nidhi Srivastava,
When I tested that XML I added this
xmlns:soapenv="http://soapenv.sap"
<soapenv:Body xmlns:soapenv="http://soapenv.sap">
<soapenv:Fault>
<Faultcode>Internal Server Error</Faultcode>
<Faultstring>Error Description</Faultstring>
</soapenv:Fault>
</soapenv:Body>
otherwise that XML will always show that error.
Could you provide the XSD for that ErrorMessages structure? Just click on tab "XSD" in your first screenshot. THanks, Peter
You can find many online tools, for example:
https://www.freeformatter.com/xsl-transformer.html
I do not really understand: what is your input and your desired output?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
The request is working fine, i have used addSoapEnvelope XSLT code to the structure as expected by the target.
The problem is coming in response. Actually, I have followed the below mentioned blog as the faultcode is coming as a response(system error and not application error).
https://blogs.sap.com/2015/07/29/soap-faults-and-webservice-faults-from-3rd-party-webservices/
As per the blog, I created the structure as mentioned in the screenshot below
Problem is the response and fault response coming from the target is in different format and I am unable to deal with the XSLT code.
In case of normal response - Envelope along with Header & Body is coming.Also, namespace prefix is coming as soap:
In case of Fault response - Only Body and Fault tag is coming along with the namespace prefix as soapenv:
The sample structure are attached for reference.
I tried forming the XSLT using the link you provided, it was very helpful. But, as I am beginner to XSLT coding am unable to format the correct structure in which both the structures can be handled.
Let me know if you have any suggestions.
Thanks,
Nidhi Srivastava
The elements in your XSLT have different names as in your SOAP message. Element names are case sensitive.
Have you tested your XSLT with a tool outside SAP PO?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.