URLを入力としてhttpインバウンドエンドポイントにある基本サービスコンポーネントを作成しています。 IによりHTTP応答(ペイロード)を受信することを望むMuleからHTTP応答を受信できません
public Object onCall(MuleEventContext eventContext) throws Exception {
MuleMessage msg = eventContext.getMessage();
String str = msg.getStringProperty("http.request", null);
msg.setPayload(str);
msg.setStringProperty("http.status","200");
msg.setStringProperty("Content-Type","text/html");
System.out.println("Reached here:" + str);
return msg;
}
:
<service name="follow">
<inbound>
<http:inbound-endpoint address="http://localhost:8765/follow/" synchronous="true"/>
</inbound>
<component class="org.mule.application.mytwitter.Follow" />
</service>
とJavaコンポーネントクラスから呼び出される関数は、以下のようにラバ-configファイルからコードスニペットであります
としてCURLを通じてサービスを打ちますカール-vv "します。http:// localhost:8765//追跡"
> * About to connect() to localhost port 8765 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 8765 (#0)
> GET /follow/ HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: localhost:8765
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/plain
< Date: Tue, 27 Dec 2011 03:14:00 IST
< Server: Mule Core/2.1.2
< Expires: Tue, 27 Dec 2011 03:14:00 IST
< Content-Length: 0
< Connection: close
<
* Closing connection #0
私は何かが欠け午前:
が、私は、任意のペイロードを受信していませんよ?コンポーネントクラスの関数が呼び出され、出力がコンソールに出力されます。
正確に達成しようとしているのは何ですか? –
コンソールには何が入っていますか? 「ここにたどり着いたのは何ですか?」 –