3. Define the logical message used by the service
When the operation of the service is invoked, the service is defined as a message exchange. In a WSDL document, these messages are defined as message elements. These messages are made up of parts called part elements.
The operation of a service, defined by the way that a logical message is specified. When the operation is invoked, the logical message is exchanged. (That is, the logical message represents the operation of the service) these logical messages define the data that is transferred over the network as an XML document. He contains all the parameters, which are part of the method invocation. (that is, the parameters in the logical message are the set of parameters for the corresponding method)
Message and parameter list: each operation exposed by the service can and can only have one input message and one output message. The input message defines all messages that the service accepts when the operation is invoked. The output message defines all the messages that the service returns when the operation completes. The fault message defines the data when the service returns an error.
In addition, each operation can have a certain number of fault messages. This fault message defines the data that is returned when a service error occurs. These messages usually have a section that provides enough information to let consumers know what the error is.
Message design is used to integrate inherent systems: if you define an existing application as a service, you must ensure that each parameter used in the method (the method of implementing the operation) can be found in the message. You must make sure that the return value is also in the output message of the operation.
One way to define your message is: RPC style. When RPC style is used, you define a part for each parameter in the parameter list. Each message part is based on the type of the top one in the types.
Your input message corresponds to one part for each input parameter, the same output message corresponds to one part for each output parameter. Additionally a part is added to correspond to the return value. If an argument is both input and output, it is listed as input and as an output message.
RPC-style message definitions are useful when a service makes it possible to stock a system. It uses a pattern transmission similar to TIBCO or CORBA. These systems are designed around processes and methods. It is because of this that they are the easiest to model using messages. RPC style is also a clear mapping between services and applications.
Design a message for the SOAP service: When RPC style is used to model the stock system, the Service Association strongly prefers to wrap the document style. In the wrapping document style, each message has a part. The part of this message refers to a wrapper element that is defined in the types element. The wrapper element has the following characteristics: