No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0072.xml 66KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>SOAP Over XMPP</title>
  10. <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>
  11. &LEGALNOTICE;
  12. <number>0072</number>
  13. <status>Draft</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>SOAP 1.2</spec>
  19. <spec>XEP-0030</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby/>
  23. <shortname>soap</shortname>
  24. <schemaloc>
  25. <ns>soap#fault</ns>
  26. <url>http://www.xmpp.org/schemas/soap-fault.xsd</url>
  27. </schemaloc>
  28. &fabio;
  29. &stpeter;
  30. <revision>
  31. <version>1.0</version>
  32. <date>2005-12-14</date>
  33. <initials>psa</initials>
  34. <remark>Per a vote of the Jabber Council, advanced status to Draft.</remark>
  35. </revision>
  36. <revision>
  37. <version>0.14</version>
  38. <date>2005-11-29</date>
  39. <initials>psa</initials>
  40. <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>
  41. </revision>
  42. <revision>
  43. <version>0.13</version>
  44. <date>2005-11-01</date>
  45. <initials>psa</initials>
  46. <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>
  47. </revision>
  48. <revision>
  49. <version>0.12</version>
  50. <date>2005-10-18</date>
  51. <initials>psa</initials>
  52. <remark>In accordance with Council feedback, re-organized descriptive text around use cases.</remark>
  53. </revision>
  54. <revision>
  55. <version>0.11</version>
  56. <date>2005-09-07</date>
  57. <initials>psa</initials>
  58. <remark>Modified service discovery category and type; made several other small text changes based on W3C feedback.</remark>
  59. </revision>
  60. <revision>
  61. <version>0.10</version>
  62. <date>2005-09-01</date>
  63. <initials>psa</initials>
  64. <remark>Added information about service discovery.</remark>
  65. </revision>
  66. <revision>
  67. <version>0.9</version>
  68. <date>2005-08-17</date>
  69. <initials>psa</initials>
  70. <remark>Added implementation note about XMPP routers based on W3C feedback.</remark>
  71. </revision>
  72. <revision>
  73. <version>0.8</version>
  74. <date>2005-07-21</date>
  75. <initials>psa</initials>
  76. <remark>Cleaned up WSDL definition.</remark>
  77. </revision>
  78. <revision>
  79. <version>0.7</version>
  80. <date>2005-06-30</date>
  81. <initials>psa/ff</initials>
  82. <remark>Clarified implementation notes and text on attachments.</remark>
  83. </revision>
  84. <revision>
  85. <version>0.6</version>
  86. <date>2005-06-29</date>
  87. <initials>psa</initials>
  88. <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>
  89. </revision>
  90. <revision>
  91. <version>0.5</version>
  92. <date>2005-04-01</date>
  93. <initials>psa</initials>
  94. <remark>Corrected several small errors throughout.</remark>
  95. </revision>
  96. <revision>
  97. <version>0.4</version>
  98. <date>2005-01-06</date>
  99. <initials>psa</initials>
  100. <remark>Added W3C Considerations and formal description of SOAP XMPP Binding.</remark>
  101. </revision>
  102. <revision>
  103. <version>0.3</version>
  104. <date>2004-05-10</date>
  105. <initials>ff</initials>
  106. <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 &lt;soap&gt; element from the error message example. Fixed the Fault encoding. Explicitly prohibited SOAP elements within the default namespace.</remark>
  107. </revision>
  108. <revision>
  109. <version>0.2</version>
  110. <date>2003-11-11</date>
  111. <initials>ff</initials>
  112. <remark>Deleted the superfluous &lt;soap&gt; element for envelope encapsulation; Changed error reporting semantics; Added a WSDL Binding example; Added a routing example for HTTP&lt;-&gt;XMPP gateways; Added XML Schema; References to Jabber changed in references to XMPP; Other minor changes.</remark>
  113. </revision>
  114. <revision>
  115. <version>0.1</version>
  116. <date>2003-02-17</date>
  117. <initials>ff</initials>
  118. <remark>Initial version.</remark>
  119. </revision>
  120. </header>
  121. <section1 topic='Introduction' anchor='intro'>
  122. <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>
  123. <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>
  124. <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>
  125. <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>
  126. </section1>
  127. <section1 topic="Architectural Assumptions" anchor='arch'>
  128. <p>The usual architecture of XMPP is described in <cite>RFC 6120</cite>. 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>
  129. <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>
  130. <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 <cite>RFC 6120</cite>), 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>
  131. </section1>
  132. <section1 topic="Use Cases" anchor='uc'>
  133. <section2 topic="Discovering Support" anchor='disco'>
  134. <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>
  135. <example caption="Requester queries responder regarding protocol support"><![CDATA[
  136. <iq from='requester@example.com/soap-client'
  137. to='responder@example.com/soap-server'
  138. id='disco1'
  139. type='get'>
  140. <query xmlns='http://jabber.org/protocol/disco#info'/>
  141. </iq>
  142. ]]></example>
  143. <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>
  144. <example caption="Responder replies regarding protocol support"><![CDATA[
  145. <iq from='responder@example.com/soap-server'
  146. to='requester@example.com/soap-client'
  147. id='disco1'
  148. type='result'>
  149. <query xmlns='http://jabber.org/protocol/disco#info'>
  150. <identity category='automation' type='soap'/>
  151. <feature var='http://jabber.org/protocol/soap'/>
  152. </query>
  153. </iq>
  154. ]]></example>
  155. </section2>
  156. <section2 topic="Exchanging SOAP Messages" anchor='exchange'>
  157. <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>
  158. <ol>
  159. <li>&IQ; stanzas SHOULD be used when more formal request-response semantics are needed or when an immediate answer is required.</li>
  160. <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>
  161. </ol>
  162. <p>Examples of both approaches are provided below, encapsulating the SOAP message examples (a travel reservation flow) to be found in &w3soap0;.</p>
  163. <section3 topic="Exchanging SOAP Messages Using XMPP IQ Stanzas" anchor='exchange-iq'>
  164. <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>
  165. <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>
  166. <example caption="Requesting entity sends IQ-set"><![CDATA[
  167. <iq from='requester@example.com/soap-client'
  168. id='soap1'
  169. to='responder@example.com/soap-server'
  170. type='set'>
  171. <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  172. <env:Header>
  173. <m:reservation
  174. xmlns:m="http://travelcompany.example.org/reservation"
  175. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  176. env:mustUnderstand="true">
  177. <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
  178. <m:dateAndTime>2001-11-29T13:20:00.000-05:00</m:dateAndTime>
  179. </m:reservation>
  180. <n:passenger
  181. xmlns:n="http://mycompany.example.com/employees"
  182. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  183. env:mustUnderstand="true">
  184. <n:name>Ake Jogvan Ovind</n:name>
  185. </n:passenger>
  186. </env:Header>
  187. <env:Body>
  188. <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
  189. <p:departure>
  190. <p:departing>New York</p:departing>
  191. <p:arriving>Los Angeles</p:arriving>
  192. <p:departureDate>2001-12-14</p:departureDate>
  193. <p:departureTime>late afternoon</p:departureTime>
  194. <p:seatPreference>aisle</p:seatPreference>
  195. </p:departure>
  196. <p:return>
  197. <p:departing>Los Angeles</p:departing>
  198. <p:arriving>New York</p:arriving>
  199. <p:departureDate>2001-12-20</p:departureDate>
  200. <p:departureTime>mid-morning</p:departureTime>
  201. <p:seatPreference/>
  202. </p:return>
  203. </p:itinerary>
  204. <q:lodging xmlns:q="http://travelcompany.example.org/reservation/hotels">
  205. <q:preference>none</q:preference>
  206. </q:lodging>
  207. </env:Body>
  208. </env:Envelope>
  209. </iq>
  210. ]]></example>
  211. <p>If the responding entity does not support the SOAP XMPP Binding, it SHOULD return a &unavailable; error:</p>
  212. <example caption="Responding entity reports that it cannot handle SOAP messages"><![CDATA[
  213. <iq type='result' to='requester@example.com/soap-client' id='soap1'>
  214. <error code='503' type='cancel'>
  215. <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  216. </error>
  217. </iq>
  218. ]]></example>
  219. <p>If a SOAP-related fault occurs, the mappings in <link url='#errors'>Error Handling</link> SHOULD be used.</p>
  220. <example caption='Responding entity indicates SOAP fault'><![CDATA[
  221. <iq type='error' to='requester@example.com/soap-client' id='soap1'>
  222. <env:Envelope
  223. xmlns:env='http://www.w3.org/2003/05/soap-envelope'
  224. xmlns:rpc='http://www.w3.org/2003/05/soap-rpc'>
  225. <env:Body>
  226. <env:Fault>
  227. <env:Code>
  228. <env:Value>env:Sender</env:Value>
  229. <env:Subcode>
  230. <env:Value>rpc:BadArguments</env:Value>
  231. </env:Subcode>
  232. </env:Code>
  233. <env:Reason>
  234. <env:Text xml:lang='en-US'>Processing error</env:Text>
  235. </env:Reason>
  236. </env:Fault>
  237. </env:Body>
  238. </env:Envelope>
  239. <error code='500' type='modify'>
  240. <undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  241. <Sender xmlns='http://jabber.org/protocol/soap#fault'/>
  242. </error>
  243. </iq>
  244. ]]></example>
  245. <p>If the responding entity does not return an error, it MUST respond with an IQ of type "result":</p>
  246. <example caption='Responding entity returns IQ-result'><![CDATA[
  247. <iq from='responder@example.com/soap-server'
  248. id='soap1'
  249. to='requester@example.com/soap-client'
  250. type='result'>
  251. <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  252. <env:Header>
  253. <m:reservation xmlns:m="http://travelcompany.example.org/reservation"
  254. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  255. env:mustUnderstand="true">
  256. <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
  257. <m:dateAndTime>2001-11-29T13:35:00.000-05:00</m:dateAndTime>
  258. </m:reservation>
  259. <n:passenger xmlns:n="http://mycompany.example.com/employees"
  260. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  261. env:mustUnderstand="true">
  262. <n:name>Ake Jogvan Ovind</n:name>
  263. </n:passenger>
  264. </env:Header>
  265. <env:Body>
  266. <p:itineraryClarification xmlns:p="http://travelcompany.example.org/reservation/travel">
  267. <p:departure>
  268. <p:departing>
  269. <p:airportChoices>JFK LGA EWR</p:airportChoices>
  270. </p:departing>
  271. </p:departure>
  272. <p:return>
  273. <p:arriving>
  274. <p:airportChoices>JFK LGA EWR</p:airportChoices>
  275. </p:arriving>
  276. </p:return>
  277. </p:itineraryClarification>
  278. </env:Body>
  279. </env:Envelope>
  280. </iq>
  281. ]]></example>
  282. <p>At this point the requesting entity could send another IQ-set:</p>
  283. <example caption="Requesting entity sends another IQ-set"><![CDATA[
  284. <iq from='requester@example.com/soap-client'
  285. id='soap2'
  286. to='responder@example.com/soap-server'
  287. type='set'>
  288. <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  289. <env:Header>
  290. <m:reservation
  291. xmlns:m="http://travelcompany.example.org/reservation"
  292. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  293. env:mustUnderstand="true">
  294. <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
  295. <m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
  296. </m:reservation>
  297. <n:passenger xmlns:n="http://mycompany.example.com/employees"
  298. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  299. env:mustUnderstand="true">
  300. <n:name>Ake Jogvan Ovind</n:name>
  301. </n:passenger>
  302. </env:Header>
  303. <env:Body>
  304. <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
  305. <p:departure>
  306. <p:departing>LGA</p:departing>
  307. </p:departure>
  308. <p:return>
  309. <p:arriving>EWR</p:arriving>
  310. </p:return>
  311. </p:itinerary>
  312. </env:Body>
  313. </env:Envelope>
  314. </iq>
  315. ]]></example>
  316. </section3>
  317. <section3 topic="Exchanging SOAP Messages Using XMPP Message Stanzas" anchor='exchange-message'>
  318. <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>
  319. <ol>
  320. <li>The message stanza containing a request MUST carry one SOAP envelope as a first-level child element.</li>
  321. <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>
  322. </ol>
  323. </section3>
  324. </section2>
  325. <section2 topic="Sending Associated Data" anchor='data'>
  326. <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>
  327. <table caption='Possible Methods for Sending Associated Data'>
  328. <tr>
  329. <th>Method</th>
  330. <th>Description</th>
  331. <th>Recommendation</th>
  332. <th>Reasoning</th>
  333. </tr>
  334. <tr>
  335. <td>File Transfer</td>
  336. <td>Negotiate file transfer using &xep0096; and &xep0137;.</td>
  337. <td>SHOULD</td>
  338. <td>Recommended approach for file transfer over XMPP (e.g., see &xep0117;).</td>
  339. </tr>
  340. <tr>
  341. <td>Include Link</td>
  342. <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>
  343. <td>MAY</td>
  344. <td>Fallback if file transfer is not possible (not all clients can publish to file servers).</td>
  345. </tr>
  346. <tr>
  347. <td>Alternate Transports</td>
  348. <td>Send SOAP XML plus binary data over alternate transports such as <cite>WS-Attachments</cite> <note>WS-Attachments &lt;<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>&gt; (work in progress).</note> or SOAP-over-BEEP as defined in &rfc4227;.</td>
  349. <td>SHOULD NOT</td>
  350. <td>These methods are just other transport protocols and would needlessly complicate implementations of SOAP over XMPP.</td>
  351. </tr>
  352. <tr>
  353. <td>MIME</td>
  354. <td>Encode SOAP envelopes and attachments as MIME multipart messages using &w3soapaf; (or, more recently, &w3soapmtom; and &w3xop;).</td>
  355. <td>MUST NOT</td>
  356. <td>XML streams are pure XML and are not MIME-aware.</td>
  357. </tr>
  358. </table>
  359. <p>The recommended approaches (file transfer and including a link) are described more fully below.</p>
  360. <section3 topic="File Transfer" anchor='data-ft'>
  361. <p>The recommended method for sending associated data is to use the file transfer protocol described in <cite>XEP-0096</cite>. 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>
  362. <p>In particular, the entity that has the file SHOULD advertise the availability of the associated stream using <cite>XEP-0137</cite> by including the SI-pub data extension along with the XMPP &MESSAGE; stanza with which the data is associated: <note>In accordance with <cite>RFC 6120</cite>, an &IQ; stanza MUST NOT include multiple payload child elements; therefore, a &MESSAGE; stanza must be used when sending associated data.</note></p>
  363. <example caption="Sender sends message with SI-pub"><![CDATA[
  364. <message from='requester@example.com/soap-client'
  365. id='soap2'
  366. to='responder@example.com/soap-server'>
  367. <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  368. <env:Header>
  369. <m:reservation
  370. xmlns:m="http://travelcompany.example.org/reservation"
  371. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  372. env:mustUnderstand="true">
  373. <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
  374. <m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
  375. </m:reservation>
  376. <n:passenger xmlns:n="http://mycompany.example.com/employees"
  377. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  378. env:mustUnderstand="true">
  379. <n:name>Ake Jogvan Ovind</n:name>
  380. </n:passenger>
  381. </env:Header>
  382. <env:Body>
  383. <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
  384. <p:departure>
  385. <p:departing>LGA</p:departing>
  386. </p:departure>
  387. <p:return>
  388. <p:arriving>EWR</p:arriving>
  389. </p:return>
  390. </p:itinerary>
  391. </env:Body>
  392. </env:Envelope>
  393. <sipub xmlns='http://jabber.org/protocol/si-pub'
  394. id='publish-2345'
  395. mime-type='image/png'
  396. profile='http://jabber.org/protocol/si/profile/file-transfer'>
  397. <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
  398. name='me.png'
  399. size='4238'
  400. date='2005-11-01T23:11Z'/>
  401. </sipub>
  402. </message>
  403. ]]></example>
  404. <p>The entity that is to receive the file SHOULD initiate the file transfer process sending an IQ-get to the sender, using the &lt;start xmlns='http://jabber.org/protocol/sipub'/&gt; element. This element contains the 'id' attribute to specify which published stream to retrieve:</p>
  405. <example caption='Receiver requests start of stream'><![CDATA[
  406. <iq type='get'
  407. id='sipub-request-0'
  408. from='responder@example.com/soap-server'
  409. to='requester@example.com/soap-client'>
  410. <start xmlns='http://jabber.org/protocol/sipub'
  411. id='publish-2345'/>
  412. </iq>
  413. ]]></example>
  414. <p>If the sender accepts the request, it responds with an IQ-result containing a &lt;starting/&gt; element. This element indicates the stream initiation identifier to be used:</p>
  415. <example caption='Sender accepts request to start stream'><![CDATA[
  416. <iq type='result'
  417. id='sipub-request-0'
  418. from='requester@example.com/soap-client'
  419. to='responder@example.com/soap-server'>
  420. <starting xmlns='http://jabber.org/protocol/sipub'
  421. sid='session-87651234'/>
  422. </iq>
  423. ]]></example>
  424. <p>Then the sender begins the stream initiation negotiation:</p>
  425. <example caption='Sender starts negotiation'><![CDATA[
  426. <iq type='set'
  427. id='sipub-set-1'
  428. from='requester@example.com/soap-client'
  429. to='responder@example.com/soap-server'>
  430. <si xmlns='http://jabber.org/protocol/si'
  431. id='session-87651234'
  432. mime-type='image/png'
  433. profile='http://jabber.org/protocol/si/profile/file-transfer'>
  434. <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
  435. name='me.png'
  436. size='4238'
  437. date='2005-11-01T23:11Z'/>
  438. </si>
  439. </iq>
  440. ]]></example>
  441. <p>For details regarding file transfer and advertising of file transfer stream initiation requests, refer to <cite>XEP-0096</cite> and <cite>XEP-0137</cite>.</p>
  442. </section3>
  443. <section3 topic="Including Links" anchor='data-link'>
  444. <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 <cite>RFC 6120</cite>, an &IQ; stanza MUST NOT include multiple payload child elements; therefore, a &MESSAGE; stanza must be used when sending associated data.</note></p>
  445. <example caption="Sender sends message with out-of-band data"><![CDATA[
  446. <message from='requester@example.com/soap-client'
  447. id='soap2'
  448. to='responder@example.com/soap-server'>
  449. <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  450. <env:Header>
  451. <m:reservation
  452. xmlns:m="http://travelcompany.example.org/reservation"
  453. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  454. env:mustUnderstand="true">
  455. <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
  456. <m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
  457. </m:reservation>
  458. <n:passenger xmlns:n="http://mycompany.example.com/employees"
  459. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  460. env:mustUnderstand="true">
  461. <n:name>Ake Jogvan Ovind</n:name>
  462. </n:passenger>
  463. </env:Header>
  464. <env:Body>
  465. <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
  466. <p:departure>
  467. <p:departing>LGA</p:departing>
  468. </p:departure>
  469. <p:return>
  470. <p:arriving>EWR</p:arriving>
  471. </p:return>
  472. </p:itinerary>
  473. </env:Body>
  474. </env:Envelope>
  475. <x xmlns='jabber:x:oob'>
  476. <url>http://example.org/me.png</url>
  477. <desc>John Q. Public</desc>
  478. </x>
  479. </message>
  480. ]]></example>
  481. <p>Alternatively, if all else fails, the file may be included as a SOAP representation header:</p>
  482. <example caption="IQ-set with SOAP representation header"><![CDATA[
  483. <iq from='requester@example.com/soap-client'
  484. id='soap2'
  485. to='responder@example.com/soap-server'
  486. type='set'>
  487. <env:Envelope xmlns:env='http://www.w3.org/2003/05/soap-envelope'
  488. xmlns:rep='http://www.w3.org/2004/08/representation'
  489. xmlns:xmlmime='http://www.w3.org/2004/11/xmlmime'>
  490. <env:Header>
  491. <rep:Representation resource='http://example.org/me.png'>
  492. <rep:Data xmlmime:contentType='image/png'>/aWKKapGGyQ=</rep:Data>
  493. </rep:Representation>
  494. <m:reservation
  495. xmlns:m="http://travelcompany.example.org/reservation"
  496. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  497. env:mustUnderstand="true">
  498. <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
  499. <m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
  500. </m:reservation>
  501. <n:passenger xmlns:n="http://mycompany.example.com/employees"
  502. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  503. env:mustUnderstand="true">
  504. <n:name>Ake Jogvan Ovind</n:name>
  505. </n:passenger>
  506. </env:Header>
  507. <env:Body>
  508. <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
  509. <p:departure>
  510. <p:departing>LGA</p:departing>
  511. </p:departure>
  512. <p:return>
  513. <p:arriving>EWR</p:arriving>
  514. </p:return>
  515. </p:itinerary>
  516. <x:MyData xmlns:x='http://example.org/mystuff'>
  517. <x:name>John Q. Public</x:name>
  518. <x:img src='http://example.org/me.png'/>
  519. </x:MyData>
  520. </env:Body>
  521. </env:Envelope>
  522. </iq>
  523. ]]></example>
  524. <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>
  525. <example caption="Sender sends message with SI-pub, OOB, and representation header"><![CDATA[
  526. <message from='requester@example.com/soap-client'
  527. id='soap2'
  528. to='responder@example.com/soap-server'>
  529. <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
  530. xmlns:rep="http://www.w3.org/2004/08/representation"
  531. xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime">
  532. <env:Header>
  533. <rep:Representation resource='http://example.org/me.png'>
  534. <rep:Data xmlmime:contentType='image/png'>/aWKKapGGyQ=</rep:Data>
  535. </rep:Representation>
  536. <m:reservation
  537. xmlns:m="http://travelcompany.example.org/reservation"
  538. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  539. env:mustUnderstand="true">
  540. <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
  541. <m:dateAndTime>2001-11-29T13:36:50.000-05:00</m:dateAndTime>
  542. </m:reservation>
  543. <n:passenger xmlns:n="http://mycompany.example.com/employees"
  544. env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
  545. env:mustUnderstand="true">
  546. <n:name>Ake Jogvan Ovind</n:name>
  547. </n:passenger>
  548. </env:Header>
  549. <env:Body>
  550. <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
  551. <p:departure>
  552. <p:departing>LGA</p:departing>
  553. </p:departure>
  554. <p:return>
  555. <p:arriving>EWR</p:arriving>
  556. </p:return>
  557. </p:itinerary>
  558. <x:MyData xmlns:x='http://example.org/mystuff'>
  559. <x:name>John Q. Public</x:name>
  560. <x:img src='http://example.org/me.png'/>
  561. </x:MyData>
  562. </env:Body>
  563. </env:Envelope>
  564. <sipub xmlns='http://jabber.org/protocol/si-pub'
  565. id='publish-2345'
  566. mime-type='image/png'
  567. profile='http://jabber.org/protocol/si/profile/file-transfer'>
  568. <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
  569. name='me.png'
  570. size='4238'
  571. date='2005-11-01T23:11Z'/>
  572. </sipub>
  573. <x xmlns='jabber:x:oob'>
  574. <url>http://example.org/me.png</url>
  575. <desc>John Q. Public</desc>
  576. </x>
  577. </message>
  578. ]]></example>
  579. </section3>
  580. </section2>
  581. <section2 topic="Specifying a WSDL Definition" anchor='wsdl'>
  582. <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>
  583. <p>The definition of an XMPP SOAP transport in WSDL is straightforward. The following rules apply:</p>
  584. <ol>
  585. <li>The 'transport' attribute of the &lt;soap:binding&gt; element MUST be set to "http://jabber.org/protocol/soap".</li>
  586. <li>The 'style' attribute of the &lt;soap:binding&gt; element SHOULD be set to "document".</li>
  587. <li>The 'soapAction' attribute of the &lt;soap:operation&gt; element MAY be used; if so, it SHOULD be transported in an appropriate env:Header element for compatibility with the HTTP transport.</li>
  588. <li>A valid XMPP URI/IRI (see &rfc5122;) MUST be used for the 'location' attribute in the &lt;soap:address&gt; element.</li>
  589. </ol>
  590. <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>
  591. <example caption="Example of WSDL definition for a translation service that supports SOAP over XMPP"><![CDATA[
  592. <definitions
  593. name='ShakespeareTranslation'
  594. targetNamespace='http://www.example.org/services/BabelFishService.wsdl'>
  595. xmlns='http://schemas.xmlsoap.org/wsdl/'
  596. xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
  597. xmlns:tns='http://shakespeare.lit/translation.wsdl'>
  598. <binding name='ShakespeareTranslationSoap' type='tns:TranslationPortType'>
  599. <soap:binding style='document' transport='http://jabber.org/protocol/soap'/>
  600. <operation name='Translate'>
  601. <input>...</input>
  602. <output>...</output>
  603. </operation>
  604. </binding>
  605. <service name='ShakespeareTranslationService'>
  606. <documentation>Translates Shakespearean text.</documentation>
  607. <port name='TranslationPort' binding='tns:ShakespeareTranslationSoap'>
  608. <soap:address location='xmpp:translation@shakespeare.lit'/>
  609. </port>
  610. </service>
  611. </definitions>
  612. ]]></example>
  613. <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>
  614. </section2>
  615. </section1>
  616. <section1 topic="SOAP XMPP Binding" anchor='binding'>
  617. <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 <cite>RFC 4227</cite>.) 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>
  618. <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>
  619. <section2 topic="Binding Name" anchor='binding-name'>
  620. <p>The SOAP XMPP Binding is identified by the following URI:</p>
  621. <ul>
  622. <li>http://jabber.org/protocol/soap</li>
  623. </ul>
  624. </section2>
  625. <section2 topic="Supported Features" anchor='binding-features'>
  626. <p>XMPP is a pure XML streaming protocol used to exchange snippets of structured data called "XML stanzas" (see <cite>RFC 6120</cite>) between any two network endpoints.</p>
  627. <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>
  628. <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>
  629. </section2>
  630. <section2 topic="Supported Message Exchange Patterns" anchor='binding-patterns'>
  631. <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>
  632. <ul>
  633. <li>http://www.w3.org/2003/05/soap/mep/request-response/</li>
  634. </ul>
  635. </section2>
  636. <section2 topic="Operation of Request-Response Message Exchange Pattern" anchor='binding-operation'>
  637. <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>
  638. <ul>
  639. <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>
  640. <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>
  641. </ul>
  642. <p>The remainder of this section describes the message exchange pattern (MEP) state machine and its relation to XMPP as described in <cite>RFC 6120</cite>. 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>
  643. <section3 topic="Behavior of Requesting SOAP Node" anchor='binding-operation-request'>
  644. <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>
  645. <section4 topic="Init" anchor='binding-operation-request-init'>
  646. <p>The following table formally describes the "Init" state of the Requesting SOAP Node in the SOAP XMPP Binding:</p>
  647. <table caption='Init: State Description (Requesting)'>
  648. <tr>
  649. <th>Feature</th>
  650. <th>Value / Description</th>
  651. </tr>
  652. <tr>
  653. <td>State Name</td>
  654. <td>Init</td>
  655. </tr>
  656. <tr>
  657. <td>Description</td>
  658. <td>Formulate and send request message</td>
  659. </tr>
  660. <tr>
  661. <td>Pre-Conditions</td>
  662. <td>Control of the outbound transport message exchange context is transferred from the local SOAP node to the binding</td>
  663. </tr>
  664. <tr>
  665. <td>Actions</td>
  666. <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>
  667. </tr>
  668. <tr>
  669. <td>Post-Conditions</td>
  670. <td>None</td>
  671. </tr>
  672. <tr>
  673. <td>Transitions</td>
  674. <td>See table "Init: Transitions (Requesting)"</td>
  675. </tr>
  676. </table>
  677. <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>
  678. <table caption='Init: XMPP Fields (Requesting)'>
  679. <tr>
  680. <th>Field</th>
  681. <th>Value / Description</th>
  682. </tr>
  683. <tr>
  684. <td>XMPP Method</td>
  685. <td>For XMPP &IQ; stanzas, the value of the XMPP 'type' attribute MUST be "set"; does not apply to XMPP &MESSAGE; stanzas</td>
  686. </tr>
  687. <tr>
  688. <td>Originator</td>
  689. <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>
  690. </tr>
  691. <tr>
  692. <td>Destination</td>
  693. <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>
  694. </tr>
  695. <tr>
  696. <td>Correlation Request Message ID</td>
  697. <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>
  698. </tr>
  699. <tr>
  700. <td>XMPP Stanza Contents</td>
  701. <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>
  702. </tr>
  703. </table>
  704. <p>The following table summarizes the transitions from the "Init" state of the Requesting SOAP Node:</p>
  705. <table caption='Init: Transitions (Requesting)'>
  706. <tr>
  707. <th>Event / Condition</th>
  708. <th>Next State</th>
  709. <th>Failure Reason</th>
  710. </tr>
  711. <tr>
  712. <td>Request Successfully Sent</td>
  713. <td>Requesting</td>
  714. <td>N/A</td>
  715. </tr>
  716. <tr>
  717. <td>Failure to Send Request</td>
  718. <td>Fail</td>
  719. <td>fail:TransmissionFailure</td>
  720. </tr>
  721. </table>
  722. </section4>
  723. <section4 topic="Requesting" anchor='binding-operation-request-requesting'>
  724. <p>The following table formally describes the "Requesting" state of the Requesting SOAP Node in the SOAP XMPP Binding:</p>
  725. <table caption='Requesting: State Description'>
  726. <tr>
  727. <th>Feature</th>
  728. <th>Value / Description</th>
  729. </tr>
  730. <tr>
  731. <td>State Name</td>
  732. <td>Requesting</td>
  733. </tr>
  734. <tr>
  735. <td>Description</td>
  736. <td>Waiting for correlated XMPP response (Request Message completely sent on exit from Init state)</td>
  737. </tr>
  738. <tr>
  739. <td>Pre-Conditions</td>
  740. <td>Completion of Init state</td>
  741. </tr>
  742. <tr>
  743. <td>Actions</td>
  744. <td>Wait for a receive XMPP response stanza</td>
  745. </tr>
  746. <tr>
  747. <td>Post-Conditions</td>
  748. <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>
  749. </tr>
  750. <tr>
  751. <td>Transitions</td>
  752. <td>See table "Requesting: Transitions"</td>
  753. </tr>
  754. </table>
  755. <p>The following table summarizes the transitions from the "Requesting" state of the Requesting SOAP Node:</p>
  756. <table caption='Requesting: Transitions'>
  757. <tr>
  758. <th>Event / Condition</th>
  759. <th>Next State</th>
  760. <th>Failure Reason</th>
  761. </tr>
  762. <tr>
  763. <td>Received Correlated XMPP Response</td>
  764. <td>Sending+Receiving</td>
  765. <td>N/A</td>
  766. </tr>
  767. <tr>
  768. <td>Reception Failure (various XMPP errors)</td>
  769. <td>Fail</td>
  770. <td>fail:ReceptionFailure</td>
  771. </tr>
  772. </table>
  773. <p>For a listing of relevant XMPP error conditions, refer to <cite>RFC 6120</cite>.</p>
  774. </section4>
  775. <section4 topic="Sending+Receiving" anchor='binding-operation-request-sendingreceiving'>
  776. <p>The following table formally describes the "Sending+Receiving" state of the Requesting SOAP Node in the SOAP XMPP Binding:</p>
  777. <table caption='Sending+Receiving: State Description'>
  778. <tr>
  779. <th>Feature</th>
  780. <th>Value / Description</th>
  781. </tr>
  782. <tr>
  783. <td>State Name</td>
  784. <td>Sending+Receiving</td>
  785. </tr>
  786. <tr>
  787. <td>Description</td>
  788. <td>Receive correlated XMPP response including SOAP envelope</td>
  789. </tr>
  790. <tr>
  791. <td>Pre-Conditions</td>
  792. <td>Completion of Receiving state</td>
  793. </tr>
  794. <tr>
  795. <td>Actions</td>
  796. <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>
  797. </tr>
  798. <tr>
  799. <td>Post-Conditions</td>
  800. <td>Control of the inbound transport message exchange context is transferred from the binding to the local SOAP node</td>
  801. </tr>
  802. <tr>
  803. <td>Transitions</td>
  804. <td>See table "Sending+Receiving: Transitions"</td>
  805. </tr>
  806. </table>
  807. <p>The following table summarizes the transitions from the "Sending+Receiving" state of the Requesting SOAP Node:</p>
  808. <table caption='Sending+Receiving: Transitions'>
  809. <tr>
  810. <th>Event / Condition</th>
  811. <th>Next State</th>
  812. <th>Failure Reason</th>
  813. </tr>
  814. <tr>
  815. <td>Received Well-Formed Response Message</td>
  816. <td>Success</td>
  817. <td>N/A</td>
  818. </tr>
  819. <tr>
  820. <td>Reception Failure (various XMPP errors)</td>
  821. <td>Fail</td>
  822. <td>fail:ReceptionFailure</td>
  823. </tr>
  824. <tr>
  825. <td>Malformed Response Message (invalid SOAP envelope)</td>
  826. <td>Fail</td>
  827. <td>fail:BadRequestMessage</td>
  828. </tr>
  829. </table>
  830. <p>For a listing of relevant XMPP error conditions, refer to <cite>RFC 6120</cite>.</p>
  831. </section4>
  832. <section4 topic="Success and Fail" anchor='binding-operation-request-successfail'>
  833. <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>
  834. </section4>
  835. </section3>
  836. <section3 topic="Behavior of Responding SOAP Node" anchor='binding-operation-response'>
  837. <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>
  838. <section4 topic="Init" anchor='binding-operation-response-init'>
  839. <p>The following table formally describes the "Init" state of the Responding SOAP Node in the SOAP XMPP Binding:</p>
  840. <table caption='Init: State Description (Responding)'>
  841. <tr>
  842. <th>Feature</th>
  843. <th>Value / Description</th>
  844. </tr>
  845. <tr>
  846. <td>State Name</td>
  847. <td>Init</td>
  848. </tr>
  849. <tr>
  850. <td>Description</td>
  851. <td>Receive request message</td>
  852. </tr>
  853. <tr>
  854. <td>Pre-Conditions</td>
  855. <td>None</td>
  856. </tr>
  857. <tr>
  858. <td>Actions</td>
  859. <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>
  860. </tr>
  861. <tr>
  862. <td>Post-Conditions</td>
  863. <td>Control of the inbound transport message exchange context is transferred from the binding to the local SOAP node</td>
  864. </tr>
  865. <tr>
  866. <td>Transitions</td>
  867. <td>See table "Init: Transitions (Responding)"</td>
  868. </tr>
  869. </table>
  870. <p>The following table summarizes the transitions from the "Init" state of the Responding SOAP Node:</p>
  871. <table caption='Init: Transitions (Responding)'>
  872. <tr>
  873. <th>Event / Condition</th>
  874. <th>Next State</th>
  875. <th>Failure Reason</th>
  876. </tr>
  877. <tr>
  878. <td>Received Well-Formed Request Message</td>
  879. <td>Receiving</td>
  880. <td>N/A</td>
  881. </tr>
  882. <tr>
  883. <td>Reception Failure (various XMPP errors)</td>
  884. <td>Fail</td>
  885. <td>fail:ReceptionFailure</td>
  886. </tr>
  887. <tr>
  888. <td>Malformed Response Message (invalid SOAP envelope)</td>
  889. <td>Fail</td>
  890. <td>fail:BadRequestMessage</td>
  891. </tr>
  892. </table>
  893. <p>For a listing of relevant XMPP error conditions, refer to <cite>RFC 6120</cite>.</p>
  894. </section4>
  895. <section4 topic="Receiving" anchor='binding-operation-response-receiving'>
  896. <p>The following table formally describes the "Receiving" state of the Responding SOAP Node in the SOAP XMPP Binding:</p>
  897. <table caption='Receiving: State Description'>
  898. <tr>
  899. <th>Feature</th>
  900. <th>Value / Description</th>
  901. </tr>
  902. <tr>
  903. <td>State Name</td>
  904. <td>Receiving</td>
  905. </tr>
  906. <tr>
  907. <td>Description</td>
  908. <td>Waiting for local SOAP node to return response message</td>
  909. </tr>
  910. <tr>
  911. <td>Pre-Conditions</td>
  912. <td>Completion of Init state</td>
  913. </tr>
  914. <tr>
  915. <td>Actions</td>
  916. <td>None</td>
  917. </tr>
  918. <tr>
  919. <td>Post-Conditions</td>
  920. <td>Control of the outbound transport message exchange context is transferred from the local SOAP node to the binding</td>
  921. </tr>
  922. <tr>
  923. <td>Transitions</td>
  924. <td>See table "Receiving: Transitions"</td>
  925. </tr>
  926. </table>
  927. <p>The following table summarizes the transitions from the "Receiving" state of the Responding SOAP Node:</p>
  928. <table caption='Receiving: Transitions'>
  929. <tr>
  930. <th>Event / Condition</th>
  931. <th>Next State</th>
  932. <th>Failure Reason</th>
  933. </tr>
  934. <tr>
  935. <td>Response Message Becomes Available</td>
  936. <td>Receiving+Sending</td>
  937. <td>N/A</td>
  938. </tr>
  939. </table>
  940. </section4>
  941. <section4 topic="Receiving+Sending" anchor='binding-operation-response-receivingsending'>
  942. <p>The following table formally describes the "Receiving+Sending" state of the Responding SOAP Node in the SOAP XMPP Binding:</p>
  943. <table caption='Receiving+Sending: State Description'>
  944. <tr>
  945. <th>Feature</th>
  946. <th>Value / Description</th>
  947. </tr>
  948. <tr>
  949. <td>State Name</td>
  950. <td>Receiving+Sending</td>
  951. </tr>
  952. <tr>
  953. <td>Description</td>
  954. <td>Waiting for local SOAP node to return response message</td>
  955. </tr>
  956. <tr>
  957. <td>Pre-Conditions</td>
  958. <td>Completion of Receiving state</td>
  959. </tr>
  960. <tr>
  961. <td>Actions</td>
  962. <td>Formulate and send XMPP &IQ; or &MESSAGE; response stanza (see table "Receiving+Sending: XMPP Fields")</td>
  963. </tr>
  964. <tr>
  965. <td>Post-Conditions</td>
  966. <td>None</td>
  967. </tr>
  968. <tr>
  969. <td>Transitions</td>
  970. <td>See table "Receiving+Sending: Transitions"</td>
  971. </tr>
  972. </table>
  973. <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>
  974. <table caption='Receiving+Sending: XMPP Fields'>
  975. <tr>
  976. <th>Field</th>
  977. <th>Value / Description</th>
  978. </tr>
  979. <tr>
  980. <td>XMPP Method</td>
  981. <td>For XMPP &IQ; stanzas, the value of the XMPP 'type' attribute MUST be "result"; does not apply to XMPP &MESSAGE; stanzas</td>
  982. </tr>
  983. <tr>
  984. <td>Originator</td>
  985. <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>
  986. </tr>
  987. <tr>
  988. <td>Destination</td>
  989. <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>
  990. </tr>
  991. <tr>
  992. <td>Correlation Request Message ID</td>
  993. <td>As required for XMPP &IQ; stanzas in general and required for XMPP &MESSAGE; stanzas sent in the context of the SOAP XMPP Binding, the correlation request message ID is copied from the ID of the request and encapsulated as the value of the XMPP 'id' attribute</td>
  994. </tr>
  995. <tr>
  996. <td>XMPP Stanza Contents</td>
  997. <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>
  998. </tr>
  999. </table>
  1000. <p>The following table summarizes the transitions from the "Receiving+Sending" state of the Responding SOAP Node:</p>
  1001. <table caption='Receiving: Transitions'>
  1002. <tr>
  1003. <th>Event / Condition</th>
  1004. <th>Next State</th>
  1005. <th>Failure Reason</th>
  1006. </tr>
  1007. <tr>
  1008. <td>Response Message Successfully Sent</td>
  1009. <td>Success</td>
  1010. <td>N/A</td>
  1011. </tr>
  1012. <tr>
  1013. <td>Failure to Send Response Message</td>
  1014. <td>Fail</td>
  1015. <td>fail:TransmissionFailure</td>
  1016. </tr>
  1017. </table>
  1018. </section4>
  1019. <section4 topic="Success and Fail" anchor='binding-operation-response-successfail'>
  1020. <p>A given instance of a request-response transport message exchange terminates when the state "Success" or "Fail" is reached; from the perspective of the Responding SOAP Node, the transport message exchange has completed.</p>
  1021. </section4>
  1022. </section3>
  1023. </section2>
  1024. </section1>
  1025. <section1 topic="W3C Considerations" anchor='w3c'>
  1026. <p>The main body of text that addresses the requirements of the W3C with regard to SOAP bindings is provided in the <link url='#binding'>SOAP XMPP Binding</link> section of this document. The current section addresses only the topic of organizational interaction between the W3C and the &XSF; regarding the SOAP XMPP Binding.</p>
  1027. <section2 topic='W3C Review' anchor='w3c-review'>
  1028. <p>As was done with &xep0071;, the SOAP XMPP Binding defined herein has been reviewed informally by one or more appropriate experts from the W3C before the &COUNCIL; advanced it to a status of Draft within the XSF's standards process. Before this specification proceeds to a status of Final within the XSF's standards process, it should undergo a formal review through communication with the W3C's <link url='http://www.w3.org/2000/xp/Group/'>XML Protocol Working Group</link>. To that end, revised versions of this specification will be announced on the W3C's public xml-dist-app@w3.org mailing list.</p>
  1029. </section2>
  1030. <section2 topic='SOAP Versioning' anchor='w3c-soapversions'>
  1031. <p>This specification addresses SOAP 1.2 only. This specification may be superseded or supplemented in the future by a XMPP Extension Protocol specification that defines methods for encapsulating content defined by future versions of SOAP as published by the W3C.</p>
  1032. </section2>
  1033. <section2 topic='XML Versioning' anchor='w3c-xmlversions'>
  1034. <p>Per <cite>RFC 6120</cite>, XMPP supports XML 1.0 only. If future versions of XMPP support XML 1.1 or subsequent versions, this specification may be modified to address handling of SOAP messages that are encoded in versions other than XML 1.0.</p>
  1035. </section2>
  1036. </section1>
  1037. <section1 topic="Error Handling" anchor='errors'>
  1038. <p>SOAP provides its own encoding scheme for errors due to message processing or application execution, and it uses SOAP envelopes for reporting. In the SOAP HTTP Binding, these errors are mapped to corresponding HTTP status codes. In the SOAP XMPP Binding, they are mapped to the catch-all XMPP error of &undefined; along with application-specific error condition elements qualified by the 'http://jabber.org/protocol/soap#fault' namespace (this is consistent with <cite>RFC 6120</cite>, see also &xep0086;). The element names of these application-specific error conditions map directly to the SOAP fault codes specified in Section 5.4.6 of <cite>SOAP Version 1.2 Part 1</cite>.</p>
  1039. <p>The following table provides a mapping between SOAP, HTTP, and application-specific XMPP errors.</p>
  1040. <table caption="Mapping of SOAP Faults to HTTP Status Codes and XMPP Error Conditions">
  1041. <tr>
  1042. <th>SOAP Fault</th>
  1043. <th>HTTP Status Code</th>
  1044. <th>XMPP Application Error</th>
  1045. </tr>
  1046. <tr>
  1047. <td>env:DataEncodingUnknown</td>
  1048. <td>500</td>
  1049. <td>&lt;DataEncodingUnknown/&gt;</td>
  1050. </tr>
  1051. <tr>
  1052. <td>env:MustUnderstand</td>
  1053. <td>500</td>
  1054. <td>&lt;MustUnderstand/&gt;</td>
  1055. </tr>
  1056. <tr>
  1057. <td>env:Receiver</td>
  1058. <td>500</td>
  1059. <td>&lt;Receiver/&gt;</td>
  1060. </tr>
  1061. <tr>
  1062. <td>env:Sender</td>
  1063. <td>400</td>
  1064. <td>&lt;Sender/&gt;</td>
  1065. </tr>
  1066. <tr>
  1067. <td>env:VersionMismatch</td>
  1068. <td>500</td>
  1069. <td>&lt;VersionMismatch/&gt;</td>
  1070. </tr>
  1071. </table>
  1072. <p>Note: When errors are due to the XMPP transport protocol alone and not to the application layer defined by SOAP, errors MUST be reported with standard XMPP error codes only instead of the XMPP &undefined; condition plus application-specific condition.</p>
  1073. </section1>
  1074. <section1 topic="Business Rules" anchor='bizrules'>
  1075. <section2 topic="Encoding" anchor='bizrules-encoding'>
  1076. <p>Because XMPP does not require the parsing of arbitrary and complete XML documents and does not require implementations to support the full XML specification, transported SOAP envelopes MUST comply with the XML restrictions specified in <cite>RFC 6120</cite>. In particular, all envelope elements MUST be properly namespaced (SOAP allows elements within the default namespace, but they are deprecated since SOAP 1.2).</p>
  1077. <p>SOAP envelopes may contain arbitrary data encoded in valid XML as well as byte arrays encoded with SOAP-specific elements. The SOAP specification recommends to encode byte arrays in Base 64 (see &rfc3548;), with the result that envelopes with binary data can be transported within regular XMPP stanzas. All the remaining PCDATA MUST be encoded as UTF-8 in order to match the XML stream encoding.</p>
  1078. </section2>
  1079. </section1>
  1080. <section1 topic="Security Considerations" anchor='security'>
  1081. <p>SOAP has been supplemented by several support protocols that help ensure message integrity and confidentiality (<cite>WS-Security</cite> <note>WS-Security &lt;<link url="http://msdn.microsoft.com/ws/2002/04/Security/">http://msdn.microsoft.com/ws/2002/04/Security/</link>&gt;.</note>) as well as transaction management for failing message exchanges (see <cite>WS-Transaction</cite>). These protocols are all based on SOAP messages and take into account that the underlying protocols can be unreliable and not trusted, thus there are no arguments against their application with XMPP. Alternatively, implementations MAY use native XMPP security such as &xmppe2e;.</p>
  1082. </section1>
  1083. <section1 topic="IANA Considerations" anchor='iana'>
  1084. <p>No interaction with &IANA; is required by this document.</p>
  1085. </section1>
  1086. <section1 topic="XMPP Registrar Considerations" anchor='registrar'>
  1087. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  1088. <p>The &REGISTRAR; includes 'http://jabber.org/protocol/soap' and 'http://jabber.org/protocol/soap#fault' in its registry of protocol namespaces.</p>
  1089. </section2>
  1090. <section2 topic='Service Discovery Identity' anchor='registrar-disco'>
  1091. <p>The XMPP Registrar includes a Service Discovery type of "soap" within the "automation" category.</p>
  1092. <p>The registry submission is as follows:</p>
  1093. <code><![CDATA[
  1094. <category>
  1095. <name>automation</name>
  1096. <type>
  1097. <name>soap</name>
  1098. <desc>A SOAP receiver (either intermediate or ultimate).</desc>
  1099. <doc>XEP-0072</doc>
  1100. </type>
  1101. </category>
  1102. ]]></code>
  1103. </section2>
  1104. </section1>
  1105. <section1 topic="XML Schema" anchor='schema'>
  1106. <section2 topic="SOAP Envelope" anchor='schema-soap'>
  1107. <p>Because the SOAP envelope is included as a first-level child element of an &IQ; or &MESSAGE; stanza via standard XMPP extension mechanisms, an XML schema is not required for this document. An XML schema for the SOAP envelope element is provided at &lt;<link url='http://www.w3.org/2003/05/soap-envelope/'>http://www.w3.org/2003/05/soap-envelope/</link>&gt;.</p>
  1108. </section2>
  1109. <section2 topic="Application-Specific XMPP Errors" anchor='schema-error'>
  1110. <code><![CDATA[
  1111. <?xml version='1.0' encoding='UTF-8'?>
  1112. <xs:schema
  1113. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  1114. targetNamespace='http://jabber.org/protocol/soap#fault'
  1115. xmlns='http://jabber.org/protocol/soap#fault'
  1116. elementFormDefault='qualified'>
  1117. <xs:annotation>
  1118. <xs:documentation>
  1119. The protocol documented by this schema is defined in
  1120. XEP-0072: http://www.xmpp.org/extensions/xep-0072.html
  1121. </xs:documentation>
  1122. </xs:annotation>
  1123. <xs:element name='DataEncodingUnknown' type='empty'/>
  1124. <xs:element name='MustUnderstand' type='empty'/>
  1125. <xs:element name='Receiver' type='empty'/>
  1126. <xs:element name='Sender' type='empty'/>
  1127. <xs:element name='VersionMismatch' type='empty'/>
  1128. <xs:simpleType name='empty'>
  1129. <xs:restriction base='xs:string'>
  1130. <xs:enumeration value=''/>
  1131. </xs:restriction>
  1132. </xs:simpleType>
  1133. </xs:schema>
  1134. ]]></code>
  1135. </section2>
  1136. </section1>
  1137. <section1 topic="Implementation Notes" anchor='impl'>
  1138. <p><em>This section is non-normative.</em></p>
  1139. <p>An XMPP entity that supports the SOAP XMPP binding could function as a "SOAP intermediary" that hands a SOAP message off to some other deployment for subsequent processing (HTTP, email, a specialized enterprise messaging platform, etc.) rather than functioning as the "ultimate SOAP receiver" for the message (as these terms are defined in Section 1.5.3 of <cite>SOAP Version 1.2 Part 1</cite>). If the intended recipient functions as a SOAP intermediary, implementations should be aware that subsequent processing may alter the representation of SOAP messages.</p>
  1140. <p>As an example, consider a component that functions as a gateway between XMPP-based and HTTP-based web services. Its purpose might be to mix HTTP and XMPP for web services and to invoke any web services already accessible through HTTP from XMPP clients.</p>
  1141. <p><cite>WS-Routing</cite>, whose aim is to dynamically compose SOAP message paths and processing sequences, can be used in order to reference web services outside of an XMPP network from within it. WS-Routing extends SOAP Envelope Headers with the &lt;path/&gt; element, which specifies the following for the message: the sender's URL (&lt;from/&gt;), the final destination's URL (&lt;to/&gt;), a forward (&lt;forward/&gt;) path with an arbitrary number of intermediaries (&lt;via/&gt;), and an optional return path (&lt;reverse/&gt;). Each intermediary MUST process the &lt;path/&gt; header and update it accordingly to the already performed path; moreover it MAY process the Body of the message.</p>
  1142. <p>A SOAP message originated by an XMPP entity ('xmpp:orig@A.example.com/soap'), and directed to an end point accessible through HTTP ('http://C.example.net/some/endpoint'), could be built using a &lt;path/&gt; header having:</p>
  1143. <ol>
  1144. <li>the &lt;to/&gt; element set to 'http://C.example.net/some/endpoint'</li>
  1145. <li>one &lt;via/&gt; element set to an HTTP&lt;-&gt;XMPP gateway, such as 'xmpp:soapgw@B.example.org/soap', in the forward path</li>
  1146. <li>an appropriate SOAP action in the &lt;action&gt; element of the &lt;path/&gt; header (this may be required by the HTTP end point)</li>
  1147. <li>a blank return path</li>
  1148. </ol>
  1149. <p>Then the SOAP message can be sent within an &IQ; stanza to the gateway's JID. The gateway processes the SOAP headers, and looking through the headers it discovers that it must act only as intermediary. From the &lt;to/&gt; element it reads the URL of the final end point, extracts the SOAP action, changes the path removing the step already performed, and issues an HTTP request with the modified envelope and appropriate HTTP headers. Once it has received a response, it prepares a new &IQ; stanza of type "result" or "error" and sends its reply to the original requester. The following example shows the possible SOAP headers of the described process.</p>
  1150. <example caption='Gateway-generated SOAP headers'><![CDATA[
  1151. <S:Envelope xmlns:S='http://www.w3.org/2003/05/soap-envelope'>
  1152. <S:Header>
  1153. <m:path xmlns:m='http://www.soap.org/path'>
  1154. <m:action>http://im.example.org/chat</m:action>
  1155. <m:to>http://C.example.net/some/endpoint</m:to>
  1156. <m:forward>
  1157. <m:via>xmpp:soapgw@B.example.org/soap</m:via>
  1158. </m:forward>
  1159. <m:reverse>
  1160. <m:via/>
  1161. </m:reverse>
  1162. <m:from>xmpp:orig@A.example.com/soap</m:from>
  1163. <m:id>uuid:84b9f5d0-33fb-4a81-b02b-5b760641c1d6</m:id>
  1164. </m:path>
  1165. </S:Header>
  1166. <S:Body>
  1167. ...
  1168. </S:Body>
  1169. </S:Envelope>
  1170. ]]></example>
  1171. <p>Generic XMPP routers that conform to <cite>RFC 6120</cite> may also "store and forward" Jabber messages. This feature is usually called "offline message handling": the router makes a decision as to whether to deliver the message to the local intended recipient based on the recipient's presence, and if the recipient is offline when the router processes the message then it may store the message for delivery when the recipient next comes online (rather than returning an error to the sender). Although it is possible to write an XMPP router that directly supports the SOAP XMPP binding and implements the SOAP processing model, generic XMPP routers do not contain such support. Accordingly, generic XMPP routers will not forward an XMPP message to an alternate SOAP transport such as HTTP or SMTP, or provide other functions of a SOAP intermediary or ultimate receiver. When a generic XMPP router delivers a message to the intended recipient (whether immediately or as delayed in "offline storage") and the intended recipient supports the SOAP XMPP binding, SOAP processing is performed; such an intended recipient MAY act either as a SOAP intermediary or as an ultimate SOAP receiver.</p>
  1172. <p>With regarding to exchange of associated data, an XMPP entity that functions as a gateway to other SOAP bindings it SHOULD use W3C-recommended protocols for transporting SOAP attachments over non-XMPP SOAP bindings (e.g., HTTP and SMTP) when communicating with non-XMPP entities.</p>
  1173. </section1>
  1174. <section1 topic="Acknowledgements" anchor='acknowledgements'>
  1175. <p>Many thanks to Noah Mendelsohn for his assistance regarding SOAP binding definitions and conformance issues. Thanks also to Michael Mahan and Rich Salz for their comments.</p>
  1176. <p>Some text in the <link url='#binding'>SOAP XMPP Binding</link> section of this document is closely modelled on Section 7 of <cite>SOAP Version 1.2 Part 2</cite> and on <cite>SOAP Version 1.2 Email Binding</cite>.</p>
  1177. </section1>
  1178. </xep>