0

当我尝试将 Mule Studio 与 SAP 连接时。我收到错误。

org.mule.api.transport.DispatchException:消息不是 SAP 对象,它是“字符串”类型。检查此连接器“connector.sap.mule.default”的变压器。无法通过端点路由事件:DefaultOutboundEndpoint{endpointUri=sap://function,

请帮我解决一下这个。

在此处输入图像描述

我的xml文件.....

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:sap="http://www.mulesoft.org/schema/mule/sap" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/sap http://www.mulesoft.org/schema/mule/sap/current/mule-sap.xsd">
    <flow name="SapFlow1" doc:name="SapFlow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="getSapDetails" doc:name="HTTP"/>
        <sap:outbound-endpoint type="function" rfcType="srfc" responseTimeout="10000" jcoAsHost="hostname" jcoUser="username" jcoPasswd="password" jcoSysnr="00" jcoClient="100" jcoLang="EN" doc:name="SAP"/>
    </flow>
</mule>
4

1 回答 1

0

您缺少一些配置。从文档中:

输入骡消息

outbound-endpoint 需要一个 Mule 消息携带以下任何有效负载:

  • org.mule.transport.sap.SapObjectinstance. 这是一个 Java POJO,它的两个主要属性是:
    • 类型:(SapType.FUNCTION对于 BAPI 调用)或SapType.IDOC(对于 IDoc)。
    • 值:特定的 JCo 对象取决于负载类型:com.sap.conn.idoc.IDocDocument或者com.sap.conn.idoc.IDocDocumentList对于 IDocs 和com.sap.conn.jco.JCoFunction对于 BAPI 调用。
  • 任何其他对象。您需要为 XML 定义提供属性定义文件或将其嵌入到 XML 中。

可以使用以下转换器将有效负载从 XML 字符串或流转换为 SapObject:

<!-- IDocs -->
<sap:xml-to-idoc/>

<!-- BAPI calls -->
<sap:xml-to-function/>
于 2013-11-22T17:10:09.287 回答