LibraryToggle FramesPrintFeedback

Consumer endpoints play the role of consumer from the vantage point of other endpoints running inside of the ESB. However, from outside of the ESB a consumer endpoint plays the role of a service provider. As shown in Figure 9.1, consumer endpoints listen from incoming requests from external endpoints. When it receives a request, the consumer passes it off to the NMR fro delivery to endpoint that will process the request. If a response is generated, the consumer endpoint delivers the response back to the external endpoint.


[Important]Important

Because consumer endpoint's behave like service providers to external endpoints, you configure the runtime behavior of the transport using the provider-specific WSDL entries.

To configure a consumer endpoint do the following:

  1. Add a consumer element to your xbean.xml file.

  2. Add a wsdl attribute to the consumer element.

    See Specifying the WSDL.

  3. If your WSDL defines more than one service, you will need to specify a value for the service attribute.

    See Specifying the endpoint details.

  4. If the service you choose defines more than one endpoint, you will need to specify a value for the endpoint attribute.

    See Specifying the endpoint details.

  5. Specify the details for the target of the requests received by the endpoint.

    See Specifying the target endpoint.

  6. If your endpoint is going to be receiving binary attachments set its mtomEnabled attribute to true.

    See Using MTOM to Process Binary Content.

  7. If your endpoint does not need to process the JBI wrapper set its useJbiWrapper attribute to false.

    See Working with the JBI Wrapper.

  8. If you are using any of the advanced features, such as WS-Addressing or WS-Policy, specify a value for the busCfg attribute.

    See Part III.

If the endpoint's WSDL document defines a single service with a single endpoint, the ESB can easily determine which endpoint to use. It will use the values from the WSDL document to specify the service name, endpoint name and interface name for the instantiated endpoint.

However, if the endpoint's WSDL document defines multiple services or if it defines multiple endpoints for a service, you will need to provide the consumer endpoint with additional information so that it can determine the proper definition to use. What information you need to provide depends on the complexity of the WSDL document. You may need to supply values for both the service name and the endpoint name, or you may only have to supply one of these values.

If the WSDL document contains more than one service element you will need to specify a value for the consumer's service attribute. The value of the consumer's service attribute is the QName of the WSDL service element that defines the desired service in the WSDL document. For example, if you wanted your endpoint to use the WidgetSalesService in the WSDL shown in Example 9.2 you would use the configuration shown in Example 9.3.



If the WSDL document's service definition contains more than one endpoint, then you will need to provide a value for the consumer's endpoint attribute. The value of the endpoint attribute corresponds to the value of the WSDL port element's name attribute. For example, if you wanted your endpoint to use the WidgetEasternSalesPort in the WSDL shown in Example 9.4 you would use the configuration shown in Example 9.5.



Comments powered by Disqus
loading table of contents...