Java Doc for SOAPFault.java in  » 6.0-JDK-Modules » saaj » javax » xml » soap » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » saaj » javax.xml.soap 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.xml.soap.SOAPFault

All known Subclasses:   com.sun.xml.messaging.saaj.soap.impl.FaultImpl,
SOAPFault
public interface SOAPFault extends SOAPBodyElement(Code)
An element in the SOAPBody object that contains error and/or status information. This information may relate to errors in the SOAPMessage object or to problems that are not related to the content in the message itself. Problems not related to the message itself are generally errors in processing, such as the inability to communicate with an upstream server.

Depending on the protocol specified while creating the MessageFactory instance, a SOAPFault has sub-elements as defined in the SOAP 1.1/SOAP 1.2 specification.





Method Summary
public  DetailaddDetail()
     Creates an optional Detail object and sets it as the Detail object for this SOAPFault object.

It is illegal to add a detail when the fault already contains a detail.

public  voidaddFaultReasonText(String text, java.util.Locale locale)
     Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale.
public  voidappendFaultSubcode(QName subcode)
     Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault.
public  DetailgetDetail()
     Returns the optional detail element for this SOAPFault object.

A Detail object carries application-specific error information, the scope of the error information is restricted to faults in the SOAPBodyElement objects if this is a SOAP 1.1 Fault.

public  StringgetFaultActor()
     Gets the fault actor for this SOAPFault object.
public  StringgetFaultCode()
     Gets the fault code for this SOAPFault object.
public  NamegetFaultCodeAsName()
     Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object. The SOAP 1.1 specification requires the value of the "faultcode" element to be of type QName.
public  QNamegetFaultCodeAsQName()
     Gets the fault code for this SOAPFault object as a QName object.
public  StringgetFaultNode()
     Returns the optional Node element value for this SOAPFault object.
public  IteratorgetFaultReasonLocales()
     Returns an Iterator over a distinct sequence of Locales for which there are associated Reason Text items.
public  StringgetFaultReasonText(Locale locale)
     Returns the Reason Text associated with the given Locale.
public  IteratorgetFaultReasonTexts()
     Returns an Iterator over a sequence of String objects containing all of the Reason Text items for this SOAPFault.
public  StringgetFaultRole()
     Returns the optional Role element value for this SOAPFault object.
public  StringgetFaultString()
     Gets the fault string for this SOAPFault object.
public  LocalegetFaultStringLocale()
     Gets the locale of the fault string for this SOAPFault object.
public  IteratorgetFaultSubcodes()
     Gets the Subcodes for this SOAPFault as an iterator over QNames.
public  booleanhasDetail()
     Returns true if this SOAPFault has a Detail subelement and false otherwise.
public  voidremoveAllFaultSubcodes()
     Removes any Subcodes that may be contained by this SOAPFault.
public  voidsetFaultActor(String faultActor)
     Sets this SOAPFault object with the given fault actor.
public  voidsetFaultCode(Name faultCodeQName)
     Sets this SOAPFault object with the given fault code.

Fault codes, which give information about the fault, are defined in the SOAP 1.1 specification.

public  voidsetFaultCode(QName faultCodeQName)
     Sets this SOAPFault object with the given fault code. It is preferable to use this method over SOAPFault.setFaultCode(Name) .
Parameters:
  faultCodeQName - a QName object giving the faultcode to be set.
public  voidsetFaultCode(String faultCode)
     Sets this SOAPFault object with the give fault code.

Fault codes, which given information about the fault, are defined in the SOAP 1.1 specification.

public  voidsetFaultNode(String uri)
     Creates or replaces any existing Node element value for this SOAPFault object.
public  voidsetFaultRole(String uri)
     Creates or replaces any existing Role element value for this SOAPFault object.
public  voidsetFaultString(String faultString)
     Sets the fault string for this SOAPFault object to the given string.
public  voidsetFaultString(String faultString, Locale locale)
     Sets the fault string for this SOAPFault object to the given string and localized to the given locale.



Method Detail
addDetail
public Detail addDetail() throws SOAPException(Code)
Creates an optional Detail object and sets it as the Detail object for this SOAPFault object.

It is illegal to add a detail when the fault already contains a detail. Therefore, this method should be called only after the existing detail has been removed. the new Detail object
exception:
  SOAPException - if thisSOAPFault object already contains avalid Detail object




addFaultReasonText
public void addFaultReasonText(String text, java.util.Locale locale) throws SOAPException(Code)
Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale. If a Reason Text item with this xml:lang already exists its text value will be replaced with text. The locale parameter should not be null

Code sample:

 SOAPFault fault = ...;
 fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH);
 

Parameters:
  text - -- reason message string
Parameters:
  locale - -- Locale object representing the locale of the message
exception:
  SOAPException - if there was an error in adding the Reason textor the locale passed was null.
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
since:
   SAAJ 1.3



appendFaultSubcode
public void appendFaultSubcode(QName subcode) throws SOAPException(Code)
Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault. Subcodes, which were introduced in SOAP 1.2, are represented by a recursive sequence of subelements rooted in the mandatory Code subelement of a SOAP Fault.
Parameters:
  subcode - a QName containing the Value of the Subcode.
exception:
  SOAPException - if there was an error in setting the Subcode
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Subcode.
since:
   SAAJ 1.3



getDetail
public Detail getDetail()(Code)
Returns the optional detail element for this SOAPFault object.

A Detail object carries application-specific error information, the scope of the error information is restricted to faults in the SOAPBodyElement objects if this is a SOAP 1.1 Fault. a Detail object with application-specificerror information if present, null otherwise




getFaultActor
public String getFaultActor()(Code)
Gets the fault actor for this SOAPFault object.

If this SOAPFault supports SOAP 1.2 then this call is equivalent to SOAPFault.getFaultRole() a String giving the actor in the message paththat caused this SOAPFault object
See Also:   SOAPFault.setFaultActor




getFaultCode
public String getFaultCode()(Code)
Gets the fault code for this SOAPFault object. a String with the fault code
See Also:   SOAPFault.getFaultCodeAsName
See Also:   SOAPFault.setFaultCode



getFaultCodeAsName
public Name getFaultCodeAsName()(Code)
Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object. The SOAP 1.1 specification requires the value of the "faultcode" element to be of type QName. This method returns the content of the element as a QName in the form of a SAAJ Name object. This method should be used instead of the getFaultCode method since it allows applications to easily access the namespace name without additional parsing. a Name representing the faultcode
See Also:   SOAPFault.setFaultCode(Name)
since:
   SAAJ 1.2



getFaultCodeAsQName
public QName getFaultCodeAsQName()(Code)
Gets the fault code for this SOAPFault object as a QName object. a QName representing the faultcode
See Also:   SOAPFault.setFaultCode(QName)
since:
   SAAJ 1.3



getFaultNode
public String getFaultNode()(Code)
Returns the optional Node element value for this SOAPFault object. The Node element is optional in SOAP 1.2. Content of the env:Fault/env:Node element as a Stringor null if none
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Node.
since:
   SAAJ 1.3



getFaultReasonLocales
public Iterator getFaultReasonLocales() throws SOAPException(Code)
Returns an Iterator over a distinct sequence of Locales for which there are associated Reason Text items. Any of these Locales can be used in a call to getFaultReasonText in order to obtain a localized version of the Reason Text string. an Iterator over a sequence of Localeobjects for which there are associated Reason Text items.
exception:
  SOAPException - if there was an error in retrieving the fault Reason locales.
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
since:
   SAAJ 1.3



getFaultReasonText
public String getFaultReasonText(Locale locale) throws SOAPException(Code)
Returns the Reason Text associated with the given Locale. If more than one such Reason Text exists the first matching Text is returned
Parameters:
  locale - -- the Locale for which a localized Reason Text is desired the Reason Text associated with locale
See Also:   SOAPFault.getFaultString
exception:
  SOAPException - if there was an error in retrieving the fault Reason text for the specified locale .
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
since:
   SAAJ 1.3



getFaultReasonTexts
public Iterator getFaultReasonTexts() throws SOAPException(Code)
Returns an Iterator over a sequence of String objects containing all of the Reason Text items for this SOAPFault. an Iterator over env:Fault/env:Reason/env:Text items.
exception:
  SOAPException - if there was an error in retrieving the fault Reason texts.
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
since:
   SAAJ 1.3



getFaultRole
public String getFaultRole()(Code)
Returns the optional Role element value for this SOAPFault object. The Role element is optional in SOAP 1.2. Content of the env:Fault/env:Role element as a Stringor null if none
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
since:
   SAAJ 1.3



getFaultString
public String getFaultString()(Code)
Gets the fault string for this SOAPFault object.

If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to:

 String reason = null;
 try {
 reason = (String) getFaultReasonTexts().next();
 } catch (SOAPException e) {}
 return reason;
 
a String giving an explanation ofthe fault
See Also:   SOAPFault.setFaultString(String)
See Also:   SOAPFault.setFaultString(String,Locale)



getFaultStringLocale
public Locale getFaultStringLocale()(Code)
Gets the locale of the fault string for this SOAPFault object.

If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to:

 Locale locale = null;
 try {
 locale = (Locale) getFaultReasonLocales().next();
 } catch (SOAPException e) {}
 return locale;
 
a Locale object indicating the native language ofthe fault string or null if no locale was specified
See Also:   SOAPFault.setFaultString(String,Locale)
since:
   SAAJ 1.2



getFaultSubcodes
public Iterator getFaultSubcodes()(Code)
Gets the Subcodes for this SOAPFault as an iterator over QNames. an Iterator that accesses a sequence of QNames. This Iterator should not supportthe optional remove method. The order in which the Subcodes are returned reflects the hierarchy of Subcodes present in the fault from top to bottom.
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Subcode.
since:
   SAAJ 1.3



hasDetail
public boolean hasDetail()(Code)
Returns true if this SOAPFault has a Detail subelement and false otherwise. Equivalent to (getDetail()!=null). true if this SOAPFault has a Detailsubelement and false otherwise.
since:
   SAAJ 1.3



removeAllFaultSubcodes
public void removeAllFaultSubcodes()(Code)
Removes any Subcodes that may be contained by this SOAPFault. Subsequent calls to getFaultSubcodes will return an empty iterator until a call to appendFaultSubcode is made.
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Subcode.
since:
   SAAJ 1.3



setFaultActor
public void setFaultActor(String faultActor) throws SOAPException(Code)
Sets this SOAPFault object with the given fault actor.

The fault actor is the recipient in the message path who caused the fault to happen.

If this SOAPFault supports SOAP 1.2 then this call is equivalent to SOAPFault.setFaultRole(String)
Parameters:
  faultActor - a String identifying the actor thatcaused this SOAPFault object
See Also:   SOAPFault.getFaultActor
exception:
  SOAPException - if there was an error in adding thefaultActor to the underlying XML tree.




setFaultCode
public void setFaultCode(Name faultCodeQName) throws SOAPException(Code)
Sets this SOAPFault object with the given fault code.

Fault codes, which give information about the fault, are defined in the SOAP 1.1 specification. A fault code is mandatory and must be of type Name. This method provides a convenient way to set a fault code. For example,

 SOAPEnvelope se = ...;
 // Create a qualified name in the SOAP namespace with a localName
 // of "Client". Note that prefix parameter is optional and is null
 // here which causes the implementation to use an appropriate prefix.
 Name qname = se.createName("Client", null,
 SOAPConstants.URI_NS_SOAP_ENVELOPE);
 SOAPFault fault = ...;
 fault.setFaultCode(qname);
 
It is preferable to use this method over SOAPFault.setFaultCode(String) .
Parameters:
  faultCodeQName - a Name object giving the faultcode to be set. It must be namespace qualified.
See Also:   SOAPFault.getFaultCodeAsName
exception:
  SOAPException - if there was an error in adding thefaultcode element to the underlying XML tree.
since:
   SAAJ 1.2



setFaultCode
public void setFaultCode(QName faultCodeQName) throws SOAPException(Code)
Sets this SOAPFault object with the given fault code. It is preferable to use this method over SOAPFault.setFaultCode(Name) .
Parameters:
  faultCodeQName - a QName object giving the faultcode to be set. It must be namespace qualified.
See Also:   SOAPFault.getFaultCodeAsQName
exception:
  SOAPException - if there was an error in adding thefaultcode element to the underlying XML tree.
See Also:   SOAPFault.setFaultCode(Name)
See Also:   SOAPFault.getFaultCodeAsQName()
since:
   SAAJ 1.3



setFaultCode
public void setFaultCode(String faultCode) throws SOAPException(Code)
Sets this SOAPFault object with the give fault code.

Fault codes, which given information about the fault, are defined in the SOAP 1.1 specification. This element is mandatory in SOAP 1.1. Because the fault code is required to be a QName it is preferable to use the SOAPFault.setFaultCode(Name) form of this method.
Parameters:
  faultCode - a String giving the fault code to be set.It must be of the form "prefix:localName" where the prefix hasbeen defined in a namespace declaration.
See Also:   SOAPFault.setFaultCode(Name)
See Also:   SOAPFault.getFaultCode
See Also:   SOAPElement.addNamespaceDeclaration
exception:
  SOAPException - if there was an error in adding thefaultCode to the underlying XML tree.




setFaultNode
public void setFaultNode(String uri) throws SOAPException(Code)
Creates or replaces any existing Node element value for this SOAPFault object. The Node element is optional in SOAP 1.2.
exception:
  SOAPException - if there was an error in setting theNode for this SOAPFault object.
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Node.
since:
   SAAJ 1.3



setFaultRole
public void setFaultRole(String uri) throws SOAPException(Code)
Creates or replaces any existing Role element value for this SOAPFault object. The Role element is optional in SOAP 1.2.
Parameters:
  uri - - the URI of the Role
exception:
  SOAPException - if there was an error in setting theRole for this SOAPFault object.
exception:
  UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
since:
   SAAJ 1.3



setFaultString
public void setFaultString(String faultString) throws SOAPException(Code)
Sets the fault string for this SOAPFault object to the given string.

If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to:

 addFaultReasonText(faultString, Locale.getDefault());
 

Parameters:
  faultString - a String giving an explanation ofthe fault
See Also:   SOAPFault.getFaultString
exception:
  SOAPException - if there was an error in adding thefaultString to the underlying XML tree.



setFaultString
public void setFaultString(String faultString, Locale locale) throws SOAPException(Code)
Sets the fault string for this SOAPFault object to the given string and localized to the given locale.

If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to:

 addFaultReasonText(faultString, locale);
 

Parameters:
  faultString - a String giving an explanation ofthe fault
Parameters:
  locale - a java.util.Locale Locale object indicatingthe native language of the faultString
See Also:   SOAPFault.getFaultString
exception:
  SOAPException - if there was an error in adding thefaultString to the underlying XML tree.
since:
   SAAJ 1.2



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.