我正在尝试使用Salesforce中托管的restful webservice。以下是我的流程:
<sfdc:config-with-oauth consumerKey="3MVG9Y6d_Btp4xp6mZswjXp6v6Ic5Acdwb72JxgcoOeaRfn.QnVT_ebtzyyd9k0lfuMA2KxbGuTHRv5P3g" consumerSecret="908013318579650535" doc:name="Salesforce (OAuth)" name="Salesforce__OAuth_">
<sfdc:oauth-callback-config domain="localhost" localPort="8081" path="oauth2callback"/>
</sfdc:config-with-oauth>
<http:listener-config doc:name="HTTP Listener Configuration" host="0.0.0.0" name="HTTP_Listener_Configuration" port="8082"/>
<http:request-config name="HTTP_Request_Configuration" protocol="HTTPS" host="https://ap1.salesforce.com" port="443" basePath="services/apexrest/FieldCase" doc:name="HTTP Request Configuration"/>
<flow name="salesforce-oauthFlow1">
<http:listener config-ref="HTTP_Listener_Configuration" doc:name="HTTP" path="/"/>
<sfdc:authorize accessTokenUrl="https://na1.salesforce.com/services/oauth2/token" authorizationUrl="https://na1.salesforce.com/services/oauth2/authorize" config-ref="Salesforce__OAuth_" display="PAGE" doc:name="Authorize at Salesforce"/>
<response>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</response>
<http:request config-ref="HTTP_Request_Configuration" path="/" method="GET" doc:name="HTTP"/>
</flow>
但我收到错误信息
消息:发送HTTP请求时出错。消息有效内容的类型为NullPayload
代码:MULE_ERROR - 2
答案 0 :(得分:0)
由于您使用的是GET,我发现此问题有点令人困惑。然而,它可能依赖于有效负载,并且您似乎将有效负载设置为记录器的返回,我猜这是空的。为什么你有这个?
删除它,然后记录。或者将有效负载设置为空字符串,例如