2017-01-25 1 views
0

이 자습서에 제공된 단계를 수행했습니다. WSO2 ESB를 통해 API 요청을하는 방법

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

나는 또한 ... 여기 내 구성을 예 있었나요 : 고마웠다 엔드 포인트 정의 (오른쪽 예 -> 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> 

기다립니다 : (내 오프셋 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 
관련 문제