You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by aj...@apache.org on 2005/01/31 15:28:50 UTC
svn commit: r149263 - in
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis:
encoding/OutObjectArrayImpl.java engine/AxisEngine.java
engine/ExecutionChain.java impl/llom/OMElementImpl.java
impl/llom/util/StreamWriterToContentHandlerConverter.java
Author: ajith
Date: Mon Jan 31 06:28:46 2005
New Revision: 149263
URL: http://svn.apache.org/viewcvs?view=rev&rev=149263
Log:
Changed to fix a bug in serialization
Modified:
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/OutObjectArrayImpl.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/util/StreamWriterToContentHandlerConverter.java
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/OutObjectArrayImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/OutObjectArrayImpl.java?view=diff&r1=149262&r2=149263
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/OutObjectArrayImpl.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/OutObjectArrayImpl.java Mon Jan 31 06:28:46 2005
@@ -35,10 +35,10 @@
public void startBuilding(ContentHandler cHandler) throws OMException {
try {
for(int i = 0;i<obj.length;i++){
- cHandler.startElement(OMConstants.ARRAY_ITEM_NSURI,OMConstants.ARRAY_ITEM_LOCALNAME,"",null);
+ cHandler.startElement(OMConstants.ARRAY_ITEM_NSURI,OMConstants.ARRAY_ITEM_LOCALNAME,OMConstants.ARRAY_ITEM_QNAME,null);
arrayTypeEncoder.setObject(obj[i]);
arrayTypeEncoder.startBuilding(cHandler);
- cHandler.endElement(OMConstants.ARRAY_ITEM_NSURI,OMConstants.ARRAY_ITEM_LOCALNAME,"");
+ cHandler.endElement(OMConstants.ARRAY_ITEM_NSURI,OMConstants.ARRAY_ITEM_LOCALNAME,OMConstants.ARRAY_ITEM_QNAME);
}
} catch (SAXException e) {
throw new OMException(e);
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java?view=diff&r1=149262&r2=149263
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java Mon Jan 31 06:28:46 2005
@@ -66,14 +66,14 @@
//Start rolling the Service Handlers will,be added by the Dispatcher
chain.invoke(context);
- } catch (AxisFault e) {
+ } catch (Throwable e) {
handleFault(context, e);
}
}
private void handleFault(
MessageContext context,
- AxisFault e)
+ Throwable e)
throws AxisFault {
boolean serverSide = context.isServerSide();
if(serverSide && !context.isProcessingFault()){
@@ -84,13 +84,13 @@
SOAPEnvelope envelope =
OMFactory.newInstance().getDefaultEnvelope();
//TODO do we need to set old Headers back?
- envelope.getBody().addFault(e);
+ envelope.getBody().addFault(new AxisFault("",e));
context.setEnvelope(envelope);
//send the error
executeOutFlow(context,EngineRegistry.FAULTFLOW);
}else if (!serverSide){
//if at the client side throw the exception
- throw e;
+ throw new AxisFault("",e);
}else{
//TODO log and exit
log.error("Error in fault flow", e);
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java?view=diff&r1=149262&r2=149263
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java Mon Jan 31 06:28:46 2005
@@ -66,6 +66,9 @@
}
}
} catch (Exception e) {
+ /////////////
+ e.printStackTrace();
+ ////////////////
while (!executionStack.isEmpty()) {
Handler handler = (Handler) executionStack.pop();
handler.revoke(msgctx);
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java?view=diff&r1=149262&r2=149263
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java Mon Jan 31 06:28:46 2005
@@ -459,6 +459,7 @@
} else {
//do the special serialization
//Only the push serializer is left now
+ builder.setCache(cache);
builder.next();
}
@@ -471,7 +472,10 @@
} else {
//do the special serilization
//Only the push serializer is left now
+ builder.setCache(cache);
+ namespaceCount = serializeStartpart(writer);
builder.next();
+ serializeEndpart(writer, namespaceCount);
}
@@ -532,7 +536,7 @@
private void serializeNormal(XMLStreamWriter writer, boolean cache) throws XMLStreamException {
- int namespaceCount = serializeStartpart(writer);
+ int namespaceCount = serializeStartpart(writer);
if (getFirstChild() != null) {
getFirstChild().serialize(writer, cache, namespaceStack);
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/util/StreamWriterToContentHandlerConverter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/util/StreamWriterToContentHandlerConverter.java?view=diff&r1=149262&r2=149263
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/util/StreamWriterToContentHandlerConverter.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/util/StreamWriterToContentHandlerConverter.java Mon Jan 31 06:28:46 2005
@@ -105,14 +105,15 @@
else
writer.writeStartElement(qname.getPrefix(), qname.getLocalName(),namespaceURI);
- int attCount = atts.getLength();
- for (int i = 0; i < attCount; i++) {
- qname = breakUpSaxQname(atts.getQName(i));
- writer.writeAttribute(atts.getURI(i),
- qname.getLocalName(),
- atts.getValue(i));
+ if (atts!=null){
+ int attCount = atts.getLength();
+ for (int i = 0; i < attCount; i++) {
+ qname = breakUpSaxQname(atts.getQName(i));
+ writer.writeAttribute(atts.getURI(i),
+ qname.getLocalName(),
+ atts.getValue(i));
+ }
}
- writer.flush();
} catch (XMLStreamException e) {
throw new SAXException(e);
}