-
Notifications
You must be signed in to change notification settings - Fork 0
/
xep-0072.xml
1207 lines (1185 loc) · 65.9 KB
/
xep-0072.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>SOAP Over XMPP</title>
<abstract>This specification defines methods for transporting SOAP messages over XMPP. Although the protocol supports only the request-response message exchange pattern, the protocol is formally defined as a SOAP Protocol Binding in accordance with version 1.2 of the W3C SOAP specification. In addition, a WSDL definition is defined for the purpose of advertising the availability of this protocol binding.</abstract>
&LEGALNOTICE;
<number>0072</number>
<status>Draft</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>SOAP 1.2</spec>
<spec>XEP-0030</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>soap</shortname>
<schemaloc>
<ns>soap#fault</ns>
<url>http://www.xmpp.org/schemas/soap-fault.xsd</url>
</schemaloc>
&fabio;
&stpeter;
<revision>
<version>1.0.1</version>
<date>2022-03-22</date>
<initials>gl</initials>
<remark>Fix incorrect reference to sipub namespace.</remark>
</revision>
<revision>
<version>1.0</version>
<date>2005-12-14</date>
<initials>psa</initials>
<remark>Per a vote of the Jabber Council, advanced status to Draft.</remark>
</revision>
<revision>
<version>0.14</version>
<date>2005-11-29</date>
<initials>psa</initials>
<remark>In accordance with further Council feedback, cleaned up the section on file transfer by clarifying which methods are recommended, removing section on MIME, and correcting use of SI-Pub.</remark>
</revision>
<revision>
<version>0.13</version>
<date>2005-11-01</date>
<initials>psa</initials>
<remark>In accordance with Council feedback: divided Sending Attachments text into multiple subsections and added XMPP examples to each subsection; specified use of XEP-0137 to publish SI requests related to file transfer; specified use of application-specific stanza errors; fixed typographical error in WSDL example.</remark>
</revision>
<revision>
<version>0.12</version>
<date>2005-10-18</date>
<initials>psa</initials>
<remark>In accordance with Council feedback, re-organized descriptive text around use cases.</remark>
</revision>
<revision>
<version>0.11</version>
<date>2005-09-07</date>
<initials>psa</initials>
<remark>Modified service discovery category and type; made several other small text changes based on W3C feedback.</remark>
</revision>
<revision>
<version>0.10</version>
<date>2005-09-01</date>
<initials>psa</initials>
<remark>Added information about service discovery.</remark>
</revision>
<revision>
<version>0.9</version>
<date>2005-08-17</date>
<initials>psa</initials>
<remark>Added implementation note about XMPP routers based on W3C feedback.</remark>
</revision>
<revision>
<version>0.8</version>
<date>2005-07-21</date>
<initials>psa</initials>
<remark>Cleaned up WSDL definition.</remark>
</revision>
<revision>
<version>0.7</version>
<date>2005-06-30</date>
<initials>psa/ff</initials>
<remark>Clarified implementation notes and text on attachments.</remark>
</revision>
<revision>
<version>0.6</version>
<date>2005-06-29</date>
<initials>psa</initials>
<remark>Addressed W3C feedback by (1) adding section on architectural assumptions, (2) adding references to recent W3C attachments work, and (3) discussing XML 1.1 support.</remark>
</revision>
<revision>
<version>0.5</version>
<date>2005-04-01</date>
<initials>psa</initials>
<remark>Corrected several small errors throughout.</remark>
</revision>
<revision>
<version>0.4</version>
<date>2005-01-06</date>
<initials>psa</initials>
<remark>Added W3C Considerations and formal description of SOAP XMPP Binding.</remark>
</revision>
<revision>
<version>0.3</version>
<date>2004-05-10</date>
<initials>ff</initials>
<remark>Changed namespaces to keep in sync with latest SOAP specs. Removed the encodingStyle attribute, since in SOAP 1.2 it is allowed only in child elements of the Body. Removed the <soap> element from the error message example. Fixed the Fault encoding. Explicitly prohibited SOAP elements within the default namespace.</remark>
</revision>
<revision>
<version>0.2</version>
<date>2003-11-11</date>
<initials>ff</initials>
<remark>Deleted the superfluous <soap> element for envelope encapsulation; Changed error reporting semantics; Added a WSDL Binding example; Added a routing example for HTTP<->XMPP gateways; Added XML Schema; References to Jabber changed in references to XMPP; Other minor changes.</remark>
</revision>
<revision>
<version>0.1</version>
<date>2003-02-17</date>
<initials>ff</initials>
<remark>Initial version.</remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>&w3soap; is a lightweight protocol that defines a method for the exchange of messages independently from the programming language and platform. For interoperability, the SOAP specification is also agnostic about possible transport protocols, though almost all existing implementations use mainly HTTP.</p>
<p>The primary limitation of HTTP consists in the fact that HTTP-based message exchanges allow only synchronous request-response semantics. To overcome this limitation, SMTP is often used to carry asynchronous messages, but it is a complex protocol and inefficient for passing short and frequent messages that should be delivered in close to real time.</p>
<p>Thus XMPP (see &xmppcore;) can be the ideal transport protocol for many of the application fields of web services, since it can carry efficiently and reliably both types of messages, synchronous and asynchronous. Moreover, XMPP-based web services will not need complex support protocols, such as <cite>WS-Routing</cite> and <cite>WS-Referral</cite>, in order to deliver messages to entities that cannot be identified by static public IP addresses. Therefore, this document defines a binding of SOAP to XMPP as an alternative to the existing HTTP and SMTP bindings.</p>
<p>(Note: The main body of this document provides descriptive text suitable for use by XMPP developers. A formal description of the SOAP XMPP Binding itself is provided in the section of this document entitled <link url='#binding'>SOAP XMPP Binding</link>.)</p>
</section1>
<section1 topic="Architectural Assumptions" anchor='arch'>
<p>The usual architecture of XMPP is described in &rfc6120;. In essence, XMPP is most commonly deployed using a client-server (or logical peer-to-peer) architecture quite similar to that of the email system, except that XMPP does not have multiple hops between servers, enforces domain names to prevent address spoofing, and enables channel encryption (via TLS) and authentication (via SASL) between client and server as well as among servers.</p>
<p>The binding of SOAP to XMPP assumes that most SOAP-enabled XMPP entities will be implemented as XMPP clients that communicate with other entities as logical peers. However, in order to deploy more scalable services, such entities could also be implemented as server-side components (see &xep0114;) or even as special-purpose XMPP servers.</p>
<p>The SOAP specification defines the concepts of "SOAP intermediary" and "ultimate SOAP receiver" (see Section 1.5.3 of <cite>SOAP Version 1.2 Part 1</cite>). In general, this specification assumes that XMPP entities that support the SOAP XMPP Binding will be ultimate SOAP receivers, since SOAP intermediaries tend to be artifacts of the existing SOAP bindings (HTTP and SMTP) rather than applicable to all possible bindings. SOAP intermediaries are usually deployed in order to (1) cross trust boundaries in protocols that do not enforce domain names or authenticate end-points, (2) ensure scalability, (3) secure messages sent over unencrypted channels, and (4) provide message tracing. However, these issues are addressed natively in XMPP (e.g., channel encryption is defined in &rfc6120;), in XMPP extensions (e.g., message tracing is defined in &xep0079;), or in deployment decisions such as business level agreements between XMPP domains. One final justification for SOAP intermediaries is to act as gateways between different transport mechanisms (e.g., between HTTP and SMTP), and XMPP entities may well be SOAP intermediaries for that reason. For further details about gateways between XMPP and other SOAP bindings, refer to the <link url='#impl'>Implementation Notes</link> section of this document.</p>
</section1>
<section1 topic="Use Cases" anchor='uc'>
<section2 topic="Discovering Support" anchor='disco'>
<p>In order to determine whether a potential responding entity supports the SOAP XMPP Binding, a requesting entity SHOULD send a &xep0030; information request to the potential responding entity:</p>
<example caption="Requester queries responder regarding protocol support"><![CDATA[
<iq from='[email protected]/soap-client'
to='[email protected]/soap-server'
id='disco1'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<p>If the responding entity supports the SOAP XMPP Binding and the requesting entity is not blocked from communicating with the responding entity, the responding entity MUST include a feature of "http://jabber.org/protocol/soap" in its reply and SHOULD specify a service discovery identity of "automation/soap".</p>
<example caption="Responder replies regarding protocol support"><![CDATA[
<iq from='[email protected]/soap-server'
to='[email protected]/soap-client'
id='disco1'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity category='automation' type='soap'/>
<feature var='http://jabber.org/protocol/soap'/>
</query>
</iq>
]]></example>
</section2>
<section2 topic="Exchanging SOAP Messages" anchor='exchange'>
<p>When a requesting entity wants to interact with a responding entity via the SOAP XMPP Binding, it faces a fundamental choice: to use &IQ; stanzas or to use &MESSAGE; stanzas. The following guidelines may prove useful:</p>
<ol>
<li>&IQ; stanzas SHOULD be used when more formal request-response semantics are needed or when an immediate answer is required.</li>
<li>&MESSAGE; stanzas SHOULD be used when less formal request-response semantics are acceptable or when store-and-forward ("offline message") delivery is needed (e.g., because the intended recipient may be temporarily unavailable).</li>
</ol>
<p>Examples of both approaches are provided below, encapsulating the SOAP message examples (a travel reservation flow) to be found in &w3soap0;.</p>
<section3 topic="Exchanging SOAP Messages Using XMPP IQ Stanzas" anchor='exchange-iq'>
<p>The transport with &IQ; stanzas is performed in a way similar to that described for XML-RPC in &xep0009;. Request envelopes are carried by &IQ; stanzas of type "set", and answer envelopes by &IQ; stanzas of type "result". SOAP errors are encoded with standard SOAP envelopes, and returned in stanzas of type "error" with appropriate codes in order to distinguish them from errors specific to the XMPP transport layer (see <link url='#errors'>Error Handling</link> for details).</p>
<p>Each &IQ; stanza of type "set" MUST contain a SOAP envelope as the first-level child element, since it already represents a properly namespaced XML subtree qualified by the 'http://www.w3.org/2003/05/soap-envelope' namespace.</p>
<example caption="Requesting entity sends IQ-set"><![CDATA[
<iq from='[email protected]/soap-client'
id='soap1'
to='[email protected]/soap-server'
type='set'>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<m:reservation
xmlns:m="http://travelcompany.example.org/reservation"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
<m:dateAndTime>2001-11-29T13:20:00.000-05:00</m:dateAndTime>
</m:reservation>
<n:passenger
xmlns:n="http://mycompany.example.com/employees"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<n:name>Ake Jogvan Ovind</n:name>
</n:passenger>
</env:Header>
<env:Body>
<p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
<p:departure>
<p:departing>New York</p:departing>
<p:arriving>Los Angeles</p:arriving>
<p:departureDate>2001-12-14</p:departureDate>
<p:departureTime>late afternoon</p:departureTime>
<p:seatPreference>aisle</p:seatPreference>
</p:departure>
<p:return>
<p:departing>Los Angeles</p:departing>
<p:arriving>New York</p:arriving>
<p:departureDate>2001-12-20</p:departureDate>
<p:departureTime>mid-morning</p:departureTime>
<p:seatPreference/>
</p:return>
</p:itinerary>
<q:lodging xmlns:q="http://travelcompany.example.org/reservation/hotels">
<q:preference>none</q:preference>
</q:lodging>
</env:Body>
</env:Envelope>
</iq>
]]></example>
<p>If the responding entity does not support the SOAP XMPP Binding, it SHOULD return a &unavailable; error:</p>
<example caption="Responding entity reports that it cannot handle SOAP messages"><![CDATA[
<iq type='result' to='[email protected]/soap-client' id='soap1'>
<error code='503' type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
]]></example>
<p>If a SOAP-related fault occurs, the mappings in <link url='#errors'>Error Handling</link> SHOULD be used.</p>
<example caption='Responding entity indicates SOAP fault'><![CDATA[
<iq type='error' to='[email protected]/soap-client' id='soap1'>
<env:Envelope
xmlns:env='http://www.w3.org/2003/05/soap-envelope'
xmlns:rpc='http://www.w3.org/2003/05/soap-rpc'>
<env:Body>
<env:Fault>
<env:Code>
<env:Value>env:Sender</env:Value>
<env:Subcode>
<env:Value>rpc:BadArguments</env:Value>
</env:Subcode>
</env:Code>
<env:Reason>
<env:Text xml:lang='en-US'>Processing error</env:Text>
</env:Reason>
</env:Fault>
</env:Body>
</env:Envelope>
<error code='500' type='modify'>
<undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<Sender xmlns='http://jabber.org/protocol/soap#fault'/>
</error>
</iq>
]]></example>
<p>If the responding entity does not return an error, it MUST respond with an IQ of type "result":</p>
<example caption='Responding entity returns IQ-result'><![CDATA[
<iq from='[email protected]/soap-server'
id='soap1'
to='[email protected]/soap-client'
type='result'>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<m:reservation xmlns:m="http://travelcompany.example.org/reservation"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
<m:dateAndTime>2001-11-29T13:35:00.000-05:00</m:dateAndTime>
</m:reservation>
<n:passenger xmlns:n="http://mycompany.example.com/employees"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<n:name>Ake Jogvan Ovind</n:name>
</n:passenger>
</env:Header>
<env:Body>
<p:itineraryClarification xmlns:p="http://travelcompany.example.org/reservation/travel">
<p:departure>
<p:departing>
<p:airportChoices>JFK LGA EWR</p:airportChoices>
</p:departing>
</p:departure>
<p:return>
<p:arriving>
<p:airportChoices>JFK LGA EWR</p:airportChoices>
</p:arriving>
</p:return>
</p:itineraryClarification>
</env:Body>
</env:Envelope>
</iq>
]]></example>
<p>At this point the requesting entity could send another IQ-set:</p>
<example caption="Requesting entity sends another IQ-set"><![CDATA[
<iq from='[email protected]/soap-client'
id='soap2'
to='[email protected]/soap-server'
type='set'>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<m:reservation
xmlns:m="http://travelcompany.example.org/reservation"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
<m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
</m:reservation>
<n:passenger xmlns:n="http://mycompany.example.com/employees"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<n:name>Ake Jogvan Ovind</n:name>
</n:passenger>
</env:Header>
<env:Body>
<p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
<p:departure>
<p:departing>LGA</p:departing>
</p:departure>
<p:return>
<p:arriving>EWR</p:arriving>
</p:return>
</p:itinerary>
</env:Body>
</env:Envelope>
</iq>
]]></example>
</section3>
<section3 topic="Exchanging SOAP Messages Using XMPP Message Stanzas" anchor='exchange-message'>
<p>The process for exchanging SOAP messages using the XMPP &MESSAGE; stanza type is effectively no different from the use with &IQ; stanzas, except that message stanzas may be sent to bare JIDs (user@host) rather than full JIDs (user@host/resource), message stanzas may be stored for later delivery, etc. The following business rules apply:</p>
<ol>
<li>The message stanza containing a request MUST carry one SOAP envelope as a first-level child element.</li>
<li>The 'id' attribute MUST be used to track the XMPP messages and eventually associate errors or answers with the related requests (this is for tracking at the XMPP level, not the SOAP level).</li>
</ol>
</section3>
</section2>
<section2 topic="Sending Associated Data" anchor='data'>
<p>SOAP messages may contain associated (usually binary) data, and XMPP stanzas that encapsulate such SOAP messages could invoke bandwidth restriction settings (commonly called "karma" in XMPP) tuned for normal text chats. The problem could be bypassed by servers having special karma settings for larger messages, or by SOAP-enabled entities being implemented as components rather than XMPP nodes; however, server-to-server communications risk becoming a serious bottleneck, especially in terms of latency and responsiveness when too many large messages are sent. Therefore, it is desirable to support the sending of attachments or files in order to exchange large amounts of binary data associated with SOAP requests and responses. As summarized in the following table, here are four possible methods:</p>
<table caption='Possible Methods for Sending Associated Data'>
<tr>
<th>Method</th>
<th>Description</th>
<th>Recommendation</th>
<th>Reasoning</th>
</tr>
<tr>
<td>File Transfer</td>
<td>Negotiate file transfer using &xep0096; and &xep0137;.</td>
<td>SHOULD</td>
<td>Recommended approach for file transfer over XMPP (e.g., see &xep0117;).</td>
</tr>
<tr>
<td>Include Link</td>
<td>Represent the binary data as a file, publish it to an accessible file server (e.g., HTTP or FTP URL), and insert a link to the file directly into the XMPP message stanza (via &xep0066;) or into the SOAP envelope (via &w3soaprep;).</td>
<td>MAY</td>
<td>Fallback if file transfer is not possible (not all clients can publish to file servers).</td>
</tr>
<tr>
<td>Alternate Transports</td>
<td>Send SOAP XML plus binary data over alternate transports such as <cite>WS-Attachments</cite> <note>WS-Attachments <<link url="http://www.watersprings.org/pub/id/draft-nielsen-dime-soap-01.txt">http://www.watersprings.org/pub/id/draft-nielsen-dime-soap-01.txt</link>> (work in progress).</note> or SOAP-over-BEEP as defined in &rfc4227;.</td>
<td>SHOULD NOT</td>
<td>These methods are just other transport protocols and would needlessly complicate implementations of SOAP over XMPP.</td>
</tr>
<tr>
<td>MIME</td>
<td>Encode SOAP envelopes and attachments as MIME multipart messages using &w3soapaf; (or, more recently, &w3soapmtom; and &w3xop;).</td>
<td>MUST NOT</td>
<td>XML streams are pure XML and are not MIME-aware.</td>
</tr>
</table>
<p>The recommended approaches (file transfer and including a link) are described more fully below.</p>
<section3 topic="File Transfer" anchor='data-ft'>
<p>The recommended method for sending associated data is to use the file transfer protocol described in &xep0096;. Because this is the common and standardized method for XMPP entities to transfer large or binary files outside the XMPP band, it SHOULD be used.</p>
<p>In particular, the entity that has the file SHOULD advertise the availability of the associated stream using &xep0137; by including the SI-pub data extension along with the XMPP &MESSAGE; stanza with which the data is associated: <note>In accordance with &rfc6120;, an &IQ; stanza MUST NOT include multiple payload child elements; therefore, a &MESSAGE; stanza must be used when sending associated data.</note></p>
<example caption="Sender sends message with SI-pub"><![CDATA[
<message from='[email protected]/soap-client'
id='soap2'
to='[email protected]/soap-server'>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<m:reservation
xmlns:m="http://travelcompany.example.org/reservation"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
<m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
</m:reservation>
<n:passenger xmlns:n="http://mycompany.example.com/employees"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<n:name>Ake Jogvan Ovind</n:name>
</n:passenger>
</env:Header>
<env:Body>
<p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
<p:departure>
<p:departing>LGA</p:departing>
</p:departure>
<p:return>
<p:arriving>EWR</p:arriving>
</p:return>
</p:itinerary>
</env:Body>
</env:Envelope>
<sipub xmlns='http://jabber.org/protocol/sipub'
id='publish-2345'
mime-type='image/png'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='me.png'
size='4238'
date='2005-11-01T23:11Z'/>
</sipub>
</message>
]]></example>
<p>The entity that is to receive the file SHOULD initiate the file transfer process sending an IQ-get to the sender, using the <start xmlns='http://jabber.org/protocol/sipub'/> element. This element contains the 'id' attribute to specify which published stream to retrieve:</p>
<example caption='Receiver requests start of stream'><![CDATA[
<iq type='get'
id='sipub-request-0'
from='[email protected]/soap-server'
to='[email protected]/soap-client'>
<start xmlns='http://jabber.org/protocol/sipub'
id='publish-2345'/>
</iq>
]]></example>
<p>If the sender accepts the request, it responds with an IQ-result containing a <starting/> element. This element indicates the stream initiation identifier to be used:</p>
<example caption='Sender accepts request to start stream'><![CDATA[
<iq type='result'
id='sipub-request-0'
from='[email protected]/soap-client'
to='[email protected]/soap-server'>
<starting xmlns='http://jabber.org/protocol/sipub'
sid='session-87651234'/>
</iq>
]]></example>
<p>Then the sender begins the stream initiation negotiation:</p>
<example caption='Sender starts negotiation'><![CDATA[
<iq type='set'
id='sipub-set-1'
from='[email protected]/soap-client'
to='[email protected]/soap-server'>
<si xmlns='http://jabber.org/protocol/si'
id='session-87651234'
mime-type='image/png'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='me.png'
size='4238'
date='2005-11-01T23:11Z'/>
</si>
</iq>
]]></example>
<p>For details regarding file transfer and advertising of file transfer stream initiation requests, refer to &xep0096; and <cite>XEP-0137</cite>.</p>
</section3>
<section3 topic="Including Links" anchor='data-link'>
<p>If the file transfer method is not possible (e.g., because file transfer is not implemented or transfer attempts fails), the entity that is sending the associated data MAY as a fallback publish the associated data as a file (e.g., at an HTTP or FTP URL) and include a link to the file as out-of-band content by including the out-of-band data extension along with the XMPP &MESSAGE; stanza with which the data is associated: <note>As above, in accordance with &rfc6120;, an &IQ; stanza MUST NOT include multiple payload child elements; therefore, a &MESSAGE; stanza must be used when sending associated data.</note></p>
<example caption="Sender sends message with out-of-band data"><![CDATA[
<message from='[email protected]/soap-client'
id='soap2'
to='[email protected]/soap-server'>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<m:reservation
xmlns:m="http://travelcompany.example.org/reservation"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
<m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
</m:reservation>
<n:passenger xmlns:n="http://mycompany.example.com/employees"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<n:name>Ake Jogvan Ovind</n:name>
</n:passenger>
</env:Header>
<env:Body>
<p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
<p:departure>
<p:departing>LGA</p:departing>
</p:departure>
<p:return>
<p:arriving>EWR</p:arriving>
</p:return>
</p:itinerary>
</env:Body>
</env:Envelope>
<x xmlns='jabber:x:oob'>
<url>http://example.org/me.png</url>
<desc>John Q. Public</desc>
</x>
</message>
]]></example>
<p>Alternatively, if all else fails, the file may be included as a SOAP representation header:</p>
<example caption="IQ-set with SOAP representation header"><![CDATA[
<iq from='[email protected]/soap-client'
id='soap2'
to='[email protected]/soap-server'
type='set'>
<env:Envelope xmlns:env='http://www.w3.org/2003/05/soap-envelope'
xmlns:rep='http://www.w3.org/2004/08/representation'
xmlns:xmlmime='http://www.w3.org/2004/11/xmlmime'>
<env:Header>
<rep:Representation resource='http://example.org/me.png'>
<rep:Data xmlmime:contentType='image/png'>/aWKKapGGyQ=</rep:Data>
</rep:Representation>
<m:reservation
xmlns:m="http://travelcompany.example.org/reservation"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
<m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
</m:reservation>
<n:passenger xmlns:n="http://mycompany.example.com/employees"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<n:name>Ake Jogvan Ovind</n:name>
</n:passenger>
</env:Header>
<env:Body>
<p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
<p:departure>
<p:departing>LGA</p:departing>
</p:departure>
<p:return>
<p:arriving>EWR</p:arriving>
</p:return>
</p:itinerary>
<x:MyData xmlns:x='http://example.org/mystuff'>
<x:name>John Q. Public</x:name>
<x:img src='http://example.org/me.png'/>
</x:MyData>
</env:Body>
</env:Envelope>
</iq>
]]></example>
<p>Naturally, in order to maximize the likelihood that the receiver will be able to retrieve the file, the sender MAY include the SI-pub extension, out-of-band-data extension, and SOAP representation header in the message stanza:</p>
<example caption="Sender sends message with SI-pub, OOB, and representation header"><![CDATA[
<message from='[email protected]/soap-client'
id='soap2'
to='[email protected]/soap-server'>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:rep="http://www.w3.org/2004/08/representation"
xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime">
<env:Header>
<rep:Representation resource='http://example.org/me.png'>
<rep:Data xmlmime:contentType='image/png'>/aWKKapGGyQ=</rep:Data>
</rep:Representation>
<m:reservation
xmlns:m="http://travelcompany.example.org/reservation"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
<m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
</m:reservation>
<n:passenger xmlns:n="http://mycompany.example.com/employees"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<n:name>Ake Jogvan Ovind</n:name>
</n:passenger>
</env:Header>
<env:Body>
<p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
<p:departure>
<p:departing>LGA</p:departing>
</p:departure>
<p:return>
<p:arriving>EWR</p:arriving>
</p:return>
</p:itinerary>
<x:MyData xmlns:x='http://example.org/mystuff'>
<x:name>John Q. Public</x:name>
<x:img src='http://example.org/me.png'/>
</x:MyData>
</env:Body>
</env:Envelope>
<sipub xmlns='http://jabber.org/protocol/sipub'
id='publish-2345'
mime-type='image/png'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='me.png'
size='4238'
date='2005-11-01T23:11Z'/>
</sipub>
<x xmlns='jabber:x:oob'>
<url>http://example.org/me.png</url>
<desc>John Q. Public</desc>
</x>
</message>
]]></example>
</section3>
</section2>
<section2 topic="Specifying a WSDL Definition" anchor='wsdl'>
<p>&w3wsdl; provides a machine-readable, formal description of web services operations, protocol bindings, and end points (i.e., network addresses). WSDL definitions attempt to specify a loose coupling of SOAP envelopes and their transports in order to maintain their independence and flexibility.</p>
<p>The definition of an XMPP SOAP transport in WSDL is straightforward. The following rules apply:</p>
<ol>
<li>The 'transport' attribute of the <soap:binding> element MUST be set to "http://jabber.org/protocol/soap".</li>
<li>The 'style' attribute of the <soap:binding> element SHOULD be set to "document".</li>
<li>The 'soapAction' attribute of the <soap:operation> element MAY be used; if so, it SHOULD be transported in an appropriate env:Header element for compatibility with the HTTP transport.</li>
<li>A valid XMPP URI/IRI (see &rfc5122;) MUST be used for the 'location' attribute in the <soap:address> element.</li>
</ol>
<p>The following is an example of a WSDL definition for an endpoint that supports the SOAP XMPP binding: a mythical service that translates Shakespearean English into selected modern languages and dialects.</p>
<example caption="Example of WSDL definition for a translation service that supports SOAP over XMPP"><![CDATA[
<definitions
name='ShakespeareTranslation'
targetNamespace='http://www.example.org/services/BabelFishService.wsdl'>
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://shakespeare.lit/translation.wsdl'>
<binding name='ShakespeareTranslationSoap' type='tns:TranslationPortType'>
<soap:binding style='document' transport='http://jabber.org/protocol/soap'/>
<operation name='Translate'>
<input>...</input>
<output>...</output>
</operation>
</binding>
<service name='ShakespeareTranslationService'>
<documentation>Translates Shakespearean text.</documentation>
<port name='TranslationPort' binding='tns:ShakespeareTranslationSoap'>
<soap:address location='xmpp:[email protected]'/>
</port>
</service>
</definitions>
]]></example>
<p>Although there is no standard procedure for publishing WSDL documents, usually they are made available through HTTP at some URL discoverable with public registries such as UDDI servers. WSDL descriptions for XMPP bindings MAY follow the same publishing process, or MAY be discoverable through Jabber/XMPP specific mechanisms such as &xep0030; or &xep0060;.</p>
</section2>
</section1>
<section1 topic="SOAP XMPP Binding" anchor='binding'>
<p>Section 4 of &w3soap1; defines a SOAP Protocol Binding Framework; two instantiations of that framework are the SOAP HTTP Binding (specified in Section 7 of &w3soap2;) and the &w3soapemail;. (Additionally, a binding to BEEP is described in &rfc4227;.) As an alternative to the HTTP and Email bindings, this section formally defines the SOAP XMPP Binding in accordance with the SOAP Protocol Binding Framework.</p>
<p>Note: The SOAP XMPP Binding is optional, and SOAP nodes are not required to implement it. A SOAP node that correctly and completely implements the SOAP XMPP Binding as described herein may be said to "conform to the SOAP 1.2 XMPP Binding".</p>
<section2 topic="Binding Name" anchor='binding-name'>
<p>The SOAP XMPP Binding is identified by the following URI:</p>
<ul>
<li>http://jabber.org/protocol/soap</li>
</ul>
</section2>
<section2 topic="Supported Features" anchor='binding-features'>
<p>XMPP is a pure XML streaming protocol used to exchange snippets of structured data called "XML stanzas" (see &rfc6120;) between any two network endpoints.</p>
<p>Because XMPP is a direct messaging protocol, it does not possess the equivalent of web methods such as the HTTP GET, PUT, POST, and DELETE methods. Therefore, it is NOT RECOMMENDED for a SOAP node that supports only the SOAP XMPP Binding to provide the "SOAP Web Method Feature" described in Section 6.4 of <cite>SOAP Version 1.2 Part 2</cite>. (A SOAP gateway between XMPP and HTTP should support the SOAP Web Method Feature in order to ensure interoperability; however, description of such gateways is outside the scope of this document.)</p>
<p>Because XMPP is a pure XML protocol, it does not use MIME types (&rfc2045;) or XML media types (&rfc3023;), but rather sends XML directly over the wire. Therefore, it is NOT RECOMMENDED for a SOAP node that supports only the SOAP XMPP Binding to provide the "SOAP Action Feature" described in Section 6.5 of <cite>SOAP Version 1.2 Part 2</cite>. (A SOAP gateway between XMPP and HTTP should support the SOAP Action Feature in order to ensure interoperability; however, description of such gateways is outside the scope of this document.)</p>
</section2>
<section2 topic="Supported Message Exchange Patterns" anchor='binding-patterns'>
<p>XMPP inherently provides request-response semantics via the &IQ; stanza type and &MESSAGE; stanza type, where the &IQ; stanza type requires more formality regarding preservation of request-response semantics in the context of synchronous communications, whereas the &MESSAGE; stanza provides a looser mapping to request-response semantics as well as the ability to ensure store-and-forward capabilities similar to those provided by email (see the <link url='#impl'>Implementation Notes</link> section of this document). Because both stanza types support request-response semantics, an implementation of the SOAP XMPP Binding MUST support only the following message exchange pattern (MEP) defined in the core SOAP 1.2 specification:</p>
<ul>
<li>http://www.w3.org/2003/05/soap/mep/request-response/</li>
</ul>
</section2>
<section2 topic="Operation of Request-Response Message Exchange Pattern" anchor='binding-operation'>
<p>The request-response message exchange pattern is described in Section 6.2 of <cite>SOAP Version 1.1 Part 2</cite>. For binding instances conforming to the specification of the SOAP XMPP Binding:</p>
<ul>
<li>A SOAP node instantiated at an XMPP entity may assume the role (i.e., the <tt>http://www.w3.org/2003/05/soap/bindingFramework/ExchangeContext/Role</tt> property) of "RequestingSOAPNode".</li>
<li>A SOAP node instantiated at an XMPP entity may assume the role (i.e., the <tt>http://www.w3.org/2003/05/soap/bindingFramework/ExchangeContext/Role</tt> property) of "RespondingSOAPNode".</li>
</ul>
<p>The remainder of this section describes the message exchange pattern (MEP) state machine and its relation to XMPP as described in &rfc6120;. For the sake of brevity, relative URIs are used (the base URI being <tt>http://www.w3.org/2003/05/soap/bindingFramework/ExchangeContext/Role</tt>), the string "fail:" is used as a conventional prefix for the namespace <tt>http://www.example.org/2001/12/soap/mep/FailureReasons/</tt>, and the string "reqresp:" is used as a conventional prefix for the namespace <tt>http://www.example.org/2001/12/soap/mep/request-response/</tt>. In the state tables below, the states are defined as values of the <tt>http://www.w3.org/2003/05/soap/bindingFramework/ExchangeContext/State</tt> property (see Section 6.2 of <cite>SOAP Version 1.2 Part 2</cite>) and are of type xs:anyURI.</p>
<section3 topic="Behavior of Requesting SOAP Node" anchor='binding-operation-request'>
<p>The overall flow of the behavior of a Requesting SOAP Node follows the outline state machine description contained in Section 6.2 of <cite>SOAP Version 1.2 Part 2</cite>. The following subsections describe each state in more detail, where "Requesting SOAP Node" is to be understood as a logical entity made up of the binding and the local SOAP node associated with the XMPP entity that generates a SOAP request.</p>
<section4 topic="Init" anchor='binding-operation-request-init'>
<p>The following table formally describes the "Init" state of the Requesting SOAP Node in the SOAP XMPP Binding:</p>
<table caption='Init: State Description (Requesting)'>
<tr>
<th>Feature</th>
<th>Value / Description</th>
</tr>
<tr>
<td>State Name</td>
<td>Init</td>
</tr>
<tr>
<td>Description</td>
<td>Formulate and send request message</td>
</tr>
<tr>
<td>Pre-Conditions</td>
<td>Control of the outbound transport message exchange context is transferred from the local SOAP node to the binding</td>
</tr>
<tr>
<td>Actions</td>
<td>Formulate and send XMPP &IQ; or &MESSAGE; request stanza (see table "Init: XMPP Fields (Requesting)") that encappsulates SOAP envelope transferred from local SOAP node to binding</td>
</tr>
<tr>
<td>Post-Conditions</td>
<td>None</td>
</tr>
<tr>
<td>Transitions</td>
<td>See table "Init: Transitions (Requesting)"</td>
</tr>
</table>
<p>In the "Init" state, an XMPP stanza (either &IQ; or &MESSAGE;) is formulated by the Requesting SOAP Node according to the following table:</p>
<table caption='Init: XMPP Fields (Requesting)'>
<tr>
<th>Field</th>
<th>Value / Description</th>
</tr>
<tr>
<td>XMPP Method</td>
<td>For XMPP &IQ; stanzas, the value of the XMPP 'type' attribute MUST be "set"; does not apply to XMPP &MESSAGE; stanzas</td>
</tr>
<tr>
<td>Originator</td>
<td>The XMPP address (JID) carried in the <tt>reqresp:ImmediateSender</tt> property of the message exchange context is encapsulated as the value of the XMPP 'from' attribute; normally this is set by the XMPP server to which the originator connects</td>
</tr>
<tr>
<td>Destination</td>
<td>The XMPP address (JID) carried in the <tt>reqresp:ImmediateDestination</tt> property of the message exchange context is encapsulated as the value of the XMPP 'to' attribute</td>
</tr>
<tr>
<td>Correlation Request Message ID</td>
<td>As required for XMPP &IQ; stanzas in general and required for XMPP &MESSAGE; stanzas sent in the context of the SOAP XMPP Binding, a correlation request message ID is generated by the sender and encapsulated as the value of the XMPP 'id' attribute</td>
</tr>
<tr>
<td>XMPP Stanza Contents</td>
<td>The XML of the SOAP envelope carried in the <tt>reqresp:OutboundMessage</tt> property of the transport message exchange context is encapsulated as a direct child element of the XMPP &IQ; or &MESSAGE; stanza</td>
</tr>
</table>
<p>The following table summarizes the transitions from the "Init" state of the Requesting SOAP Node:</p>
<table caption='Init: Transitions (Requesting)'>
<tr>
<th>Event / Condition</th>
<th>Next State</th>
<th>Failure Reason</th>
</tr>
<tr>
<td>Request Successfully Sent</td>
<td>Requesting</td>
<td>N/A</td>
</tr>
<tr>
<td>Failure to Send Request</td>
<td>Fail</td>
<td>fail:TransmissionFailure</td>
</tr>
</table>
</section4>
<section4 topic="Requesting" anchor='binding-operation-request-requesting'>
<p>The following table formally describes the "Requesting" state of the Requesting SOAP Node in the SOAP XMPP Binding:</p>
<table caption='Requesting: State Description'>
<tr>
<th>Feature</th>
<th>Value / Description</th>
</tr>
<tr>
<td>State Name</td>
<td>Requesting</td>
</tr>
<tr>
<td>Description</td>
<td>Waiting for correlated XMPP response (Request Message completely sent on exit from Init state)</td>
</tr>
<tr>
<td>Pre-Conditions</td>
<td>Completion of Init state</td>
</tr>
<tr>
<td>Actions</td>
<td>Wait for a receive XMPP response stanza</td>
</tr>
<tr>
<td>Post-Conditions</td>
<td>Instantiate or replace the <tt>reqresp:ImmediateSender</tt> property with an XMPP address (JID) that denotes the sender of the XMPP response stanza</td>
</tr>
<tr>
<td>Transitions</td>
<td>See table "Requesting: Transitions"</td>
</tr>
</table>
<p>The following table summarizes the transitions from the "Requesting" state of the Requesting SOAP Node:</p>
<table caption='Requesting: Transitions'>
<tr>
<th>Event / Condition</th>
<th>Next State</th>
<th>Failure Reason</th>
</tr>
<tr>
<td>Received Correlated XMPP Response</td>
<td>Sending+Receiving</td>
<td>N/A</td>
</tr>
<tr>
<td>Reception Failure (various XMPP errors)</td>
<td>Fail</td>
<td>fail:ReceptionFailure</td>
</tr>
</table>
<p>For a listing of relevant XMPP error conditions, refer to &rfc6120;.</p>
</section4>
<section4 topic="Sending+Receiving" anchor='binding-operation-request-sendingreceiving'>
<p>The following table formally describes the "Sending+Receiving" state of the Requesting SOAP Node in the SOAP XMPP Binding:</p>
<table caption='Sending+Receiving: State Description'>
<tr>
<th>Feature</th>
<th>Value / Description</th>
</tr>
<tr>
<td>State Name</td>
<td>Sending+Receiving</td>
</tr>
<tr>
<td>Description</td>
<td>Receive correlated XMPP response including SOAP envelope</td>
</tr>
<tr>
<td>Pre-Conditions</td>
<td>Completion of Receiving state</td>
</tr>
<tr>
<td>Actions</td>
<td>Process XMPP &IQ; or &MESSAGE; response stanza and included SOAP envelope, instantiating or replacing the <tt>reqresp:InboundMessage</tt> property with an infoset representation of the SOAP envelope contained in the XMPP response stanza</td>
</tr>
<tr>
<td>Post-Conditions</td>
<td>Control of the inbound transport message exchange context is transferred from the binding to the local SOAP node</td>
</tr>
<tr>
<td>Transitions</td>
<td>See table "Sending+Receiving: Transitions"</td>
</tr>
</table>
<p>The following table summarizes the transitions from the "Sending+Receiving" state of the Requesting SOAP Node:</p>
<table caption='Sending+Receiving: Transitions'>
<tr>
<th>Event / Condition</th>
<th>Next State</th>
<th>Failure Reason</th>
</tr>
<tr>
<td>Received Well-Formed Response Message</td>
<td>Success</td>
<td>N/A</td>
</tr>
<tr>
<td>Reception Failure (various XMPP errors)</td>
<td>Fail</td>
<td>fail:ReceptionFailure</td>
</tr>
<tr>
<td>Malformed Response Message (invalid SOAP envelope)</td>
<td>Fail</td>
<td>fail:BadRequestMessage</td>
</tr>
</table>
<p>For a listing of relevant XMPP error conditions, refer to &rfc6120;.</p>
</section4>
<section4 topic="Success and Fail" anchor='binding-operation-request-successfail'>
<p>A given instance of a request-response transport message exchange terminates when the state "Success" or "Fail" is reached; control over the transport message exchange context returns to the Requesting SOAP Node.</p>
</section4>
</section3>
<section3 topic="Behavior of Responding SOAP Node" anchor='binding-operation-response'>
<p>The overall flow of the behavior of a Responding SOAP Node follows the outline state machine description contained in Section 6.2 of <cite>SOAP Version 1.2 Part 2</cite>. The following subsections describe each state in more detail, where "Responding SOAP Node" is to be understood as a logical entity made up of the binding and the local SOAP node associated with the XMPP entity that responds to a SOAP request.</p>
<section4 topic="Init" anchor='binding-operation-response-init'>
<p>The following table formally describes the "Init" state of the Responding SOAP Node in the SOAP XMPP Binding:</p>
<table caption='Init: State Description (Responding)'>
<tr>
<th>Feature</th>
<th>Value / Description</th>
</tr>
<tr>
<td>State Name</td>
<td>Init</td>
</tr>
<tr>
<td>Description</td>
<td>Receive request message</td>
</tr>
<tr>
<td>Pre-Conditions</td>
<td>None</td>
</tr>
<tr>
<td>Actions</td>
<td>Receive and validate inbound XMPP &IQ; or &MESSAGE; request stanza; instantiate or replace the <tt>reqresp:ImmediateSender</tt> property with an XMPP address (JID) that denotes the sender of the XMPP request; instantiate or replace the <tt>reqresp:InboundMessage</tt> property with an infoset representation of the included SOAP envelope</td>
</tr>
<tr>
<td>Post-Conditions</td>
<td>Control of the inbound transport message exchange context is transferred from the binding to the local SOAP node</td>
</tr>
<tr>
<td>Transitions</td>
<td>See table "Init: Transitions (Responding)"</td>
</tr>
</table>
<p>The following table summarizes the transitions from the "Init" state of the Responding SOAP Node:</p>
<table caption='Init: Transitions (Responding)'>
<tr>
<th>Event / Condition</th>
<th>Next State</th>
<th>Failure Reason</th>
</tr>
<tr>
<td>Received Well-Formed Request Message</td>
<td>Receiving</td>
<td>N/A</td>
</tr>
<tr>
<td>Reception Failure (various XMPP errors)</td>
<td>Fail</td>
<td>fail:ReceptionFailure</td>
</tr>
<tr>
<td>Malformed Response Message (invalid SOAP envelope)</td>
<td>Fail</td>
<td>fail:BadRequestMessage</td>
</tr>
</table>
<p>For a listing of relevant XMPP error conditions, refer to &rfc6120;.</p>
</section4>
<section4 topic="Receiving" anchor='binding-operation-response-receiving'>
<p>The following table formally describes the "Receiving" state of the Responding SOAP Node in the SOAP XMPP Binding:</p>
<table caption='Receiving: State Description'>
<tr>
<th>Feature</th>
<th>Value / Description</th>
</tr>
<tr>
<td>State Name</td>
<td>Receiving</td>
</tr>
<tr>
<td>Description</td>
<td>Waiting for local SOAP node to return response message</td>
</tr>
<tr>
<td>Pre-Conditions</td>
<td>Completion of Init state</td>
</tr>
<tr>
<td>Actions</td>
<td>None</td>
</tr>
<tr>
<td>Post-Conditions</td>
<td>Control of the outbound transport message exchange context is transferred from the local SOAP node to the binding</td>
</tr>
<tr>
<td>Transitions</td>
<td>See table "Receiving: Transitions"</td>
</tr>
</table>
<p>The following table summarizes the transitions from the "Receiving" state of the Responding SOAP Node:</p>
<table caption='Receiving: Transitions'>
<tr>
<th>Event / Condition</th>
<th>Next State</th>
<th>Failure Reason</th>
</tr>
<tr>
<td>Response Message Becomes Available</td>
<td>Receiving+Sending</td>
<td>N/A</td>
</tr>
</table>
</section4>
<section4 topic="Receiving+Sending" anchor='binding-operation-response-receivingsending'>
<p>The following table formally describes the "Receiving+Sending" state of the Responding SOAP Node in the SOAP XMPP Binding:</p>
<table caption='Receiving+Sending: State Description'>
<tr>
<th>Feature</th>
<th>Value / Description</th>
</tr>
<tr>
<td>State Name</td>
<td>Receiving+Sending</td>
</tr>
<tr>
<td>Description</td>
<td>Waiting for local SOAP node to return response message</td>
</tr>
<tr>
<td>Pre-Conditions</td>
<td>Completion of Receiving state</td>
</tr>
<tr>
<td>Actions</td>
<td>Formulate and send XMPP &IQ; or &MESSAGE; response stanza (see table "Receiving+Sending: XMPP Fields")</td>
</tr>
<tr>
<td>Post-Conditions</td>
<td>None</td>
</tr>
<tr>
<td>Transitions</td>
<td>See table "Receiving+Sending: Transitions"</td>
</tr>
</table>
<p>In the "Receiving+Sending" state, an XMPP stanza (either &IQ; or &MESSAGE;) is formulated by the Responding SOAP Node according to the following table:</p>
<table caption='Receiving+Sending: XMPP Fields'>
<tr>
<th>Field</th>
<th>Value / Description</th>
</tr>
<tr>
<td>XMPP Method</td>
<td>For XMPP &IQ; stanzas, the value of the XMPP 'type' attribute MUST be "result"; does not apply to XMPP &MESSAGE; stanzas</td>
</tr>
<tr>
<td>Originator</td>
<td>The XMPP address (JID) carried in the <tt>reqresp:ImmediateSender</tt> property of the message exchange context is encapsulated as the value of the XMPP 'from' attribute; normally set by the XMPP server to which the originator connects</td>
</tr>