Aeai esb-ESB-based Web services development

Source: Internet
Author: User
Tags soapui


1.Overview

Web Services are a common solution for ESB middleware, which enables different applications running on different machines to exchange data or integrations without the help of additional, specialized third-party software or hardware. applications that are implemented according to the WEB Service specification can exchange data with each other, regardless of the language, platform, or internal protocol they are using.

Aeaiesb provides a very convenient way to create a service, this document is mainly for the reader to explain how to use the ESB to create a simple Web service interface.

2.Sample Example
    • To create the WebService service in the WS directory right click on "Create web service ", such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4D/0F/wKioL1RJ_pnguw51AABVkwwVOww983.jpg "title=" 11.png "alt=" Wkiol1rj_pnguw51aabvkwwvoww983.jpg "/>


    • Configure the Web Service Wizard service name fill in "HelloWorld"and click Finish.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4D/0E/wKiom1RJ_ozDjRMQAADTIb1mc7Q161.jpg "title=" 22.png "alt=" Wkiom1rj_ozdjrmqaadtib1mc7q161.jpg "/>

    • Service Design Right click "Add Action ", the action name fill "SayHello", enter the parameter name to words, in the operation name right click "Binding Process " , select Quick Start folder. Ctrl + S saves the service configuration.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4D/0E/wKiom1RJ_sGCRlmRAACBGSSw3z4154.jpg "title=" 33.png "alt=" Wkiom1rj_sgcrlmraacbgssw3z4154.jpg "/>

    • Initialize Web service right -HelloWorld the service name and click "Initialize Web service ".

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4D/0E/wKiom1RJ_uXQflsqAAChUmejdnY997.jpg "title=" 44.png "alt=" Wkiom1rj_uxqflsqaachumejdny997.jpg "/>

    • Process Design The bundled message flow can be found in the Quick Start folder, as shown in the process design:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/0E/wKiom1RJ_wvT5fF_AABA8vA6JWo798.jpg "title=" 55.png "alt=" Wkiom1rj_wvt5ff_aaba8va6jwo798.jpg "/>

    • write the output text " Inside Code

Package Com.aeai.demo.messageflows.helloworldsayhello;

importCom.agileai.esb.component.invoker.InvokerService;

importcom.agileai.esb.core.AdapteException;

import Com.agileai.esb.core.AttributeMap;

importCom.aeai.demo.services.helloworld.SayHello;

importcom.aeai.demo.services.helloworld.SayHelloResponse;

Public class JavaInvoker3 extends invokerservice{

Public SayHello Getrequest () {

AttributeMap sourcereq = (attributemap)this. Getmessageflow (). Getrequest ();

return (SayHello) Sourcereq.get ("Soapreqobject");

}

Public Sayhelloresponse GetResponse () {

AttributeMap sourcersp = (attributemap)this. Getmessageflow (). GetResponse ();

return (sayhelloresponse) Sourcersp.get ("Soaprspobject");

}

Public void Invoke () throws adapteexception{

String words =getrequest (). Getwords ();

GetResponse (). Setreturn ("Say:" + words);

}

}

    • Deploy message Flow Right-click the service name and tap deploy Web Services .

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/0F/wKioL1RJ_97yU_qOAAC0rRgIDwo792.jpg "title=" 66.png "alt=" Wkiol1rj_97yu_qoaac0rrgidwo792.jpg "/>

    • Test Web Services We use the SoapUI tool here to test WebService, launch SoapUI, and the interface looks like this:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/0F/wKioL1RKAAeh__O_AAB-SYfqNa0458.jpg "title=" 00.png "alt=" Wkiol1rkaaeh__o_aab-syfqna0458.jpg "/>

    • Configure SoapUI new SoapUI project, paste the Web service address into the Initialwsdl/wadl box in the pop-up box , and click OK"is complete.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/0F/wKioL1RKADDzmJtyAAHt9WmNXbw336.jpg "title=" 88.png "alt=" Wkiol1rkaddzmjtyaaht9wmnxbw336.jpg "/>

    • Execution The Web service selects the SayHello action in project , resolves the contents of the SOAP envelope, and the parameter words Fill in "Hello!" ", click Execute 650) this.width=650;" Src= "http://s3.51cto.com/wyfs02/M01/4D/0E/ Wkiom1rkaasqwokoaaad9dez4pu424.jpg "title=" Anniu.png "alt=" wkiom1rkaasqwokoaaad9dez4pu424.jpg "/>" button, right back the Web service return value.


Aeai esb-ESB-based Web services development documentation Download

This article is from the "Digital unobstructed portal Integration Platform" blog, please be sure to keep this source http://aeaiportal.blog.51cto.com/9300497/1567590

Aeai esb-ESB-based Web services development

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.