Java SOA Tutorials
Tutorials
Java SOAservicemix-http XBean Configuration
servicemix-http XBean Configuration
The servicemix-http components supports the XBean-based deployment. Since the servicemix-http component can be configured in both the consumer and provider roles, we have two sets of configuration parameters for the component. Let us look into the main configuration parameters:
- servicemix-http as consumer: A sample servicemix-http consumer component configuration is shown as follows:
- <http:endpoint
- endpoint="HelloWebService" soap="true" role="consumer"
- service="test:MyConsumerService" wsdlresource="http://localhost:8080/AxisEndToEnd/
- services/HelloWebService?WSDL" defaultmep="http://www.w3.org/" target="_blank" rel="nofollow"
- 2004/08/wsdl/in-out" locationuri="http://localhost:8081/services/
- HelloWebService"
- targetservice="test:IHelloWebService"></http:endpoint>
The following table gives the explanation for the main configuration parameters:
| Attribute Name | Type | Description | Mandatory or Not |
| service | QName | Service name of the proxy endpoint | Mandatory |
| endpoint | String | Endpoint name of the proxy endpoint | Mandatory |
| interfaceName | QName | Interface name of the proxy endpoint | Not Mandatory |
| targetService | QName | Service name of the target endpoint | Not Mandatory. Default is the value of the service attribute |
| targetEndpoint | String | Endpoint name of the target endpoint | Not Mandatory. Default is the value of the endpoint attribute |
| role | String | Whether a consumer or a provider | Mandatory. Value should be consumer |
| locationURI | URI | Http URL where this proxy endpoint will be exposed so that the ESB clients can access the proxy service. | Mandatory |
| defaultMEP | URI | The MEP URI by which clients interact with the consumer component | Not Mandatory |
| soap | boolean | If it is true, the component will parse the SOAP envelope and pass the contents to the NMR | Not Mandatory. Default value is false. |
| wsdlResource | Spring Resource | If it is set, the WSDL will be retrieved from this configured Spring resource. | Not Mandatory |
Thus, the locationURI attribute in the servicemix-http consumer refers to the Http URL where this proxy endpoint is exposed, so that the ESB clients can access the proxy service. Later we will look at how to generate static client stubs out of this proxy URI.
- servicemix-http as provider: While configuring the provider, there are a few aspects to be taken care of with respect to the WSDL. If we have the sample WSDL as shown as follows:
- <?xml version="1.0" encoding="UTF-8"?>
- <wsdl:definitions xmlns:impl="http://AxisEndToEnd.axis.apache.
- binildas.com" targetnamespace="http://AxisEndToEnd.axis.
- apache.binildas.com">
- <!-- other descriptions -->
- <wsdl:service name="IHelloWebService">
- <wsdl:port name="HelloWebService"
- binding="impl:HelloWebServiceSoapBinding">
- <wsdlsoap:address location="http://localhost:8080/
- AxisEndToEnd/services/HelloWebService"></wsdlsoap:address>
- </wsdl:port>
- </wsdl:service>
- </wsdl:definitions>
Now, while configuring the provider component you need to ensure that the service (IHelloWebService) and the endpoint (HelloWebService) match the service name and port elements of the WSDL that you use to correctly return the WSDL for the endpoint. Moreover, the service name will use the targetNamespace for the WSDL (http://AxisEndToEnd.axis.apache.binildas.com).
A sample servicemix-http provider component configuration is shown as follows:
- <http:endpoint endpoint="HelloWebService"
- soap="true" role="provider" service="test:IHelloWebService"
- wsdlresource="http://localhost:8080/AxisEndToEnd/
- services/HelloWebService?WSDL"
- locationuri="http://localhost:8080/AxisEndToEnd/
- services/HelloWebService" soapaction="></http:endpoint>
The following table the gives the explanation for the main configuration parameters:
| Attribute Name | Type | Description | Mandatory or Not |
| service | QName | Service name of the exposed endpoint | Mandatory |
| endpoint | String | Endpoint name of the exposed endpoint | Mandatory |
| interfaceName | QName | Interface name of the exposed endpoint | Not Mandatory |
| role | String | Whether a consumer or a provider | Mandatory. Value should be provider |
| locationURI | URI | Http URL of the target service. | Mandatory |
| Attribute Name | Type | Description | Mandatory or Not |
| soap | boolean | If it is true, the component will parse the SOAP envelope and pass the contents to the NMR | Not Mandatory. Default value is false. |
| soapAction | String | The SOAPAction header to be send over HTTP when invoking theweb service | Not Mandatory. Default value is "". |
| wsdlResource | Spring Resource | If it is set, the WSDL will be retrieved from this configured Spring resource. | Not Mandatory |
Comments
Weekly Offers
Sponsored Links
