2

我有一个简单的流程,它有一个 http 入站端点。我正在尝试使用 http 出站并收到以下异常。

我可以直接从 SOAP UI 使用相同的出站。但是,无法通过Mule流调用。

java.io.OptionalDataException (org.apache.commons.lang.SerializationException)

来自端点的响应...内部服务器错误,代码:500

    INFO  2014-02-17 07:16:41,234 [[updatecustomer].connector.http.mule.default.receiver.02]
     org.mule.api.processor.LoggerMessageProcessor: Logger ...in main thread
     java.io.OptionalDataException (org.apache.commons.lang.SerializationException)

希望这个原始 xml 将有助于识别问题。

来自 SOAP UI 输入的原始 XML:

    POST http://localhost:8080/foo3 HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: ""
    Content-Length: 2044
    Host: localhost:8080
    Connection: Keep-Alive
    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

来自 SOAP UI 输出的原始 XML(直接点击端点):

    HTTP/1.1 200 OK
    Date: Tue, 18 Feb 2014 06:10:56 -0600
    Server: Mule Core/3.4.0
    Content-Type: text/xml; charset=UTF-8
    X-MULE_SESSION: sjkfsdhbbzzzxxxxxxx ....
    http.method: POST
    X-MULE_ENCODING: UTF-8
    Transfer-Encoding: chunked
    Connection: close

通过 Mule 流时来自 SOAP UI 的原始 XML:

    HTTP/1.1 500 Internal Server Error
    Content-Type: text/plain
    Date: Tue, 18 Feb 2014 06:09:49 -0600
    Server: Mule EE Core Extensions/3.4.1
    http.status: 500
    X-MULE_SESSION: sdkfasdfgsdkgfbsdfkxxxxxxxhshduiaodudyy.....
    X-MULE_ENCODING: UTF-8
    Content-Length: 78
    Connection: close
4

2 回答 2

2

尝试为 HTTP 连接器设置 NullSessionHandler:

<http:connector name="NoSessionConnector">
    <service-overrides sessionHandler="org.mule.session.NullSessionHandler" />
</http:connector>
于 2014-02-18T13:07:42.647 回答
0

This sounds like you are sending some incorrect headers or data to the outbound and it responds with 500 error. A typical problem is to use incorrect Content-Type header, so you might be missing something like <set-property propertyName="Content-Type" value="text/xml;charset=UTF-8"/> before the endpoint. Also add the soap header SOAPAction from SoapUI similarly and ensure your outbound HTTP endpoint is POST.

For debugging, I suggest you try Postman or some other simple HTTP client to get a successful response and then set the exact same headers/data in Mule. Use a logger before the outbound endpoint to ensure your message body matches the one you could use successfully in SoapUI/Postman. Also, log the HTTP response before you try to map that to anything, so you know you are not doing that with invalid data. If you have developer access to the service you are calling, see what the logs say there.

于 2014-02-18T10:31:48.913 回答