axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thil...@apache.org
Subject svn commit: r509185 - /webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
Date Mon, 19 Feb 2007 12:45:16 GMT
Author: thilina
Date: Mon Feb 19 04:45:15 2007
New Revision: 509185

URL: http://svn.apache.org/viewvc?view=rev&rev=509185
Log:
Checking for null headers

Modified:
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java?view=diff&rev=509185&r1=509184&r2=509185
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
Mon Feb 19 04:45:15 2007
@@ -173,8 +173,6 @@
     private SOAPMessage getSOAPMessage(org.apache.axiom.soap.SOAPEnvelope respOMSoapEnv)
             throws SOAPException {
 
-        System.err.println("####### respOMSoapEnv=" + respOMSoapEnv);
-
         // Create the basic SOAP Message
         MessageFactory mf = MessageFactory.newInstance();
         SOAPMessage response = mf.createMessage();
@@ -183,38 +181,37 @@
         SOAPBody body = env.getBody();
         SOAPHeader header = env.getHeader();
 
-        //Convert all header blocks
-        for (Iterator hbIter = respOMSoapEnv.getHeader().examineAllHeaderBlocks();
-             hbIter.hasNext();) {
+        // Convert all header blocks
+		org.apache.axiom.soap.SOAPHeader header2 = respOMSoapEnv.getHeader();
+		if (header2 != null) {
+			for (Iterator hbIter = header2.examineAllHeaderBlocks(); hbIter.hasNext();) {
 
-            // Converting a single OM SOAP HeaderBlock to a SAAJ SOAP HeaderBlock
-            org.apache.axiom.soap.SOAPHeaderBlock hb =
-                    (org.apache.axiom.soap.SOAPHeaderBlock) hbIter.next();
-            final QName hbQName = hb.getQName();
-            final SOAPHeaderElement headerEle =
-                    header.addHeaderElement(env.createName(hbQName.getLocalPart(),
-                                                           hbQName.getPrefix(),
-                                                           hbQName.getNamespaceURI()));
-            for (Iterator attribIter = hb.getAllAttributes(); attribIter.hasNext();) {
-                OMAttribute attr = (OMAttribute) attribIter.next();
-                final QName attrQName = attr.getQName();
-                headerEle.addAttribute(env.createName(attrQName.getLocalPart(),
-                                                      attrQName.getPrefix(),
-                                                      attrQName.getNamespaceURI()),
-                                       attr.getAttributeValue());
-            }
-            final String role = hb.getRole();
-            if (role != null) {
-                headerEle.setActor(role);
-            }
-            headerEle.setMustUnderstand(hb.getMustUnderstand());
+				// Converting a single OM SOAP HeaderBlock to a SAAJ SOAP
+				// HeaderBlock
+				org.apache.axiom.soap.SOAPHeaderBlock hb = (org.apache.axiom.soap.SOAPHeaderBlock) hbIter
+						.next();
+				final QName hbQName = hb.getQName();
+				final SOAPHeaderElement headerEle = header.addHeaderElement(env.createName(hbQName
+						.getLocalPart(), hbQName.getPrefix(), hbQName.getNamespaceURI()));
+				for (Iterator attribIter = hb.getAllAttributes(); attribIter.hasNext();) {
+					OMAttribute attr = (OMAttribute) attribIter.next();
+					final QName attrQName = attr.getQName();
+					headerEle.addAttribute(env.createName(attrQName.getLocalPart(), attrQName
+							.getPrefix(), attrQName.getNamespaceURI()), attr.getAttributeValue());
+				}
+				final String role = hb.getRole();
+				if (role != null) {
+					headerEle.setActor(role);
+				}
+				headerEle.setMustUnderstand(hb.getMustUnderstand());
 
-            toSAAJElement(headerEle, hb, response);
-        }
+				toSAAJElement(headerEle, hb, response);
+			}
+		}
 
         // Convert the body
         toSAAJElement(body, respOMSoapEnv.getBody(), response);
-        //if there are unrefferenced attachments, add that to response
+        // if there are unrefferenced attachments, add that to response
         if(!unaccessedAttachments.isEmpty()){
         	Collection attachments = unaccessedAttachments.values();
         	Iterator attachementsIterator = attachments.iterator();



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message