|
Comments
|
Today's Top SOA Links
Workspace Send, Receive & Change
Using WorkSpace's RAD features to implement XML Transformations and Messaging
By: Ian Thain
Mar. 22, 2007 01:00 PM
Pick up any book or article on Service Oriented Architecture (SOA) and somewhere in the text will be the statement that SOA isn't about throwing away existing systems and redeveloping them, but integrating them into new SOA processes, SOA processes that are flexible enough to change through characteristics that are loosely coupled, course-grained, standards-based, business-oriented and patterns-based, as described by my colleague David Brandow in PBDJ October 2006.
Transformation Services For example my orchestration of services into a bigger business process (see Figure 1) internally uses SOAP messages that contain XML documents to send data from one service on to another and we give you all the RAD features in WorkSpace to abstract that complexity out of the equation so you can concentrate on the business problem. Transformation Services come into play when interacting with other systems or a service where you have to manipulate XML documents, enrich them with other data, and either merge or split them. Transformation Services can also take messages that aren't XML-based - custom wire formats - and transform their message definitions that can also be created in WorkSpace. From within WorkSpace select the File|New|Service option to create a new Transformation Service (see Figure 2). The wizard will let us assign an XML schema for the source data. This is probably something supplied by your collaborative partner. Click on Add Schema button next to Source schemas area. (See Figure 3.) Here we can also assign a target XML schema that the input XML data would be transformed to. The newly created transformation service is opened in an editor and when the Map Tab is selected this is where we can graphically define the mapping from input elements to the output elements of the corresponding XSDs. To do the mapping, click on each element in the source box (left) and drag the mouse over the element in the target box (right) - (see Figure 4). Under the Transformation Rule panel below the map grid is where extra XPath expressions can be built graphically. We have now completed the creation and definition of the transformation mapping for this service. The finished service map looks like this: WorkSpace has taken care of the generation of the code to transform the data efficiently. We can test the Transformation Service without deploying it to our service container by clicking on the Test tab, (see Figure 5) supplying the existing XML file, and clicking on the Test button. The mapping will be applied and the output will be displayed in the test result. Once tested, the Transformation Service can be deployed.
Subscribing to a Message Everything we need to do for this service to listen for a message is defined in the Sybase Service Page Profile. If we open the Service Package Profile and switch to the Access Configuration tab and highlight HttpTransport we can click on the Remove button (see Figure 6). We can now set up access to this service using a JMS endpoint. Doing this would result in the service subscribing to a selected message endpoint for incoming requests. Click on the Expose Service button (see Figure 7). Click the New button on the Select Transport dialog and select JMS Messaging as the transport type (see Figure 8) and click Next. Select Reference from Enterprise Explorer and click on the Browse button. Connect to your EAServer (MyAppServer) and select an existing JSM Queue as the message endpoint from the Message Transports (see Figure 9). In the WorkSpace Navigator, highlight the package, right click and choose Deploy Package to deploy the service to your MyServiceContainer connection profile, which is UO (UnWired Orchestrator). Note that the Test Service option on the service in Enterprise Explorer is only for HTTP-based services. To test a service exposed over a messaging endpoint, you'll have to create a message service that sends the input message to the same endpoint. We'll do that next.
Publishing a Message From within WorkSpace select the File|New|Service option to create a new Message Service. Select the endpoint page of the wizard and click on Next again on the endpoint name page. Select JMS on the messaging type page and click Next. Select Reference from Enterprise Explorer and click on the Browse button. Connect to MyAppServer and select an existing JMS Queue as the message endpoint (see Figure 10) and click Finish. Select the Service Interface Tab. By default a send operation has been added. Open the Operation Parameters panel. This operation has already parameter data of the String type but can be changed to a complex datatype for an XML message. Now, create a deployment package by right-clicking on the service file and deploy the service to MyServiceContainer. In the Enterprise Explorer view, expand the MyServiceContainer profile and locate the service. Right-click on the service and select the Test Service option. On this page, you will input the required values. Click the Edit button and click on Edit when the dialog is displayed (see Figure 11) Click the Add button. Move the mouse to the row and click on the button to enter values for a row. A dialog is provided to enter values for each element in the row. Add as many rows as desired. Click the OK buttons to go back to the Parameters for method page, and click the Invoke Button. A message indicating send operation executed successfully is displayed at the bottom of the page. Click Finish to exit from the Test dialog. You just created a message service that sends a message to a JMS endpoint.
Conclusion Reader Feedback: Page 1 of 1
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
|||||||||||||||||||||||||||