eclipse-ee4j / metro-saaj

https://eclipse-ee4j.github.io/metro-saaj/
Other
13 stars 16 forks source link

SOAP faultcode QName processing is incorrect #28

Closed Tomas-Kraus closed 16 years ago

Tomas-Kraus commented 17 years ago

When a fault contains a faultcode element without a prefix an exception is thrown:

"No NamespaceURI, SOAP requires faultcode content to be a QName"

As far as I can tell it is perfectly valid for a qualified name to have only a local part:

"[7] QName ::= PrefixedName | UnprefixedName" http://www.w3.org/TR/REC-xml-names/#ns-qualnames

the soap specification does say that elements must be namespace qualified:

http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507 (last para)

but does not say this applies to the faultcode qualified name also.

This would seem to allow unprefixed QNames in the default namespace URI:

CustomCode

However, even if the specifications do not support this, it seems better to be tolerant of non-compliant fault formats than to throw this error (which will make the actual fault information harder to locate)

Environment

Operating System: All Platform: All

Affected Versions

[current]

Tomas-Kraus commented 6 years ago
Tomas-Kraus commented 17 years ago

@glassfishrobot Commented Reported by sjones4

Tomas-Kraus commented 17 years ago

@glassfishrobot Commented @vbkumarjayanti said: Thanks for filing the issue.

I have made a Fix, Please pickup the latest from :

https://saaj.dev.java.net/servlets/ProjectDocumentList?folderID=5118&expandFolder=5118&folderID=0

If you are satisfied, please close the issue.

Thanks.

Tomas-Kraus commented 17 years ago

@glassfishrobot Commented sjones4 said: Thanks for the fast response.

Unfortunately this fix brings to light another issue.

When a "Standard" fault code is used and the namespace is not SOAP 1.1 the following exception is thrown:

Namespace Error, Standard Faultcode: Client, should be in SOAP 1.1 Namespace

I agree that it is bad practice to use standard local names for faultcodes outside of the SOAP 1.1 namespace, but perhaps this could just be logged at FINE or INFO rather than SEVERE logging plus exception.

I've reopened this issue, but if you would prefer this raised as a separate issue please close and comment to that effect.

Thanks for your help.

Tomas-Kraus commented 16 years ago

@glassfishrobot Commented @vbkumarjayanti said: Fixed.

Tomas-Kraus commented 16 years ago

@glassfishrobot Commented sjones4 said: Closing issue.

I originally found this problem with JAX-WS and a work around (in case someone is not able to update the the latest SAAJ with this fix) is to implement a SOAPHandler.

The SOAPHandler can modify the message structure to create a strictly correct Fault (faultcode prefix, namespaces, etc). This fault fixing would need to occur in both the "handleFault" and "handleMessage" methods (as "handleMessage" is called if the response HTTP status code is not 500).

Tomas-Kraus commented 17 years ago

@glassfishrobot Commented Was assigned to saaj-issues

Tomas-Kraus commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA SAAJ-28

Tomas-Kraus commented 16 years ago

@glassfishrobot Commented Marked as fixed on Thursday, November 22nd 2007, 1:23:00 am