WSO2 ESB の Health Care Proxy Sample を API Manager に接続したいと考えました。しかし、2つの製品を接続できませんでした。
- 1 台のローカル マシン (Windows 7 64 ビット、java7) に 3 つの WSO2 製品 (APIM、ESB、および AS) をインストールし、製品ごとに異なるオフセットを指定しました (APIM は 2、AS は 1、ESB は 0)。
- AS サーバーを実行し、AS に 3 つの aar ファイル (geows-SNAPSHOT.aar、hcfacilitylocator-SNAPSHOT.aar、hcinformationservice-SNAPSHOT.aar) をアップロードしました。( http://wso2.com/files/Service_Integration_Artifacts.zipからダウンロード)
- ESB サーバーを実行し、1 つの車のファイル (Service_Integration_CApp_1.0.0.car) を ESB にアップロードしました。( http://wso2.com/files/Service_Integration_Artifacts.zipからダウンロード)
4.1 chromeブラウザのPOSTMANを使ってみると以下のように成功します。
URLは
http://localhost:8280/services/HCCProxyService
方法は
GET
ヘッダーを2つ追加しました
SOAPAction
SOAPMessage
SOAPAction の値は getHealthcareCenterInfo です
SOAPMessage の値は<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:heal="http://healthcare.wso2"><soapenv:Header></soapenv:Header><soapenv:Body><heal:getHealthcareCenterInfo><!--Optional:--><heal:longitude>3</heal:longitude><!--Optional:--><heal:latitude>4</heal:latitude></heal:getHealthcareCenterInfo></soapenv:Body> </soapenv:Envelope>
私は次の応答を得ました
<ns:getHCCenterInfoResponse
xmlns:ns="http://healthcare.wso2">
<ns:return
xmlns:ax2460="http://healthcare.wso2/xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax2460:HCInfo">
<ax2460:address>2285 North Central Avenue</ax2460:address>
<ax2460:approxDistance>1.5</ax2460:approxDistance>
<ax2460:city>Kissimmee, FL</ax2460:city>
<ax2460:hcCenterName>QKissimmee CBOC</ax2460:hcCenterName>
<ax2460:phone>407-518-5004</ax2460:phone>
</ns:return>
axis2.xml ファイルに次の構成を追加しました
<parameter name="HostnameVerifier">AllowAll</parameter>
AM Server を実行し、次の手順で AM の発行者サイトにこのサービスを追加しました。5.1 設計段階では コンテキスト名は
test
URL パターンは
test
選択された2つの方法は
GET
、OPTIONS
5.2 実装ステップで
エンドポイントのタイプは
WSDL Endpoint
プロダクション WSDL は
http://localhost:8280/services/HCCProxyService?wsdl
サービスは
HCCProxyService
ポートは
HCCProxyServiceHttpsSoap11Endpoint
5.3 管理ステップで
層の可用性は
Bronze
、Gold
、Silver
、Unlimited
輸送は
HTTP
、HTTPS
5.4 保存して公開する
- AMのストアサイトでこのサービスを申し込み、アクセストークンを生成しました。
- 以下の設定でchromeブラウザのPOSTMANを使ってみます
URLは
http://172.21.100.172:8282/test/1.0.0/test
方法は
GET
ヘッダーを2つ追加しました
SOAPAction
SOAPMessage
SOAPAction の値は getHealthcareCenterInfo です
SOAPMessage の値は<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:heal="http://healthcare.wso2"><soapenv:Header></soapenv:Header><soapenv:Body><heal:getHealthcareCenterInfo><!--Optional:--><heal:longitude>3</heal:longitude><!--Optional:--><heal:latitude>4</heal:latitude></heal:getHealthcareCenterInfo></soapenv:Body> </soapenv:Envelope>
認可は
Bearer 9970836add803ff1184d985bbb59669
コンテンツタイプは
application/xml;charset=UTF-8
最後に、Chromeブラウザで次のメッセージを受け取りました
202 承認済み
ESB ログは次のとおりです。
[2015-02-11 15:07:48,691] DEBUG - wire >> "POST /services/HCCProxyService.HCCProxyServiceHttpsSoap11Endpoint HTTP/1.1[\r][\n]"
[2015-02-11 15:07:48,692] DEBUG - wire >> "Accept-Language: ko,en;q=0.8,ja;q=0.6,en-US;q=0.4[\r][\n]"
[2015-02-11 15:07:48,692] DEBUG - wire >> "Cookie: JSESSIONID=939D5BC8522D01F309A237606C5F343F[\r][\n]"
[2015-02-11 15:07:48,692] DEBUG - wire >> "Accept-Encoding: gzip, deflate, sdch[\r][\n]"
[2015-02-11 15:07:48,692] DEBUG - wire >> "SOAPMessage: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:heal="http://healthcare.wso2"> <soapenv:Header></soapenv:He
ader> <soapenv:Body> <heal:getHealthcareCenterInfo> <!--Optional:--> <heal:longitude>3</heal:longitude> <!--Optional:--> <heal:latitude>4</heal:latitude>
</heal:getHealthcareCenterInfo> </soapenv:Body> </soapenv:Envelope>[\r][\n]"
[2015-02-11 15:07:48,692] DEBUG - wire >> "Content-Type: text/xml[\r][\n]"
[2015-02-11 15:07:48,693] DEBUG - wire >> "Accept: application/xml[\r][\n]"
[2015-02-11 15:07:48,693] DEBUG - wire >> "Cache-Control: no-cache[\r][\n]"
[2015-02-11 15:07:48,694] DEBUG - wire >> "SOAPAction: "getHealthcareCenterInfo"[\r][\n]"
[2015-02-11 15:07:48,694] DEBUG - wire >> "Host: jonghwa79lee2:8243[\r][\n]"
[2015-02-11 15:07:48,694] DEBUG - wire >> "Connection: Keep-Alive[\r][\n]"
[2015-02-11 15:07:48,694] DEBUG - wire >> "User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]"
[2015-02-11 15:07:48,694] DEBUG - wire >> "[\r][\n]"
[2015-02-11 15:07:48,695] DEBUG - headers http-incoming-18 >> POST /services/HCCProxyService.HCCProxyServiceHttpsSoap11Endpoint HTTP/1.1
[2015-02-11 15:07:48,695] DEBUG - headers http-incoming-18 >> Accept-Language: ko,en;q=0.8,ja;q=0.6,en-US;q=0.4
[2015-02-11 15:07:48,696] DEBUG - headers http-incoming-18 >> Cookie: JSESSIONID=939D5BC8522D01F309A237606C5F343F
[2015-02-11 15:07:48,696] DEBUG - headers http-incoming-18 >> Accept-Encoding: gzip, deflate, sdch
[2015-02-11 15:07:48,696] DEBUG - headers http-incoming-18 >> SOAPMessage: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:heal="http://healthcare.wso2"> <soapenv:
Header></soapenv:Header> <soapenv:Body> <heal:getHealthcareCenterInfo> <!--Optional:--> <heal:longitude>3</heal:longitude> <!--Optional:--> <heal:latitude>
4</heal:latitude> </heal:getHealthcareCenterInfo> </soapenv:Body> </soapenv:Envelope>
[2015-02-11 15:07:48,697] DEBUG - headers http-incoming-18 >> Content-Type: text/xml
[2015-02-11 15:07:48,697] DEBUG - headers http-incoming-18 >> Accept: application/xml
[2015-02-11 15:07:48,697] DEBUG - headers http-incoming-18 >> Cache-Control: no-cache
[2015-02-11 15:07:48,698] DEBUG - headers http-incoming-18 >> SOAPAction: "getHealthcareCenterInfo"
[2015-02-11 15:07:48,698] DEBUG - headers http-incoming-18 >> Host: jonghwa79lee2:8243
[2015-02-11 15:07:48,698] DEBUG - headers http-incoming-18 >> Connection: Keep-Alive
[2015-02-11 15:07:48,698] DEBUG - headers http-incoming-18 >> User-Agent: Synapse-PT-HttpComponents-NIO
[2015-02-11 15:07:48,709] ERROR - RelayUtils Error while building Passthrough stream
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: ?덇린移??딆? ?뚯씪???앹엯?덈떎.
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBuilder(AbstractOMMetaFactory.java:73)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder(AbstractOMMetaFactory.java:79)
at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLBuilderFactory.java:196)
at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:55)
at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:118)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:107)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:82)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:166)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:411)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: ?덇린移??딆? ?뚯씪???앹엯?덈떎.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:598)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.SJSXPStreamReaderWrapper.next(SJSXPStreamReaderWrapper.java:138)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 20 more
[2015-02-11 15:07:48,731] ERROR - SequenceMediator Error while building message
org.apache.axis2.AxisFault: Error while building Passthrough stream
at org.apache.synapse.transport.passthru.util.RelayUtils.handleException(RelayUtils.java:236)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:111)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:82)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:166)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:411)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: ?덇린移??딆? ?뚯씪???앹엯?덈떎.
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBuilder(AbstractOMMetaFactory.java:73)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder(AbstractOMMetaFactory.java:79)
at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLBuilderFactory.java:196)
at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:55)
at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:118)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:107)
... 12 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: ?덇린移??딆? ?뚯씪???앹엯?덈떎.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:598)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.SJSXPStreamReaderWrapper.next(SJSXPStreamReaderWrapper.java:138)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 20 more
[2015-02-11 15:07:48,737] DEBUG - headers http-incoming-18 << HTTP/1.1 202 Accepted
[2015-02-11 15:07:48,737] DEBUG - headers http-incoming-18 << Date: Wed, 11 Feb 2015 06:07:48 GMT
[2015-02-11 15:07:48,737] DEBUG - headers http-incoming-18 << Server: WSO2-PassThrough-HTTP
[2015-02-11 15:07:48,737] DEBUG - headers http-incoming-18 << Transfer-Encoding: chunked
[2015-02-11 15:07:48,738] DEBUG - headers http-incoming-18 << Connection: Keep-Alive
[2015-02-11 15:07:48,738] DEBUG - wire << "HTTP/1.1 202 Accepted[\r][\n]"
[2015-02-11 15:07:48,738] DEBUG - wire << "Date: Wed, 11 Feb 2015 06:07:48 GMT[\r][\n]"
[2015-02-11 15:07:48,738] DEBUG - wire << "Server: WSO2-PassThrough-HTTP[\r][\n]"
[2015-02-11 15:07:48,739] DEBUG - wire << "Transfer-Encoding: chunked[\r][\n]"
[2015-02-11 15:07:48,739] DEBUG - wire << "Connection: Keep-Alive[\r][\n]"
[2015-02-11 15:07:48,739] DEBUG - wire << "[\r][\n]"
[2015-02-11 15:07:48,740] DEBUG - wire << "0[\r][\n]"
[2015-02-11 15:07:48,740] DEBUG - wire << "[\r][\n]"
- ESB への直接呼び出しは成功しますが、AM の使用は失敗します。私がしなければならないこと??? apim を使用して次の応答を取得したい (202 Accepted Message ではありません)
私は次の応答をしたい
<ns:getHCCenterInfoResponse
xmlns:ns="http://healthcare.wso2">
<ns:return
xmlns:ax2460="http://healthcare.wso2/xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax2460:HCInfo">
<ax2460:address>2285 North Central Avenue</ax2460:address>
<ax2460:approxDistance>1.5</ax2460:approxDistance>
<ax2460:city>Kissimmee, FL</ax2460:city>
<ax2460:hcCenterName>QKissimmee CBOC</ax2460:hcCenterName>
<ax2460:phone>407-518-5004</ax2460:phone>
</ns:return>