Exforsys.com
 
Home Tutorials Java SOA
 

servicemix-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:

 

Sponsored Links

 

  • servicemix-http as consumer: A sample servicemix-http consumer component configuration is shown as follows:

Sample Code
  1. <http:endpoint
  2. endpoint="HelloWebService" soap="true" role="consumer"
  3. service="test:MyConsumerService" wsdlresource="http://localhost:8080/AxisEndToEnd/
  4.                 services/HelloWebService?WSDL" defaultmep="http://www.w3.org/" target="_blank" rel="nofollow"
  5. 2004/08/wsdl/in-out" locationuri="http://localhost:8081/services/
  6.                 HelloWebService"
  7. targetservice="test:IHelloWebService"></http:endpoint>
  8.  
Copyright exforsys.com


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:

Sample Code
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.         <wsdl:definitions xmlns:impl="http://AxisEndToEnd.axis.apache.
  3.                 binildas.com" targetnamespace="http://AxisEndToEnd.axis.
  4.                 apache.binildas.com">
  5.         <!-- other descriptions -->
  6.         <wsdl:service name="IHelloWebService">
  7.                 <wsdl:port name="HelloWebService"
  8. binding="impl:HelloWebServiceSoapBinding">
  9.                         <wsdlsoap:address location="http://localhost:8080/
  10.                        
  11. AxisEndToEnd/services/HelloWebService"></wsdlsoap:address>
  12.                 </wsdl:port>
  13.    </wsdl:service>
  14. </wsdl:definitions>
Copyright exforsys.com


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:


Sample Code
  1. <http:endpoint endpoint="HelloWebService"
  2. soap="true" role="provider" service="test:IHelloWebService"
  3. wsdlresource="http://localhost:8080/AxisEndToEnd/
  4.                         services/HelloWebService?WSDL"
  5. locationuri="http://localhost:8080/AxisEndToEnd/
  6.                         services/HelloWebService" soapaction="></http:endpoint>
  7.  
Copyright exforsys.com


The following table the gives the explanation for the main configuration parameters:


 

Sponsored Links

 

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

Read Next: servicemix http Lightweight Configuration



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

 
 


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2010 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape