WS02:从ESB调用外部天气SOAP Web服务(WS02: Invoking external weather SOAP webservice from ESB)

编程入门 行业动态 更新时间:2024-10-26 15:15:09
WS02:从ESB调用外部天气SOAP Web服务(WS02: Invoking external weather SOAP webservice from ESB)

我正在尝试使用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

更多推荐

本文发布于:2023-08-03 15:13:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1395124.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:天气   SOAP   ESB   Web   weather

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!