Соединение между WSO2 ESB и AM

Я хотел подключить Образец прокси-сервера здравоохранения WSO2 ESB к API Manager. Но мне не удалось соединить два продукта.


  1. Я установил 3 продукта WSO2 (APIM, ESB и AS) на один локальный компьютер (Windows 7 64bit, java7) и дал разное смещение для продукта (APIM равен 2, AS равен 1 и ESB равен 0).

  1. Я запускаю AS Server и загружаю 3 файла aar (geows-SNAPSHOT.aar, hcfacilitylocator-SNAPSHOT.aar, hcinformationservice-SNAPSHOT.aar) на AS. (Скачано с http://wso2.com/files/Service_Integration_Artifacts.zip)

  1. Я запускаю ESB Server и загрузил 1 файл автомобиля (Service_Integration_CApp_1.0.0.car) на ESB. (Скачано с http://wso2.com/files/Service_Integration_Artifacts.zip)

4.1 Когда я пытаюсь использовать POSTMAN браузера Chrome, это происходит следующим образом.

URL-адрес

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>


  1. Я добавил следующий конфиг на файл axis2.xml

    <parameter name="HostnameVerifier">AllowAll</parameter>

и запустите AM Server и добавили эту услугу на сайт издателя 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 Сохранить и опубликовать


  1. Я подписался на эту услугу на сайте магазина AM и сгенерировал маркер доступа.

  1. Я пытаюсь использовать POSTMAN браузера Chrome со следующими настройками

URL-адрес

http://172.21.100.172:8282/test/1.0.0/test

Метод

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>

Авторизация

Bearer 9970836add803ff1184d985bbb59669

Тип контента

application/xml;charset=UTF-8

  1. Наконец, я только что получил следующие сообщения в браузере 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]"

  1. Прямой вызов в ESB успешен, но использование AM не удалось. Что мне нужно сделать??? Я хочу получить следующий ответ, используя apim (не принято сообщение 202)

Я хочу следующий ответ

<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>

1 ответ

Решение

Это была моя ошибка. На шаге 5.2 я изменил как следует, и это работает!!!

5.2 На этапе реализации

Тип конечной точки

HTTP Endpoint

Производство WSDL есть

http://localhost:8280/services/HCCProxyService?wsdl
Другие вопросы по тегам