?? 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 + -