CentraSite Documentation : Runtime Governance with CentraSite : Important Considerations when Configuring SOAP-based Virtual Services : Handling Services with Multiple Ports and Bindings : Workaround Option 2
Workaround Option 2
With this option, you expose the native service as one virtual service. The web service client will access the service through one address to the virtual service for all the possible operations (ping and getXXX ). The virtual service then takes care of routing to the correct endpoint for the different operations. This is accomplished by using “Content-based” routing (instead of “Straight Through” routing) to determine the operation being called (based on the SOAP request content) and then forwarding the request to the correct endpoint.
To create a virtual service with "Content-based" routing
1. Create a virtual service for the native service CustomerRefService and name it VS_CustomerRefService, for example.
2. Configure VS_CustomerRefService and configure its routing protocol as "Content-based".
3. On the Routing Protocols tab, construct the routing rule as follows:
a. Click the Endpoint button (next to the Route To column).
b. In the Search for Endpoint dialog that appears, click the Search button to search for the Web service endpoint to route the requests to.
c. Select http://... /v4/SystemPort (the Accessing URI that goes to ping operation).
d. To create an XPath expression for the routing rule, click the Edit button (next to the If True column).
e. In the XPath Editor that appears, click the All Nodes tab, expand the namespace's node, click to highlight the tns:ping element, and click OK
f. Double check that you have something like this in the rule and it is routed to SystemPort:
/soapenv:Envelope/soapenv:Body/tns:pingRequest
4. Set the Default To routing field to the routing address http://... /v4/CustomerRefPort (for CustomerBinding, where getXXX operations are supported).
5. On the virtual service's Summary profile, click on the URL for the WSDL (this a copy of the virtual service template WSDL, very similar to the original native service WSDL) and download/save it to your local file system.
(Make an additional copy of this downloaded WSDL in case you make a mistake in your editing.)
6. Modify the WSDL as follows and then save it:
a. Copy the ping operation from SystemPortType and add into CustomerPortType.
b. Delete the SystemPortType. The objective here is to make one port type only.
c. Update the SystemBinding to also refer to CustomerPortType, since SystemPortType has been deleted.
Note:  
The soapAction attribute must be specified for the soap:operation element to ensure that Mediator can resolve the operation being invoked for this service.
d. Save the WSDL.
Note:  
Make sure your browser or XML tool can read this modified WSDL without any syntax error.
7. Attach the modified WSDL file to the virtual service by selecting the Attach WSDL command in the virtual service's Actions menu.
8. Deploy the virtual service to Mediator.
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback