Look at the flow in the Mule3.0 with an example

Source: Internet
Author: User
Tags wsdl

Flow is a new form of processing messages in mule3.0 that distinguishes it from previous versions of the service, but can also handle messages that can be processed in a service in a different way. Here's a Mule3.0 of Echo example to learn about flow, where you can configure inbound, outbound, component, and so on, and flow is not sure how to handle Web service calls. So we generally need a filter like CXF, because there is built-in support in CXF to understand get requests, CXF use the following syntax: http://Host/service/method/parameter name/parameters value as the following example uses: http://localhost : 65082/services/echoumo/echo/text/hello Another CXF that is configured in flow must specify his serviceclass, Configuration in the service is not required because the service can automatically find component, but the flow is not yet supported, so you have to match it before you can find component. Another place is the URL of a WS when the entry is set in the inbound, and if Exchange-pattern = "Request-response" is used, it will return the URL to us. The Mule configuration file is as follows: <?xml version= "1.0" encoding= "UTF-8"?>
<mule xmlns= "Http://www.mulesoft.org/schema/mule/core"
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
Xmlns:spring= "Http://www.springframework.org/schema/beans"
xmlns:cxf= "HTTP://WWW.MULESOFT.ORG/SCHEMA/MULE/CXF"
Xsi:schemalocation= "
Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
Http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd
HTTP://WWW.MULESOFT.ORG/SCHEMA/MULE/CXF http://www.mulesoft.org/schema/mule/cxf/3.0/mule-cxf.xsd "> < Description>
This config builds a jax-ws service with CXF.

We use a "ServiceClass" which is a JAX-WS interface we ' ve defined. It allows us
To ensure this WSDL is only generated for the ' echo ' method (as opposed
To the "other" methods on the Echocomponent). This keeps we WSDL nice
In clean-but it isn't required. To invoke the Echoumo hit the following URL-
Http://localhost:65082/services/EchoUMO/echo/text/hello

To view the WSDL for the Echoumo service go to-
http://localhost:65082/services/EchoUMO?wsdl
</description> <flow name= "Echoflow" >
<inbound-endpoint address= "Http://localhost:65082/services/EchoUMO" exchange-pattern= "Request-response"/>
<cxf:jaxws-service serviceclass= "Org.mule.example.echo.Echo"/><!--This is what you have to configure before you can find the component--> below.
<component>
<singleton-object class= "Org.mule.example.echo.Echo"/>
</component>
</flow>

The </mule> Echo class is to be published as WS based on CXF syntax rules, and its implementation is as follows:/*
* $Id: Echo.java 19191 2010-08-25 21:05:23z Tcarlson $
* --------------------------------------------------------------------------------------
* Copyright (c) Mulesoft, Inc.  All rights reserved. Http://www.mulesoft.com
*
* The software in this package is published under the terms of the Cpal v1.0
* License, a copy of which has been included with this distribution in the
* LICENSE.txt file.
* * Package Org.mule.example.echo; Import Javax.jws.WebParam;
Import Javax.jws.WebResult;
Import Javax.jws.WebService; @WebService
public class Echo
{
@WebResult (name= "text")
public string Echo (@WebParam (name= "text") string string)
{
return string;
}
The form of the above class is to indicate that the class was published as a WebService form. This article would like to explain in the simplest form the use of flow in mule3.0.

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.