我正在尝试使用WSO2 ESB(版本4.8.1)来调用外部托管的SOAP Web服务。 为了试用它,我使用公共Web服务来获取天气信息( http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL ),更具体地说是GetWeatherInformation操作。
我使用soapUI工具成功使用了Web服务。
我是SOAP和ESB的新手,所以我尝试跟踪一些博客条目,但我一直在收到错误。 我尝试使用代理服务,有效负载工厂和发送但仍然没有管理。 有人可以帮我设置一下吗?
谢谢
I am trying to use WSO2 ESB (version 4.8.1) to invoke externally hosted SOAP web services. To try it out I was using a public web service for weather information (http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL), more specifically the GetWeatherInformation operation.
I have successfully consumed the web service using the soapUI tool.
I am a newcomer to SOAP and ESB, so I tried to follow a number of blog entries, but I keep on getting errors. I tried using proxy service, payload factory and send but still didn't manage. Can somebody please help me with setting this up?
Thanks
最满意答案
这里有一个示例API来调用GetWeatherInformation:
<?xml version="1.0" encoding="UTF-8"?> <api xmlns="http://ws.apache.org/ns/synapse" name="testws3api" context="/testws3api"> <resource methods="GET" url-mapping="/GetWeatherInformation"> <inSequence> <payloadFactory media-type="xml"> <format> <GetWeatherInformation xmlns="http://ws.cdyne.com/WeatherWS/"/> </format> <args/> </payloadFactory> <send> <endpoint> <address uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx" format="soap11"/> </endpoint> </send> </inSequence> <outSequence> <send/> </outSequence> </resource> </api>您只需向http://esb.hostname:8280 / testws3api / GetWeatherInformation发送GET http请求(使用SoapUI或在您的Internet浏览器中键入此地址),您将从Weather WS获取XML响应
Here come a sample API to invoke GetWeatherInformation :
<?xml version="1.0" encoding="UTF-8"?> <api xmlns="http://ws.apache.org/ns/synapse" name="testws3api" context="/testws3api"> <resource methods="GET" url-mapping="/GetWeatherInformation"> <inSequence> <payloadFactory media-type="xml"> <format> <GetWeatherInformation xmlns="http://ws.cdyne.com/WeatherWS/"/> </format> <args/> </payloadFactory> <send> <endpoint> <address uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx" format="soap11"/> </endpoint> </send> </inSequence> <outSequence> <send/> </outSequence> </resource> </api>You just have to send a GET http request to http://esb.hostname:8280/testws3api/GetWeatherInformation (use SoapUI or type this address in your internet browser) and you will get back the XML response from the Weather WS
更多推荐
发布评论