简体   繁体   中英

Consume a web service by a web service via Mule ESB

I have a web service that sends a name to a web service called sayHello(), and receives a String "Hello, name". I want to change the point-to-point connection to something like this:

web service ---> Mule ESB ---> web service

I wonder how can I do that? I've searched for a long time but I didn't find useful document on this topic. Which endpoints should I use?

Thanks.

It depends on the type of webservice you need to expose and consume:

For exposing SOAP based webservices , you can use some strategies,

1) Proxying webservices with Protocol Bridging or WSProxyService

https://docs.mulesoft.com/mule-user-guide/v/3.7/proxying-web-services

2) Proxying webservices with CXF

https://docs.mulesoft.com/mule-user-guide/v/3.7/proxying-web-services-with-cxf

3) Building a webservice with CXF

https://docs.mulesoft.com/mule-user-guide/v/3.7/building-web-services-with-cxf

For exposing RESTful webservices , you should design a RAML and then use the APIKit component

http://raml.org/

https://docs.mulesoft.com/anypoint-platform-for-apis/apikit-tutorial

For consuming SOAP based webservices , you should use the Webservice Consumer component

https://docs.mulesoft.com/mule-user-guide/v/3.7/web-service-consumer

For consuming REST webservices , you should use the HTTP Request Connector :

https://docs.mulesoft.com/mule-user-guide/v/3.7/http-request-connector

So, if you want to expose a SOAP webservice (not a proxy service), that internally consumes a SOAP webservice, you can use:

HTTPListener->CXF->WebserviceConsumer

If you want to expose a webservice proxy you can use the ProtocolBridging or CXF strategy.

If you want to expose a REST webservice, that internally consumes a REST webservice, you can use:

HTTPListener->APIKit->HTTPRequest

And so on..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM