Mule Release Call WebService

Source: Internet
Author: User
Tags mule esb wsdl

Mule released WebService

Using the Mule ESB message bus to publish and call WebService is very streamlined, mule wraps all the operations, you only need to drag the control configuration can be, the following explanation mule released:

1. The following is the Flow,http listener interface, CXF publishes Webservice,java methods used to refer to WebService.

The 2.xml code is as follows:

<flow name= "WebService" > 

The 3.java code is as follows:

①impl Implementation Class

Package Com.test;import Javax.jws.WebService; @WebService (endpointinterface = "Com.test.HelloWorld", ServiceName = " HelloWorld ") public class Helloworldimpl implements helloworld{@Overridepublic string Sayhi (string text) {//TODO  Auto-generated method Stubreturn "Hello" + text; }}

②impl Implementation Class

Package Com.test;import Javax.jws.WebService; @WebService (endpointinterface = "Com.test.HelloWorld", ServiceName = " HelloWorld ") public class Helloworldimpl implements helloworld{@Overridepublic string Sayhi (string text) {//TODO  Auto-generated method Stubreturn "Hello" + text; }}

The 4.Java control references class Name:com.test.HelloWorldImpl.


To enable the Mule service, access the HTTP://LOCALHOST:8080/API/HELLO?WSDL results as follows:

At this point, the publication succeeds.


Mule Request WebService

Using the Mule ESB to request WebService is very simple, just use the web Service consumer control, and the following explains the request WebService:

1. The following is the FLOW,HTTP request listener interface, WEB Service consumer call interface, Set payload pass parameters.

2. Request WebService need to use a tool to assemble the requested Body:soapui-5.2.1.exe, download the link in the attachment, using the following method:

We only need to <soap:Body> inside parameters, we need to paste xmlns:web= "http://Mozi.com/Webservices/" into the <web:PostPatientRequest> request, As follows:

<web:postpatientrequest xmlns:web= "" >http://mozi.com/webservices/">

<!--Optional:? Inside is your parameter--

<web:requestContent>?</web:requestContent>

</web:PostPatientRequest>

The 3.xml code is as follows:

  

At this point, request WebService published successfully!

Mule Release Call WebService

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.