2013-11-21 29 views
0

當我嘗試將Mule Studio與SAP連接時。我收到錯誤。Mule Studio:消息不是SAP對象,它的類型是「字符串」

org.mule.api.transport.DispatchException:消息不是SAP對象,它是「String」類型。檢查此連接器的變壓器「connector.sap.mule.default」。無法通過端點路由事件:DefaultOutboundEndpoint {endpointUri = sap:// function,

請幫我這個。

enter image description here

我的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> 
+0

XML配置好嗎? –

+0

@DavidDossot:HI大衛,我已經添加了我的XML代碼上面..請檢查並讓我知道... –

回答

0

你錯過了配置位。從documentation

輸入騾消息

出站端點需要一個騾消息攜帶下列任何有效載荷:

  • org.mule.transport.sap.SapObjectinstance。這是一個Java POJO,它的兩個主要屬性是:
    • 類型:SapType.FUNCTION(用於BAPI調用)或SapType.IDOC(用於IDoc)。
    • value:特定JCo對象取決於有效負載類型:或com.sap.conn.idoc.IDocDocumentList代表IDoc,com.sap.conn.jco.JCoFunction代表BAPI調用。
  • 任何其他對象。您需要爲XML定義提供屬性definitionFile或將其嵌入到XML中。

有效載荷可以從XML字符串被轉換或流與下列變壓器一個SapObject:

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

<!-- BAPI calls --> 
<sap:xml-to-function/> 
+0

Soory遲到回覆....首先是有可能調用sap函數與HTTP請求。我調用函數的方式是對還是錯? –

+0

即使在流程中使用什麼傳輸啓動也無關緊要:重要的是,如果您正確地將正確的參數傳遞給在入站端點之後在流中使用的消息處理器。 –

+0

大衛,我在我的XML文件中添加了以上代碼。仍然得到相同的錯誤。請幫我解決一下這個。 –

相關問題