Show Table of Contents
10.6. Message Content Type Names
Since transformations occur between named types (for example, from type A to type B), it is important to understand how the type names are derived. The type of the message is determined based on the service contract, which can be WSDL or Java.
- WSDLFor WSDL interfaces, the message name is determined based on the fully-qualified element name of a WSDL message. Here is an example of a WSDL definition:
<definitions xmlns:tns="urn:switchyard-quickstart:bean-service:1.0"> <message name="submitOrder"> <part name="parameters" element="tns:submitOrder"/> </message> <portType name="OrderService"> <operation name="submitOrder"> <input message="tns:submitOrder"/> </operation> </portType> </definitions>This yields the following message type name based on the message element name defined in the WSDL:{urn:switchyard-quickstart:bean-service:1.0}submitOrder - JavaFor Java interfaces, the message name consists of the full package name and the class name prefixed with "
java:". Here is an example of a Java definition:package org.switchyard.example; public interface OrderService { void submitOrder(Order order); }This yields the following message type name:java:org.switchyard.example.Order
You may override the default operation name generated for a Java interface. The @OperationTypes annotation provides this capability by allowing you to specify the input, output, and fault type names used for a Java service interface. For example, if you want to accept XML input content without any need for transformation to a Java object model, you can change theOrderServiceinterface as shown below:package org.switchyard.example; public interface OrderService { @OperationTypes(in = "{urn:switchyard-quickstart:bean-service:1.0}submitOrder") void submitOrder(String orderXML); }This annotation can be useful if you want to maintain a tight control over the names used for message content.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.