WebSphere

Example: Creating a ServiceMessageObject object

This example shows you how to create a new ServiceMessageObject object inside a Custom Mediation primitive.

Context

The following code sample shows you how to create a new ServiceMessageObject object inside a Custom Mediation primitive. The Custom Mediation primitive is used to replace the incoming DataObject object.

Requirements

You must know how to set up a mediation flow with a Custom Mediation primitive.

Java imports

import javax.xml.namespace.QName; 
import com.ibm.websphere.sibx.smobo.ServiceMessageObject; 
import com.ibm.websphere.sibx.smobo.ServiceMessageObjectFactory;

Code sample

. 
. 
. 
QName qName = new QName("http://Examples/Interface", "Operation1RequestMsg"); 
ServiceMessageObjectFactory smoFactory = ServiceMessageObjectFactory.eINSTANCE; 
ServiceMessageObject smo = smoFactory.createServiceMessageObject(qName);
This code sample creates a new ServiceMessageObject object with empty headers and a business object for the body. An exception occurs if the code sample fails.

Further information

The Custom Mediation primitive can output a different ServiceMessageObject object. For example, a value in the input ServiceMessageObject object indicates that a different ServiceMessageObject object should be returned.
To create the QName object, the user must import javax.xml.namespace.QName. The new QName object must have two arguments, which can be found in the interface WSDL file. The first is the namespace URI, which is the value for xmlns:tns in the wsdl:definitions line. The second is either the input or the output, which is the value for the message in the wsdl:input or wsdl:output.

reference Reference topic

Terms of use | Feedback


Timestamp icon Last updated: 20 June 2010 00:39:51 BST (DRAFT)


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.wbit.help.medprim620.doc/ref/example_newSMO.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).
iDoc on