naren
naren

Reputation: 105

SAP:PARSING error while calling SAP sRFC FM

SAP Flow:

<sap:sap-config name="SAP_Config" doc:name="SAP Config" doc:id="03c25b56-7372-4722-92d0-ce2ef568184c" >
    <sap:simple-connection-provider-connection username="${sap.username}" password="${sap.password}" systemNumber="${sap.systemNumber}" client="${sap.client}" applicationServerHost="${sap.host}" />
</sap:sap-config>
<flow name="mule-sap-demoFlow2" doc:id="9291c5c3-319d-4a4e-a5f8-ed0de66b63d5" >
        <http:listener doc:name="Listener" doc:id="7068cc2f-2147-4334-a6e7-189352d9ef54" config-ref="HTTP_Listener_config" path="/sap"/>
        <sap:sync-rfc key="${function.key}" doc:name="Synchronous Remote Function Call" doc:id="5bca83af-159b-4fa2-8872-76fefd79be92" config-ref="SAP_Config"/>
        <ee:transform doc:name="Transform Message" doc:id="bd0b00f4-8acb-4823-a99e-9e39c1c4fe18" >
            <ee:message >
                <ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
payload]]></ee:set-payload>
            </ee:message>
        </ee:transform>
    </flow>

Error:

INFO  2020-08-06 16:02:51,335 [[MuleRuntime].uber.02: [mule-mongo-demo].mule-mongo-demoFlow2.BLOCKING @301a4df3] [processor: ; event: 2df0b2e0-d7d0-11ea-93c5-506b8d070e10] com.mulesoft.connector.sap.internal.service.impl.BAPIFunctionJCoService: Use SAP default format 'false'.
[Fatal Error] :1:1: Premature end of file.
ERROR 2020-08-06 16:02:51,366 [[MuleRuntime].uber.02: [mule-mongo-demo].mule-mongo-demoFlow2.BLOCKING @301a4df3] [processor: ; event: 2df0b2e0-d7d0-11ea-93c5-506b8d070e10] org.mule.runtime.core.internal.exception.OnErrorPropagateHandler: 

Message               : An exception occurred while parsing XML.
Element               : mule-sap-demoFlow2/processors/0 @ mule-sap-demo:mule-mongo-demo.xml:161 (Synchronous Remote Function Call)
Element DSL           : <sap:sync-rfc key="" doc:name="Synchronous Remote Function Call" doc:id="5bca83af-159b-4fa2-8872-76fefd79be92" config-ref="SAP_Config"></sap:sync-rfc>
Error type            : SAP:PARSING
FlowStack             : at mule-sap-demoFlow2(mule-mongo-demoFlow2/processors/0 @ mule-mongo-demo:mule-mongo-demo.xml:161 (Synchronous Remote Function Call))

  (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

Upvotes: 0

Views: 1532

Answers (1)

aled
aled

Reputation: 25709

The problem is that the connector is failing to parse some XML data. It is difficult to say exactly without more details but it looks like the connector is expecting some XML and it is not receiving it from the HTTP Listener, or it is not receiving a valid XML response back from SAP. Be sure to use the latest version of the SAP connector. Previous versions had a bug parsing XML with the character 0x0.

Upvotes: 1

Related Questions