Php learning path: WSDL (2)
3. Define the logical message used by the Service
When a service operation is called, the service is defined as message exchange. In the wsdl document, these messages are defined as message elements. These messages are composed of parts called part elements.
A service operation is defined by specifying logical messages. When an operation is called, logical messages are exchanged. (That is, logical messages represent service operations) These logical messages define the data transmitted over the network as xml documents. It contains all the parameters that are part of a method call. (That is, the parameters in a logical message are a set of parameters for the method corresponding to the Operation)
Message and parameter list: each operation exposed by a service can have only one input message and one output message. The input message defines all messages received by the service when the operation is called. The Output Message defines all messages returned by the service when the operation is complete. A fault message defines the data returned when the service returns an error.
In addition, each operation can have a certain number of fault messages. This fault message defines the data returned when a service error occurs. These messages usually have a part that provides sufficient information to let consumers know what the error is.
Message design is used to integrate the inherent system: If you define an existing application as a service, you must ensure the method (the method to implement the operation) each parameter used in the message can be found in the message. You must ensure that the return value is also in the Output Message of the operation.
One way to define your message is the RPC style. When RPC is used, you define a part for each parameter in the parameter list. Each message part is based on the type at the top of types.
Your input message corresponds to one part for each input parameter, and the output Message corresponds to one part for each output parameter. Add a part to return the value. If a parameter is both input and output, it is listed as input and output messages.
The RPC-style message definition is useful when the service enables the stock of the system. It is transmitted in a mode similar to TIBCO or CORBA. These systems are designed around processes and methods. Because of this, they are the easiest way to use messages for modeling. RPC is also a clear ing between services and applications.
Design the message for the SOAP service: When the RPC style is used to model the inventory system, the Service Association strongly prefers the packaging document style. In the packaging Document Style, each message has a part. The part of the message references a packaging element, which is defined in the types element. Packaging elements have the following features: