axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <g...@thoughtcraft.com>
Subject RE: WS-I testing: warnings about faultcode
Date Fri, 03 Sep 2004 13:43:13 GMT

Hi folks:

Personally, I think WS-I was a little overbearing (as it was in a lot of
cases, IMHO) when it disallowed the dot notation.  The dot notation for SOAP
1.1 allows, to some extent, the same kind of fault code layering that SOAP
1.2 does.  You can know, even if you don't understand what a
"generalException" is, that the fault was caused by the Server.  This is
useful, for instance, when you want to figure out if resending the message
might have a chance of succeeding - if you see a "Client" fault, you know
that you did something wrong, and don't bother resending without changes.
If you see a "Server" fault, though, you might wait a while and try
again....

My preference is to leave things as they are.  If these changes do get made,
please confirm sure that we're correctly setting the codes in SOAP 1.2 -
note that SOAP 1.2 ONLY allows a specific set of top-level fault codes
(VersionMismatch, MustUnderstand, DataEncodingUnknown, Sender, Receiver).

--Glen


> -----Original Message-----
> From: Ias [mailto:iasandcb@hotmail.com] 
> Sent: Friday, September 03, 2004 4:50 AM
> To: axis-dev@ws.apache.org
> Subject: RE: WS-I testing: warnings about faultcode
> 
> I'm +1 for your way :-)
> 
> Regards,
> 
> Ias
> 
> > -----Original Message-----
> > From: Jarek Gawor [mailto:gawor@mcs.anl.gov]
> > Sent: Friday, September 03, 2004 6:06 AM
> > To: axis-dev@ws.apache.org
> > Subject: RE: WS-I testing: warnings about faultcode
> > 
> > > -----Original Message-----
> > > From: Ias [mailto:iasandcb@hotmail.com]
> > > Sent: Monday, August 30, 2004 6:27 PM
> > > To: axis-dev@ws.apache.org
> > > Subject: RE: WS-I testing: warnings about faultcode
> > > 
> > > 
> > > > I was running the WS-I BP validation tools against the
> > wire messages
> > > > produced by Axis on our software. Two assertion warnings
> > related to
> > > > faultcode were raised:
> > > > 
> > > > WSI1031: A soap:Fault element makes use of the SOAP 1.1 dot
> > > notation.
> > > > 
> > > > WSI1302: The soap:faultcode value in the soap:Fault
> > element of the
> > > > response message is not one of: VersionMismatch, 
> MustUnderstand, 
> > > > Client, Server, or is not qualified by a namespace.
> > > > 
> > > > The faultcode of the fault was (which is generated by default by
> > > > Axis):
> > > > 
> > > > <faultcode>soapenv:Server.generalException</faultcode>
> > > > 
> > > > I'm wondering what people think about fixing this in Axis
> > since it
> > > > is a minor issue and it does not cause the validation to fail.
> > > 
> > > Thanks for raising up the issue. Here's my ideas on it:
> > > 
> > > The one approach is changing
> > > 
> > >     public static final String FAULT_SERVER_GENERAL =
> > >  
> > > "Server.generalException";
> > > 
> > >     public static final String FAULT_SERVER_USER =
> > >                                                    
> > > "Server.userException";
> > > 
> > > in Constants to
> > > 
> > >     public static final String FAULT_SERVER_GENERAL =
> > >                                                    "Server";
> > > 
> > >     public static final String FAULT_SERVER_USER =
> > >                                                    "Server";
> > > 
> > > i.e. making no difference between general exceptions and user 
> > > exceptions. This approach is fairly simple :-)
> > > 
> > > The other approach is related to AxisFault's 
> setFaultCodeAsString, 
> > > which simply makes the namespace of a give fault code the
> > URI of the
> > > SOAP envelope containing the fault. First, we need to 
> change those 
> > > constants above to
> > > 
> > >     public static final String FAULT_SERVER_GENERAL =
> > >                                                    
> > > "ServerGeneralException";
> > > 
> > >     public static final String FAULT_SERVER_USER =
> > >                                                    
> > > "ServerUserException";
> > > 
> > > 
> > > , then change
> > > 
> > >     public void setFaultCodeAsString(String code) {
> > >         SOAPConstants soapConstants =
> > > MessageContext.getCurrentContext() == null ?
> > >                                         
> > > SOAPConstants.SOAP11_CONSTANTS :
> > >  
> > > MessageContext.getCurrentContext().getSOAPConstants();
> > > 
> > >         faultCode = new 
> QName(soapConstants.getEnvelopeURI(), code);
> > >     }
> > > 
> > > to
> > > 
> > >     public void setFaultCodeAsString(String code) {
> > >         SOAPConstants soapConstants =
> > > MessageContext.getCurrentContext() == null ?
> > >                                         
> > > SOAPConstants.SOAP11_CONSTANTS :
> > >  
> > > MessageContext.getCurrentContext().getSOAPConstants();
> > > 
> > >         if (code.equals("VersionMismatch") ||
> > >            code.equals("MustUnderstand") ||
> > >            code.equals("Client") ||
> > >            code.equals("Server")) {	
> > > 	faultCode = new QName(soapConstants.getEnvelopeURI(), code);
> > >         } else {
> > > 	faultCode = new QName(Constants.NS_URI_AXIS, code);
> > >         }
> > > 
> > > I think adopting both ideas could be better for clear and
> > safe server
> > > fault codes.
> > 
> > I like the combination of two. I would suggest changing the 
> > FAULT_SERVER_GENERAL to "Server" and FAULT_SERVER_USER to 
> > "ServerUserException" and adopting the suggested
> > setFaultCodeAsString() method. 
> > I'll go ahead and make the changes if there are no 
> objections to these 
> > modifications.
> > 
> > Jarek
> > 
> > 
> > 
> > 
> 
> 

Mime
View raw message