Contributions
ERROR:java.lang.NullPointerException: Cannot get property 'message' on null object
Friends, I am trying to add "Content-Disposition" header to one of the parts of multi part SOAP request which is not adding by default if I use Inline Files feature of SoapUI Pro to send a file as anattachment. I have followed below KB article to add this part header using RequestFilter.filterrequest Event handler but I am getting "ERROR:java.lang.NullPointerException: Cannot get property 'message' on null object" Any hints to fix this? KB Article: https://smartbear-cc.force.com/portal/KbArticleViewer?name=Troubleshooting-issues-with-adding-attachments-to-REST-requests&sp=all My Groovy Script from RequestFilter.filterrequest Event: import org.apache.http.client.methods.HttpRequestBase import com.eviware.soapui.impl.wsdl.submit.transports.http.BaseHttpRequestTransport HttpRequestBase httpMethod = (HttpRequestBase) context.getProperty(BaseHttpRequestTransport.HTTP_METHOD) def count = context.getProperty("httpMethod").requestEntity.message.content.count for (def i=1; i < count; i++) { def bodyPart = context.getProperty("httpMethod").requestEntity.message.content.getBodyPart(i) bodyPart.removeHeader("Content-Disposition") bodyPart.addHeader("Content-Disposition", "attachment; name=\"Base64Content.txt\"; filename=\"Base64Content.txt\"") }7 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.7KViews0likes1Comment