dseel
14 years agoContributor
POST with MIME format causes Null Pointer exception
Hi:
I'm using the latest SOAPUI Pro 3.6 beta 2 nightly build to run a REST mock service using a groovy script in the OnRequest tab. When I send a normal POST request to the mock service, everything works fine. However, if I send a POST that MIME content ( multipart/form-data) the the mock service returns an error. This works fine in SOAPUI Pro 3.5.1. See this error log:
Tue Aug 31 11:52:06 EDT 2010:ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: java.lang.NullPointerException
com.eviware.soapui.impl.wsdl.mock.DispatchException: java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:397)
at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:701)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.initPostRequest(WsdlMockRequest.java:114)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.<init>(WsdlMockRequest.java:103)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:377)
... 11 more
Here is my request:
POST /messaging/outbound/www.myaddress.com/requests HTTP/1.1
Content-Type: multipart/form-data; boundary="===============123456=="; charset=UTF-8
MIME-Version: 1.0
X-Forwarded-Server: AlcatelLucentWSG
X-Forwarded-Host: 138.120.215.215
Accept-Encoding: gzip,deflate
X-Forwarded-For: 135.244.6.250
Transfer-Encoding: chunked
Host: 135.244.6.250:5555
Connection: Keep-Alive
User-Agent: OmniAccess 8550 WSG
4ad
--===============123456==
Content-Disposition: multipart/form-data; name=”root-fields”
Content-Type: application/xml; charset="utf-8"
Content-Length: nnnn
<?xml version="1.0"?>
<mms:outboundMessageRequest xmlns:mms="urn:oma:xml:rest:messaging:1">
<address>tel:1350000001</address>
<address>tel:1350000999</address>
<senderAddress>tel:1351111999</senderAddress>
<senderName>MyName</senderName>
<receiptRequest>
<notifyURL>http://application.example.com/notifications/DeliveryInfoNotification</notifyURL>
<callbackData>12345</callbackData>
</receiptRequest>
<outboundMMSMessage>
<subject>hello from the rest of us!</subject>
<priority>High</priority>
</outboundMMSMessage>
<clientCorrelator>567895</clientCorrelator>
</mms:outboundMessageRequest>
--===============123456==
Content-Disposition: multipart/form-data; name=”attachments”
Content-Type: multipart/mixed; boundary=”===12345===”
===12345===”
Content-Disposition: attachments; filename="picture.gif"
Content-Type: text/plain;
See attached photo
===12345===”
Content-Disposition: attachment; filename="picture.gif"
Content-Type: image/gif
GIF89a...binary image data...
--===============123456==--
0
Please let me know if there is a workaround or if it can be fixed.
Thanks,
Dave
I'm using the latest SOAPUI Pro 3.6 beta 2 nightly build to run a REST mock service using a groovy script in the OnRequest tab. When I send a normal POST request to the mock service, everything works fine. However, if I send a POST that MIME content ( multipart/form-data) the the mock service returns an error. This works fine in SOAPUI Pro 3.5.1. See this error log:
Tue Aug 31 11:52:06 EDT 2010:ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: java.lang.NullPointerException
com.eviware.soapui.impl.wsdl.mock.DispatchException: java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:397)
at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:701)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.initPostRequest(WsdlMockRequest.java:114)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest.<init>(WsdlMockRequest.java:103)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:377)
... 11 more
Here is my request:
POST /messaging/outbound/www.myaddress.com/requests HTTP/1.1
Content-Type: multipart/form-data; boundary="===============123456=="; charset=UTF-8
MIME-Version: 1.0
X-Forwarded-Server: AlcatelLucentWSG
X-Forwarded-Host: 138.120.215.215
Accept-Encoding: gzip,deflate
X-Forwarded-For: 135.244.6.250
Transfer-Encoding: chunked
Host: 135.244.6.250:5555
Connection: Keep-Alive
User-Agent: OmniAccess 8550 WSG
4ad
--===============123456==
Content-Disposition: multipart/form-data; name=”root-fields”
Content-Type: application/xml; charset="utf-8"
Content-Length: nnnn
<?xml version="1.0"?>
<mms:outboundMessageRequest xmlns:mms="urn:oma:xml:rest:messaging:1">
<address>tel:1350000001</address>
<address>tel:1350000999</address>
<senderAddress>tel:1351111999</senderAddress>
<senderName>MyName</senderName>
<receiptRequest>
<notifyURL>http://application.example.com/notifications/DeliveryInfoNotification</notifyURL>
<callbackData>12345</callbackData>
</receiptRequest>
<outboundMMSMessage>
<subject>hello from the rest of us!</subject>
<priority>High</priority>
</outboundMMSMessage>
<clientCorrelator>567895</clientCorrelator>
</mms:outboundMessageRequest>
--===============123456==
Content-Disposition: multipart/form-data; name=”attachments”
Content-Type: multipart/mixed; boundary=”===12345===”
===12345===”
Content-Disposition: attachments; filename="picture.gif"
Content-Type: text/plain;
See attached photo
===12345===”
Content-Disposition: attachment; filename="picture.gif"
Content-Type: image/gif
GIF89a...binary image data...
--===============123456==--
0
Please let me know if there is a workaround or if it can be fixed.
Thanks,
Dave