2017-01-25 15 views
0

このチュートリアルの手順を実行しました。WSO2でAPIリクエストを作成する方法ESB

https://docs.wso2.com/display/ESB500/Sending+a+Simple+Message

すべてを正しくなかったが、私は(8280ポートを介して)ESBを通じてAPIを呼び出すためにしようとしていたときに、エラーコード202が表示されます。私はフォールトシーケンスを指定していませんが。

私は各ステップを正しく試しました。また、apiのエンドポイントが正しく動作することを確認しました。

+0

を持っています。 http://mytecheye.blogspot.com/2013/09/wso2-esb-all-about-wire-logs.html – Pubci

+0

他人があなたに手伝ってもらうために、あなたがしたことを正しく説明してください。 – Bee

答えて

1

私も...ここにあなたが私の設定を持っていた例: --theエンドポイント定義を(右例 - > endpoint->作成新しいエンドポイントを超えるクリック) -

<endpoint name="QueryDoctorEP" xmlns="http://ws.apache.org/ns/synapse"> 
    <http method="get" uri-template="http://wso2training-restsamples.wso2apps.com/healthcare/{uri.var.category}"/> 
</endpoint> 

を - 私のAPI定義(例 - > API REST-以上右クリック>新しいAPI休息を作成します)

<?xml version="1.0" encoding="UTF-8"?> 
<api context="/healthcare" name="HealthcareAPI" xmlns="http://ws.apache.org/ns/synapse"> 
    <resource methods="GET" uri-template="/querydoctor/{category}"> 
     <inSequence> 
      <log description="Request Log" level="custom"> 
       <property name="message" value="Welcome to HealthcareService"/> 
      </log> 
      <send> 
       <endpoint key="QueryDoctorEP"/> 
      </send> 
     </inSequence> 
     <outSequence> 
      <send/> 
     </outSequence> 
     <faultSequence/> 
    </resource> 
</api> 

待ちサーバーが構成を展開するまで... 要求:

0123(私のオフセットが3です)ここで
curl -v http://localhost:8283/healthcare/querydoctor/surgery 

あなたは、ワイヤのログを有効にし、あなたの要求に何が起こるかを確認することができカール応答

About to connect() to localhost port 8283 (#0) 
* Trying 127.0.0.1... 
* connected 
* Connected to localhost (127.0.0.1) port 8283 (#0) 
> GET /healthcare/querydoctor/surgery HTTP/1.1 
> User-Agent: curl/7.25.0 (i386-pc-win32) libcurl/7.25.0 OpenSSL/0.9.8u zlib/1.2.6 libssh2/1.4.0 
> Host: localhost:8283 
> Accept: */* 
> 
< HTTP/1.1 200 OK 
< Content-Type: application/json 
< Date: Thu, 26 Jan 2017 16:00:51 GMT 
< Transfer-Encoding: chunked 
< 
[{"name":"thomas collins","hospital":"grand oak community hospital","category":"surgery","availability":"9.00 a.m - 11.00 a.m","fee":7000.0},{"name":"anne clement","hospital":"clemency 
medical center","category":"surgery","availability":"8.00 a.m - 10.00 a.m","fee":12000.0},{"name":"seth mears","hospital":"pine valley community hospital","category":"surgery","availa 
bility":"3.00 p.m - 5.00 p.m","fee":8000.0}]* Connection #0 to host localhost left intact 
* Closing connection #0 
関連する問題