【问题标题】:Mule Studio: Message is not a SAP object, it is of type "String"Mule Studio:消息不是 SAP 对象,它是“字符串”类型
【发布时间】:2013-12-06 01:23:54
【问题描述】:

当我尝试将 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>

【问题讨论】:

  • @DavidDossot:嗨,大卫,我已经在上面添加了我的 xml 代码。请检查并告诉我...

标签: mule mule-studio jco


【解决方案1】:

您缺少一些配置。来自documentation:

输入 Mule 消息

出站端点需要一个 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/>

【讨论】:

  • 迟到回复很抱歉....首先可以使用 HTTP 请求调用 sap 函数。我调用函数的方式是对还是错???
  • 无论您使用何种传输方式在流中启动偶数都无关紧要:重要的是您是否在入站端点之后正确地将正确的参数传递给您在流中使用的消息处理器。
  • 大卫,我在我的 XML 文件中添加了上面的代码。我仍然得到同样的错误。请帮帮我。
  • 什么代码?根据您的用例,有几种可能性。然后更新您的问题。
  • 好吧,我的场景是我想通过 RFC 同步来自 SAP 的所有数据,并且我想将数据本地保存在 MYSQL 数据库中。可以通过mulesoft工具吗???
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-08-25
  • 1970-01-01
  • 1970-01-01
  • 2019-11-21
  • 2020-05-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多