Nullpointer in SimpleSoapClient when sending empty bodies 
----------------------------------------------------------

                 Key: MUSE-56
                 URL: http://issues.apache.org/jira/browse/MUSE-56
             Project: Muse
          Issue Type: Bug
    Affects Versions: 2.0.0 M2
         Environment: any
            Reporter: Mohammad Fakhar
         Assigned To: Dan Jemiolo
         Attachments: SimpleSoapClient.java

When I send empty bodies using SimpleSoapClient, I get a null pointer exception:

java.lang.NullPointerException
        at 
org.apache.muse.ws.addressing.soap.SimpleSoapClient.createMessage(SimpleSoapClient.java:117)
        at 
org.apache.muse.ws.addressing.soap.SimpleSoapClient.send(SimpleSoapClient.java:213)

The following is a diff of the fix, I have attached source as well:

Index: SimpleSoapClient.java
===================================================================
RCS file: 
/cvs/cowbell/muse-wsa-soap/src/org/apache/muse/ws/addressing/soap/SimpleSoapClient.java,v
retrieving revision 1.4
diff -u -r1.4 SimpleSoapClient.java
--- SimpleSoapClient.java       2 Aug 2006 17:34:31 -0000       1.4
+++ SimpleSoapClient.java       14 Aug 2006 22:54:38 -0000
@@ -114,10 +114,14 @@
         
         for (int n = 0; n < bodyElements.length; ++n)
         {
+          if(bodyElements[n] != null)
+          {
+
             if (bodyElements[n].getOwnerDocument() != doc)
                 bodyElements[n] = (Element)doc.importNode(bodyElements[n], 
true);
             
             bodyXML.appendChild(bodyElements[n]);
+          }
         }
         
         return soapXML;



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to