You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Steven McDowall <sj...@aptest.com> on 2000/07/19 19:35:36 UTC
RE: faultcodes (w/ namespaces) - CODE
Well, I haven't heard back from any of the XML guru's on whether a namespace
is allowed on the faultcode element (and faultstring, etc)..
So, on the assumption that it wouldn't hurt to ALLOW it (and ignore it), I
changed the Fault.java code to skip past anything namespace smelling (i.e.
grab stuff after the last ":" is found..)
At the same time, I reduced the code somewhat and I think made it a bit
cleaner
and faster (removing multiple calls to the getTagName() method..)
Here is the code in diff format for someone who CAN update the source to do
so...
Please let me know if this is correct and useful.. :-)
Index: Fault.java
===================================================================
RCS file: /home/cvspublic/xml-soap/java/src/org/apache/soap/Fault.java,v
retrieving revision 1.2
diff -r1.2 Fault.java
255,256c255,264
< if (tempEl != null
< && tempEl.getTagName().equals(Constants.ELEM_FAULT_CODE))
---
> String tagName = tempEl.getTagName() ;
>
> // If a namespace is given, ignore it by just grabbing the
right
> // most part...
> int nsCharPos = tagName.lastIndexOf(":") ;
> if ( nsCharPos > 0 ) // found a : seperator
> tagName = tagName.substring( nsCharPos + 1 ) ;
>
> // Now check to see what part of the Fault body we have..
> if (tagName.equals(Constants.ELEM_FAULT_CODE))
260,261c268
< else if (tempEl != null
< &&
tempEl.getTagName().equals(Constants.ELEM_FAULT_STRING))
---
> else if (tagName.equals(Constants.ELEM_FAULT_STRING))
265,266c272
< else if (tempEl != null
< &&
tempEl.getTagName().equals(Constants.ELEM_FAULT_ACTOR))
---
> else if (tagName.equals(Constants.ELEM_FAULT_ACTOR))
270,271c276
< else if (tempEl != null
< && tempEl.getTagName().equals(Constants.ELEM_DETAIL))
---
> else if (tagName.equals(Constants.ELEM_DETAIL))
-----Original Message-----
From: Steven J. McDowall [mailto:sjmcdowall@uswest.net]
Sent: Tuesday, July 18, 2000 10:21 PM
To: Soap-Dev@Xml. Apache. Org
Subject: faultcodes (w/ namespaces) and SOAPAction
1) I sent an email to dev a couple of days ago whining about the
fact that "'s are automatically surrounding the SOAPAction given in
the invoke() call..
I even gave the code to change it.. :-)
Having re-read the specs though, I see that ";s are explicitly required
for SOAPAction ..
soapaction = "SOAPACTION:" [ <"> string <">]
to be exact.. :-)
So, let's not put my suggestion in place after all :-)
2) faultcodes...
I am getting a thrown exception about "faultcode required" error for a
faultcode I am receiving.. the problem
is I am getting
<SOAP-ENV:faultcode>Server</SOAP-ENV:faultcode>
Looking at the code, it is only looking for "faultcode", and thus
SOAP-ENV:faultcode fails..
In general, isn't SOAP-ENV:faultcode (i.e. namespace:faultcode) allowed? If
so, is thisa bug we need to fix??
-Steve
RE: faultcodes (w/ namespaces) - CODE
Posted by Steven McDowall <sj...@aptest.com>.
Before we lose this... :-)
After much research I still don't see where this code is wrong since from
what
I can tell,
1) local elements CAN be non-namespaced qualified
2) I don't see anything anywhere we it says they MUST, and more importantly,
where it says that you CAN'T use a namespace qualifier..
Thus, I still think that we should allow (and probably politely ignore) a
namespace qualifier on the Fault local elements...
Can we get SOME agreement on this and either implement the code I gave
(repeated
below) or at least put some rationale on why we aren't doing it?
It is more than a little frustrating to take the time and develop code
fixes to have them simply ignored ...
-Steve
-----Original Message-----
From: Steven McDowall [mailto:sjm@aptest.com]
Sent: Wednesday, July 19, 2000 12:36 PM
To: soap-dev@xml.apache.org
Subject: RE: faultcodes (w/ namespaces) - CODE
Index: Fault.java
===================================================================
RCS file: /home/cvspublic/xml-soap/java/src/org/apache/soap/Fault.java,v
retrieving revision 1.2
diff -r1.2 Fault.java
255,256c255,264
< if (tempEl != null
< && tempEl.getTagName().equals(Constants.ELEM_FAULT_CODE))
---
> String tagName = tempEl.getTagName() ;
>
> // If a namespace is given, ignore it by just grabbing the
right
> // most part...
> int nsCharPos = tagName.lastIndexOf(":") ;
> if ( nsCharPos > 0 ) // found a : seperator
> tagName = tagName.substring( nsCharPos + 1 ) ;
>
> // Now check to see what part of the Fault body we have..
> if (tagName.equals(Constants.ELEM_FAULT_CODE))
260,261c268
< else if (tempEl != null
< &&
tempEl.getTagName().equals(Constants.ELEM_FAULT_STRING))
---
> else if (tagName.equals(Constants.ELEM_FAULT_STRING))
265,266c272
< else if (tempEl != null
< &&
tempEl.getTagName().equals(Constants.ELEM_FAULT_ACTOR))
---
> else if (tagName.equals(Constants.ELEM_FAULT_ACTOR))
270,271c276
< else if (tempEl != null
< && tempEl.getTagName().equals(Constants.ELEM_DETAIL))
---
> else if (tagName.equals(Constants.ELEM_DETAIL))
RE: faultcodes (w/ namespaces) - CODE
Posted by Steven McDowall <sj...@aptest.com>.
Before we lose this... :-)
After much research I still don't see where this code is wrong since from
what
I can tell,
1) local elements CAN be non-namespaced qualified
2) I don't see anything anywhere we it says they MUST, and more importantly,
where it says that you CAN'T use a namespace qualifier..
Thus, I still think that we should allow (and probably politely ignore) a
namespace qualifier on the Fault local elements...
Can we get SOME agreement on this and either implement the code I gave
(repeated
below) or at least put some rationale on why we aren't doing it?
It is more than a little frustrating to take the time and develop code
fixes to have them simply ignored ...
-Steve
-----Original Message-----
From: Steven McDowall [mailto:sjm@aptest.com]
Sent: Wednesday, July 19, 2000 12:36 PM
To: soap-dev@xml.apache.org
Subject: RE: faultcodes (w/ namespaces) - CODE
Index: Fault.java
===================================================================
RCS file: /home/cvspublic/xml-soap/java/src/org/apache/soap/Fault.java,v
retrieving revision 1.2
diff -r1.2 Fault.java
255,256c255,264
< if (tempEl != null
< && tempEl.getTagName().equals(Constants.ELEM_FAULT_CODE))
---
> String tagName = tempEl.getTagName() ;
>
> // If a namespace is given, ignore it by just grabbing the
right
> // most part...
> int nsCharPos = tagName.lastIndexOf(":") ;
> if ( nsCharPos > 0 ) // found a : seperator
> tagName = tagName.substring( nsCharPos + 1 ) ;
>
> // Now check to see what part of the Fault body we have..
> if (tagName.equals(Constants.ELEM_FAULT_CODE))
260,261c268
< else if (tempEl != null
< &&
tempEl.getTagName().equals(Constants.ELEM_FAULT_STRING))
---
> else if (tagName.equals(Constants.ELEM_FAULT_STRING))
265,266c272
< else if (tempEl != null
< &&
tempEl.getTagName().equals(Constants.ELEM_FAULT_ACTOR))
---
> else if (tagName.equals(Constants.ELEM_FAULT_ACTOR))
270,271c276
< else if (tempEl != null
< && tempEl.getTagName().equals(Constants.ELEM_DETAIL))
---
> else if (tagName.equals(Constants.ELEM_DETAIL))