我想將WSO2 ESB的Health Care Proxy Sample連接到API Manager。 但我未能連接兩個產品。WSO2 ESB和AM之間的連接
- 我安裝3 WSO2產物(APIM,ESB和AS)在一個本地機器(64位Windows 7,java7)並給了不同的每個產品偏移(APIM是2,AS是1和ESB是0 )。
- 我運行AS服務器和上傳3 AAR文件(geows-SNAPSHOT.aar,hcfacilitylocator-SNAPSHOT.aar,hcinformationservice-SNAPSHOT.aar)上AS。 (從http://wso2.com/files/Service_Integration_Artifacts.zip下載)
- 我運行ESB服務器和ESB上傳1個汽車文件(Service_Integration_CApp_1.0.0.car)。 (從http://wso2.com/files/Service_Integration_Artifacts.zip下載)
我添加以下上axis2.xml文件配置
<parameter name="HostnameVerifier">AllowAll</parameter>
- 我訂閱對AM的商店網站此服務,並且生成的accessToken。
- 我嘗試使用鉻瀏覽器的郵差用以下設置
最後,我只能按照鉻瀏覽器
202消息接受
- 到ESB直接呼叫是成功的,但使用AM失敗。我需要做什麼? 我想用APIM得到如下回應(不是202接受消息)
4.1當我嘗試使用Chrome瀏覽器的郵遞員,它成功像以下。
網址是
http://localhost:8280/services/HCCProxyService
方法
GET
我添加了兩個頭
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>
並運行AM服務器,並通過以下步驟在AM的發佈商網站上添加此服務。 5。1在設計步驟 上下文名稱是
test
URL模式是 test
選擇的兩個方法是
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保存&發佈
URL是
http://172.21.100.172:8282/test/1.0.0/test
方法是
GET
我加ED兩個頭
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
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]"
我想下面的響應
<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>