SOAP学习笔记(1)

80酷酷网    80kuku.com

  笔记
一       SOAP Roles and SOAP Nodes

SOAP node



The embodiment of the processing logic necessary to transmit, receive, process and/or relay a SOAP message, according to the set of conventions defined by this recommendation. A SOAP node is responsible for enforcing the rules that govern the exchange of SOAP messages (see 2. SOAP Processing Model). It accesses the services provided by the underlying protocols through one or more SOAP bindings.



SOAP role



A SOAP receiver's expected function in processing a message. A SOAP receiver can act in multiple roles.



【理解】



SOAP node是一个实际存在的节点,该节点可以处理SOAP消息,SOAP node是一种物理上的概念;SOAP role是处理SOAP消息时,SOAP node所扮演的角色,是一个逻辑上的概念。一个SOAP node可以扮演多个SOAP role,一个SOAP role也可以由多个SOAP node所扮演。


 


二       预定义的SOAP role


Short-name



Name



Description



next

"http://www.w3.org/2003/05/soap-envelope/role/next"

Each SOAP intermediary and the ultimate SOAP receiver MUST act in this role.

none

"http://www.w3.org/2003/05/soap-envelope/role/none"

SOAP nodes MUST NOT act in this role.

ultimateReceiver

"http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"

The ultimate receiver MUST act in this role.



 


三       处理SOAP消息的过程

1.      Determine the set of roles in which the node is to act. The contents of the SOAP envelope, including any SOAP header blocks and the SOAP body, MAY be inspected in making such determination.



2.      Identify all header blocks targeted at the node that are mandatory.



3.      If one or more of the SOAP header blocks identified in the preceding step are not understood by the node then generate a single SOAP fault with the Value of Code set to "env:MustUnderstand" (see 5.4.8 SOAP mustUnderstand Faults). If such a fault is generated, any further processing MUST NOT be done. Faults relating to the contents of the SOAP body MUST NOT be generated in this step.



4.      Process all mandatory SOAP header blocks targeted at the node and, in the case of an ultimate SOAP receiver, the SOAP body. A SOAP node MAY also choose to process non-mandatory SOAP header blocks targeted at it.



5.      In the case of a SOAP intermediary, and where the SOAP message exchange pattern and results of processing (e.g. no fault generated) require that the SOAP message be sent further along the SOAP message path, relay the message as described in section 2.7 Relaying SOAP Messages.




 


四       Relaying SOAP Messages (relayable SOAP header blocks)


Role



Header block



Short-name



Assumed



Understood & Processed



Forwarded



next

Yes

Yes

No, unless reinserted

No

No, unless relay ="true"

user-defined

Yes

Yes

No, unless reinserted

No

No, unless relay ="true"

No

n/a

Yes

ultimateReceiver

Yes

Yes

n/a

No

n/a

none

No

n/a

Yes


【理解】



所谓Relaying SOAP Message(SOAP消息重放)仅是在SOAP node处理一个Header Block,但却因为不能理解该Header block(can’t understand)而忽略该Header block时才有意义,(这个Header block没有设置mustUnderstand为true,否则无法理解时应返回一个SOAP Fault,而不是继续向前传递SOAP消息,这时也没有relay的意义)。这时若Header block的relay属性为true,则SOAP node必须将该Header block保留在SOAP消息中,并向前转发给下一个SOAP node。

总结来说,SOAP消息重放仅对SOAP中间节点(SOAP intermediary)有意义,并且仅当该中间节点无法处理一个需由它处理但又未设置mustUnderstand属性为true的Header block时有意义,该Header block将被保留在SOAP消息中,并向前转发给下一个SOAP node。


 


五       SOAP中间节点生成的SOAP消息

SOAP中间节点必须按照第三部分所描述的方式处理其收到的SOAP消息,并按以下方式生成一个新的SOAP消息,并将其向前传递给下一个SOAP node。
Remove all processed SOAP header blocks.

Remove all non-relayable SOAP header blocks that were targeted at the forwarding node but ignored during processing.

Retain all relayable SOAP header blocks that were targeted at the forwarding node but ignored during processing.

Insert or reinsert some header blocks if the soap intermediary determined to do that. The header blocks that were inserted or reinserted might be indistinguishable from one or more of the header blocks removed by the intermediary. Processing is defined here in terms of re-inserting header blocks (rather than leaving them in place) to emphasize the need to process them at each SOAP node along the SOAP message path.



 

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: