Ce contenu n'est pas disponible dans la langue sélectionnée.
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:This yields the following message type name:package org.switchyard.example; public interface OrderService { void submitOrder(Order 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 thejava:org.switchyard.example.OrderOrderServiceinterface as shown below:This annotation can be useful if you want to maintain a tight control over the names used for message content.package org.switchyard.example; public interface OrderService { @OperationTypes(in = "{urn:switchyard-quickstart:bean-service:1.0}submitOrder") void submitOrder(String orderXML); }