This content has been marked as final.
Show 1 reply
-
1. Re: Expose service via web service
kw_richards Nov 18, 2008 5:09 PM (in response to kw_richards)I found the answer to the question, and it's actually fairly obvious (once you reach 12 at night)
The trick is in using ServiceInvoker from within the webservice.
Define the jboss-esb.xml as follows (I.e. expose a web service as per quickstart webservice_producer)... <service category="OrderProcessor" name="EquipmentOrderInterface" description="Process Equipment orders"> <listeners> <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true"/> </listeners> <actions> <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor"> <property name="jbossws-endpoint" value="processEquipmentOrder"/> </action> </actions> </service> <service category="OrderProcessor" name="EquipmentOrderImpl" description="Process Equipment orders"> <actions> <action name="validate" class="com.example.ValidateOrder"/> <action name="calculateOrder" class="com.example.CalculateOrder"/> </actions> </service>
Then write the webservice as follows (using the QuickStart webservice_producer as a general guideline)public class OrderProcessorWS { public OrderResult processEquipmentOrder (Order orderDetail) { ServiceInvoker service= new ServiceInvoker("OrderProcessor", "EquipmentOrderImpl"); Message reqMsg= MessageFactory.getInstance().getMessage(); reqMsg.getBody().add( orderDetail); Message respMsg= service.deliverSync( reqMsg, 50000); return (OrderResult)respMsg.getBody().get(); } }
Now you've effectively "wrapped" your esb service in a web service.