有人可以向我展示一个如何创建 mule 流以将请求发送到 https 服务的小示例吗?我尝试这样做,但出现以下错误:
INFO 2012-09-21 21:40:40,980 [[myapp_kareo].connector.http.mule.default.receiver.02] org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest: Content-Type not set on outgoing request, defaulting to: text/plain
WARN 2012-09-21 21:40:41,081 [[myapp_kareo].connector.http.mule.default.receiver.02] org.mule.transformer.simple.ObjectToString: Could not close stream
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
at java.io.BufferedInputStream.read(BufferedInputStream.java:308) at org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLengthInputStream.java:170)
ETC...
我至少看到两件奇怪的事情:
org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest
: Content-Type 未在传出请求上设置,默认为:text/plain - 我不知道从哪里得到这个,所有端点上的内容类型都设置为 text/xml。org.mule.transformer.simple.ObjectToString
: 无法关闭流 - 我无法解释这是从哪里来的......
我的xml配置:
<?xml version="1.0" encoding="UTF-8"?>
<https:connector name="HTTP_HTTPS" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" proxyHostname="localhost" proxyPort="80" doc:name="HTTP\HTTPS">
<https:tls-key-store path="/src/main/app/keystore/javakeystore.jks" storePassword="somepassword"/>
</https:connector>
<flow name="KareoFlow1" doc:name="KareoFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="kareo" contentType="text/xml" doc:name="SomeApp"/>
<https:outbound-endpoint exchange-pattern="request-response" host="webservice.kareo.com/" port="443" path="services/soap/2.1/KareoServices.svc" connector-ref="HTTP_HTTPS" contentType="text/xml" doc:name="Kareo"/>
<echo-component doc:name="Echo"/>
</flow>
非常感谢!