1
************************************************************
2
*********** SOAP (Simple Object Access Protocol) ***********
3
************************************************************
4
SOAP is a minimal protocol for invoking methods on
5
servers/services/components/objects.
6
�����筮 ��� �ᯮ������ � �離� � WSDL, �����
10
******** Soap Messages
11
**********************
16
xmlns:soap='http://www.w3.org/2001/12/soap-envelope'
17
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
18
xmlns:enc='http://www.w3.org/2001/12/soap-encoding'
19
SOAP:encodingStyle='http://www.w3.org/2001/12/soap-encoding'>
23
encodingStyle - XSD Schema (����뢠��� �⠭����� �ணࠬ��⪨�
24
⨯� ⠪��, ��� array, class � �� ⠪��)
30
... Some XML code here ...
33
The header section is used to encapsulate data that is not tied to a specific
34
method itself, but instead provides context knowledge, such as a transaction
35
ID and security information. For example:
44
<SOAP:Header mustUnerstand="1">
48
If a SOAP server receives a message that includes a header element
49
with a mustUnderstand value of "1", and it is not expecting it, then
50
in order to comply with the SOAP protocol it should return a SOAP
51
Fault with a SOAP faultcode of "MustUnderstand".
55
<SOAP:Header actor="URI">
57
Defines the URI for which the header elements are intended
62
... Some XML code here ....
65
��易⥫쭮 ������ ������⢮���� � SOAP ᮮ�饭��, ���筮 ᮤ�ন� �������
66
�ࢥ�� � ��ࠬ����, ���ਬ��:
68
<ssn>123-456-7890</ssn>
75
<faultcode>...</faultcode>
76
<faultstring>...</faultstring>
77
<faultactor>...</faultactor>
82
The SOAP protocol includes a way for the invoked method to return an error
83
message to the requestor.
84
faultcode: generic.refiner
85
generic - is a generic fault message
90
refiner - more details
91
���ਬ��: Client.authentication
92
faultstring: Human readable indication of error cause
93
faultactor: Indicates who, or what process, was attempting to run when
95
detail: If present, contains application-specific error information
97
����� ���� � ��㣨� ⠣�, �� �।����⥫쭮 ��� �������⥫��� ���ଠ��
103
<SomeElement soap:href='#id1'/>
105
<OtherElement soap:id='#id1'> ... some content ... </OtherElement>
110
SOAP is RPC over HTTP protocol
113
POST <server page> HTTP /1.1
114
Content-Type: text/xml
115
SOAPAction: "my-name-space#my-method-name"
118
MessageType: CallResponse
119
Content-Type: text/xml
122
There will need to be some form of SOAP server that either acts upon, or acts
123
as routing agent for the SOAP messages. The is the URI end point of the POSTED
129
The aspects of SOAP described so far are sufficient to build very
130
sophisticated message based systems. A server specifies the XML it expects
131
in the body and/or header of a request message and the XML it will return in
132
the body and/or header of the response message. Clients are coded to provide
133
and consume the XML as specified by the server. Nothing more is needed.
135
However, one of the stated goals of SOAP is to act as an RPC transport
136
mechanism. In general, RPC requires that the input parameters to a method
137
called on the client be encoded, passed across the network, decoded, and the
138
method invoked on the server. Output parameters and the return value are
139
then encoded, passed across the network, decoded and returned to the client
140
application. When SOAP is used as the transport, both the client and server
141
must agree on how a parameter of a given type will be encoded in the
144
SOAP allows a client to indicate the encoding style used for a message using
145
the SOAP:encodingStyle attribute. The value of this attribute is an URI
146
which acts as the unique name of an encoding style. The server must
147
recognize URI and act to decode the data in accordance to that style. SOAP
148
defines a standard encoding style. Other styles can be defined and agreed
149
upon by client and server implementers, but the standard encoding style is
150
sufficient for most applications.
152
Note that using the SOAP encoding style does not require that the client or
153
server side actually be implemented using RPC. A client application could
154
directly generate messages that conform to the encoding style expected by
155
the server and/or the server can be coded to process the messages directly.
157
The standard SOAP encoding style defines how simple data types such as
158
strings, integers, dates, etc., and complex data types such as arrays and
159
structures, should be encoded. The basic rules are fairly simple: values are
160
encoded as the content of elements (as opposed to attributes) and the data
161
type of a given value must be specified either in the message itself or in a
162
schema associated with the message. In either case, data types are described
163
as specified in the XML Schema standard.
165
For example a request with all type information contained in the message
168
POST /ItemService HTTP/1.1
170
Content-Type: text/xml; charset="utf-8"
175
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
176
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
177
xmlns:xsd="http://www.w3.org/1999/XMLSchema/"
178
xmlns:xsi="http://www.w3.org/1999/XMLSchema/instance/"
179
SOAP-ENV:EncodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
181
<is:getChildren xmlns:is="http://schemas.pge.com/ItemService">
182
<path xsi:type="xsd:string">a</path>
187
And the response which returns an array (the Items element) of structures
188
(the Item elements) could be:
191
Content-Type: text/xml; charset="uft-8"
195
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
196
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
197
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
198
xmlns:xsi="http://www.w3.org/1999/XMLSchema/instance"
199
SOAP-ENV:EncodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
201
<is:getChildrenResponse xmlns:is="http://schemas.pge.com/ItemService">
202
<items xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="is:Item[]">
204
<name xsi:type="xsd:string">e</name>
205
<value xsi:type="xsd:integer">1</value>
208
<name xsi:type="xsd:string">f</name>
209
<value xsi:type="xsd:integer">2</value>
212
<name xsi:type="xsd:string">g</name>
213
<value xsi:type="xsd:integer">3</value>
216
</is:getChildrenResponse>
221
<Element xsi:type="enc:base64"> base64 encoded string </Element>
223
<Element enc:arrayType="xs:int[2]">
228
<Element xmlns:enc="http://www.w3.org/2001/12/soap-encoding"
229
enc:arrayType="xs:string[6]"
231
<item>The fourth element</item>
232
<item>The fifth element</item>