此内容没有您所选择的语言版本。

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.
  • WSDL
    For 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>
    
    Copy to Clipboard Toggle word wrap
    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
    
    Copy to Clipboard Toggle word wrap
  • Java
    For 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);
    }
    
    Copy to Clipboard Toggle word wrap
    This yields the following message type name:
    java:org.switchyard.example.Order
    
    Copy to Clipboard Toggle word wrap
    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 the OrderService interface as shown below:
    package org.switchyard.example;
    public interface OrderService {
        @OperationTypes(in = "{urn:switchyard-quickstart:bean-service:1.0}submitOrder")
        void submitOrder(String orderXML);
    }
    Copy to Clipboard Toggle word wrap
    This annotation can be useful if you want to maintain a tight control over the names used for message content.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat