📄 soap5.htm
字号:
<P></P>
<P></P>
<P>方法调用出错应使用SOAP Fault元素来编码(餐饮 section
4.4)。如果一个绑定协议对于错误表达还有额外规则,那么这些规则都应当被遵守。</P>
<P></P>
<P>就象先前表述的那样,方法和响应的结构可以使用在section
5中定义的规则来编码,也可以使用在encodingStyle属性中描述的其他编码(参阅 section 4.1.1)。</P>
<P></P>
<P>应用程序可以处理漏写参数的请求不过也可以返回一个错误。</P>
<P></P>
<P>因为在响应中若包含“result”则表明成功,若包含“fault”则表明失败,所以如果方法响应中同时包含了“result”和“fault”则是错误的。</P>
<P></P>
<P>7.2 RPC和SOAP Header</P>
<P><BR>对于那些并非是方法的正式调用数据部分,而是方法请求编码相关的一些额外信息,也可以在RPC编码中表示。如果这样,它必须作为SOAP
Header元素的一个子元素来描述。</P>
<P></P>
<P>对于使用header元素的一个例子是在消息中传送一个事务ID。事务ID并不是调用参数表中的一员,它一般是要被下层构件所处理而不仅仅是一个应用程序ID,而这里并没有一个直接的方法在调用中传送这一需要的信息。通过在头上加一个条目并赋予它一个固定的名字,接收方的事务管理器就可以将该事务ID抽取出来,同时就可以在不影响远程过程调用的代码的前提下使用它。
</P>
<P></P>
<P>8. 安全机制的考虑</P>
<P><BR>在本文档中并不包含完整性和私密性保护的方法的描述。这些问题将在本文档的以后版本中详细说明。</P>
<P></P>
<P>9. 参考文献</P>
<P></P>
<P><BR>9.1. Normative references</P>
<P><BR>[2] IETF "RFC 2119: Key words for use in RFCs to Indicate
Requirement Levels", S. Bradner, March 1997. Available at
http://www.ietf.org/rfc/rfc2119.txt</P>
<P></P>
<P>[3] IETF "RFC 2376: XML Media Types", E. Whitehead, M. Murata,
July 1998. Available at http://www.ietf.org/rfc/rfc2376.txt</P>
<P></P>
<P>[4] IETF "RFC 2396: Uniform Resource Identifiers (URI): Generic
Syntax", T. Berners-Lee, R. Fielding, L. Masinter, August 1998.
Available at http://www.ietf.org/rfc/rfc2396.txt</P>
<P></P>
<P>[5] IETF "RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1", R.
Fielding, J. Gettys, J. C. Mogul, H. Frystyk, T. Berners-Lee,
January 1997. Available at http://www.ietf.org/rfc/rfc2616.txt</P>
<P></P>
<P>[6] IETF "RFC 2774: An HTTP Extension Framework", H. Nielsen, P.
Leach, S. Lawrence, February 2000. Available at
http://www.ietf.org/rfc/rfc2774.txt</P>
<P></P>
<P>[7] W3C Recommendation "Extensible Markup Language (XML) 1.0
(Second Edition)", Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve
Maler, 6 October 2000. Available at
http://www.w3.org/TR/2000/REC-xml-20001006</P>
<P></P>
<P>[8] W3C Recommendation "Namespaces in XML", Tim Bray, Dave
Hollander, Andrew Layman, 14 January 1999. Available at
http://www.w3.org/TR/1999/REC-xml-names-19990114/</P>
<P></P>
<P>[9] W3C Proposed Recommendation "XML Linking Language (XLink)
Version 1.0", Steve DeRose, Eve Maler, David Orchard, 20 December
2000. Available at http://www.w3.org/TR/2000/PR-xlink-20001220/</P>
<P></P>
<P>[10] W3C Recommendation "XML Schema Part 1: Structures", Henry S.
Thompson, David Beech, Murray Maloney, Noah Mendelsohn, 2 May 2001.
Available at http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/</P>
<P></P>
<P>[11] W3C Recommendation "XML Schema Part 2: Datatypes", Paul V.
Biron, Ashok Malhotra, 2 May 2001. Available at
http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/</P>
<P></P>
<P>9.2. Informative references</P>
<P><BR>[12] Transfer Syntax NDR, in Open Group Technical Standard
"DCE 1.1: Remote Procedure Call", August 1997. Available at
http://www.opengroup.org/public/pubs/catalog/c706.htm</P>
<P></P>
<P>[13] IETF "RFC2045: Multipurpose Internet Mail Extensions (MIME)
Part One: Format of Internet Message Bodies", N. Freed, N.
Borenstein, November 1996. Available at
http://www.ietf.org/rfc/rfc2045.txt</P>
<P></P>
<P>A. SOAP Envelope Examples</P>
<P><BR>A.1 Sample Encoding of Call Requests</P>
<P></P>
<P><BR>Example 47</P>
<P><BR>POST /StockQuote HTTP/1.1Host:
www.stockquoteserver.comContent-Type: text/xml;
charset="utf-8"Content-Length: nnnnSOAPAction:
"http://example.org/2001/06/quotes"<env:Envelope
xmlns:env="http://www.w3.org/2001/06/soap-envelope" >
<env:Header> <t:Transaction
xmlns:t="http://example.org/2001/06/tx"
env:encodingStyle="http://www.w3.org/2001/06/soap-encoding"
env:mustUnderstand="1" > 5 </t:Transaction>
</env:Header> <env:Body > <m:GetLastTradePrice
env:encodingStyle="http://www.w3.org/2001/06/soap-encoding"
xmlns:m="http://example.org/2001/06/quotes" >
<m:symbol>DEF</m:symbol> </m:GetLastTradePrice>
</env:Body></env:Envelope></P>
<P><BR>Similar to Example 1 but with a Mandatory Header</P>
<P><BR> </P>
<P></P>
<P></P>
<P>Example 48</P>
<P><BR>POST /StockQuote HTTP/1.1Host:
www.stockquoteserver.comContent-Type: text/xml;
charset="utf-8"Content-Length: nnnnSOAPAction:
"http://example.org/2001/06/quotes"<env:Envelope
xmlns:env="http://www.w3.org/2001/06/soap-envelope" >
<env:Body> <m:GetLastTradePriceDetailed
env:encodingStyle="http://www.w3.org/2001/06/soap-encoding"
xmlns:m="http://example.org/2001/06/quotes" >
<Symbol>DEF</Symbol> <Company>DEF
Corp</Company> <Price>34.1</Price>
</m:GetLastTradePriceDetailed>
</env:Body></env:Envelope></P>
<P><BR>Similar to Example 1 but with multiple request parameters</P>
<P><BR>A.2 Sample Encoding of Response</P>
<P></P>
<P><BR>Example 49</P>
<P><BR>HTTP/1.1 200 OKContent-Type: text/xml;
charset="utf-8"Content-Length: nnnn<env:Envelope
xmlns:env="http://www.w3.org/2001/06/soap-envelope" >
<env:Header> <t:Transaction
xmlns:t="http://example.org/2001/06/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:int"
env:encodingStyle="http://www.w3.org/2001/06/soap-encoding"
env:mustUnderstand="1" > 5 </t:Transaction>
</env:Header> <env:Body> <m:GetLastTradePriceResponse
env:encodingStyle="http://www.w3.org/2001/06/soap-encoding"
xmlns:m="http://example.org/2001/06/quotes" >
<Price>34.5</Price> </m:GetLastTradePriceResponse>
</env:Body></env:Envelope></P>
<P><BR>Similar to Example 2 but with a Mandatory Header</P>
<P><BR> </P>
<P></P>
<P></P>
<P>Example 50</P>
<P><BR>HTTP/1.1 200 OKContent-Type: text/xml;
charset="utf-8"Content-Length: nnnn<env:Envelope
xmlns:env="http://www.w3.org/2001/06/soap-envelope" >
<env:Body> <m:GetLastTradePriceResponse
env:encodingStyle="http://www.w3.org/2001/06/soap-encoding"
xmlns:m="http://example.org/2001/06/quotes" >
<PriceAndVolume>
<LastTradePrice>34.5</LastTradePrice>
<DayVolume>10000</DayVolume> </PriceAndVolume>
</m:GetLastTradePriceResponse>
</env:Body></env:Envelope></P>
<P><BR>Similar to Example 2 but with a Struct</P>
<P><BR> </P>
<P></P>
<P></P>
<P>Example 51</P>
<P><BR>HTTP/1.1 500 Internal Server ErrorContent-Type: text/xml;
charset="utf-8"Content-Length: nnnn<env:Envelope
xmlns:env="http://www.w3.org/2001/06/soap-envelope">
<env:Body> <env:Fault>
<faultcode>env:MustUnderstand</faultcode>
<faultstring>SOAP Must Understand Error</faultstring>
</env:Fault> </env:Body></env:Envelope></P>
<P><BR>Similar to Example 2 but Failing to honor Mandatory
Header</P>
<P><BR> </P>
<P></P>
<P></P>
<P>Example 52</P>
<P><BR>HTTP/1.1 500 Internal Server ErrorContent-Type: text/xml;
charset="utf-8"Content-Length: nnnn<env:Envelope
xmlns:env="http://www.w3.org/2001/06/soap-envelope" >
<env:Body> <env:Fault>
<faultcode>env:Server</faultcode>
<faultstring>Server Error</faultstring> <detail>
<e:myfaultdetails xmlns:e="http://example.org/2001/06/faults"
> <message>My application didn't work</message>
<errorcode>1001</errorcode> </e:myfaultdetails>
</detail> </env:Fault>
</env:Body></env:Envelope></P>
<P><BR>Similar to Example 2 but Failing to handle Body</P>
<P><BR>B. Acknowledgements</P>
<P><BR>This document is the work of the W3C XML Protocol Working
Group.</P>
<P></P>
<P>Members of the Working Group are (at the time of writing, and by
alphabetical order): Yasser al Safadi (Philips Research), Vidur
Apparao (Netscape), Don Box (DevelopMentor), David Burdett (Commerce
One), Charles Campbell (Informix Software), Alex Ceponkus
(Bowstreet), Michael Champion (Software AG), David Clay (Oracle),
Ugo Corda (Xerox), Paul Cotton (Microsoft Corporation), Ron Daniel
(Interwoven), Glen Daniels (Allaire), Doug Davis (IBM), Ray
Denenberg (Library of Congress), Paul Denning (MITRE Corporation),
Frank DeRose (TIBCO Software, Inc.), Brian Eisenberg (Data Channel),
David Ezell (Hewlett-Packard), James Falek (TIBCO Software, Inc.),
David Fallside (IBM), Chris Ferris (Sun Microsystems), Daniela
Florescu (Propel), Dan Frantz (BEA Systems), Dietmar Gaertner
(Software AG), Scott Golubock (Epicentric), Rich Greenfield (Library
of Congress), Martin Gudgin (Develop Mentor), Hugo Haas (W3C), Marc
Hadley (Sun Microsystems), Mark Hale (Interwoven), Randy Hall
(Intel), Gerd Hoelzing (SAP AG), Oisin Hurley (IONA Technologies),
Yin-Leng Husband (Compaq), John Ibbotson (IBM), Ryuji Inoue
(Matsushita Electric Industrial Co., Ltd.), Scott Isaacson (Novell,
Inc.), Kazunori Iwasa (Fujitsu Software Corporation), Murali
Janakiraman (Rogue Wave), Mario Jeckle (Daimler-Chrysler Research
and Technology), Eric Jenkins (Engenia Software), Mark Jones
(AT&T), Jay Kasi (Commerce One), Jeffrey Kay (Engenia Software),
Richard Koo (Vitria Technology Inc.), Jacek Kopecky (IDOOX s.r.o.),
Alan Kropp (Epicentric), Yves Lafon (W3C), Tony Lee (Vitria
Technology Inc.), Michah Lerner (AT&T), Richard Martin (Active
Data Exchange), Noah Mendelsohn (Lotus Development), Nilo Mitra
(Ericsson Research Canada), Jean-Jacques Moreau (Canon), Masahiko
Narita (Fujitsu Software Corporation), Mark Needleman (Data Research
Associates), Eric Newcomer (IONA Technologies), Henrik Frystyk
Nielsen (Microsoft Corporation), Mark Nottingham (Akamai
Technologies), David Orchard (JamCracker), Kevin Perkins (Compaq),
Jags Ramnaryan (BEA Systems), Andreas Riegg (Daimler-Chrysler
Research and Technology), Hervé Ruellan (Canon), Marwan Sabbouh
(MITRE Corporation), Shane Sesta (Active Data Exchange), Miroslav
Simek (IDOOX s.r.o.), Simeon Simeonov (Allaire), Nick Smilonich
(Unisys), Soumitro Tagore (Informix Software), James Tauber
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -