Forum Discussion

Deloitte_Consul's avatar
Deloitte_Consul
Contributor
13 years ago

Request working with Jmeter but failing in soapUI

Hi All,

We are testing an API which convert a text message into an audio file.

Through soapUI, we are getting "internal server error" but while executing same test case through Jmeter it is working fine and in Jmeter, audio file automatically gets saved in <Jmeter_Home>, where would soapUI save the audio file?

Please find below soapUI request and response.

Req:

POST https://apimatrix.tfoundry.com/a1/speec ... xttospeech HTTP/1.1
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 3.5.30729; InfoPath.3; .NET4.0C; .NET4.0E; Zune 4.7; USPortal)
Authorization: Bearer sb1kiyzefzb0tmuaqrwub1r7zsieexob
Content-Type: application/xml
Accept-Language: en-US
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*, audio/amr-wb
Connection: keep-alive

Hello Deepak, How are you?

Resp:

HTTP/1.1 500 Internal Server Error
Server: nginx/1.0.5
Date: Thu, 21 Feb 2013 13:47:42 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Status: 500 Internal Server Error
Content-Length: 728
X-Request-Id: b76647ab9233b77bf4c82bdb4cd7e19c
X-Runtime: 0.093350
X-Rack-Cache: invalidate, pass

<!DOCTYPE html>
<html>
<head>
<title>We're sorry, but something went wrong (500)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>

<body>
<!-- This file lives in public/500.html -->
<div class="dialog">
<h1>We're sorry, but something went wrong.</h1>
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
</div>
</body>
</html>



Jmeter Request:
POST https://api.foundry.att.com/a1/speechalpha/texttospeech

POST data&colon;
Hello Deepak, How are you?

[no cookies]

Request Headers:
Accept-Language: en-US
X-Arg: VoiceName= crystal,ClientApp=NoteTaker,ClientVersion=1.0.1
Content-Length: 26
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 3.5.30729; InfoPath.3; .NET4.0C; .NET4.0E; Zune 4.7; USPortal)
Connection: keep-alive
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Content-Type: text/plain
Pragma: no-cache

Any help will be anticipated. Thanks in advance.

Regards
Deepak Rawat

6 Replies

  • Hi!

    It seams like the request headers differs quite a bit.
    Have you added the required headers in the Headers tab i the bottom of the REST request editor?

    If you use HTTP TestStep you could use the "Download resources" checkbox and have the audio file downloaded as an attachment.
    Then you should be able to select it in the Attachment tab on the response and select where to save the file on disk.


    --
    Regards

    Erik
    SmartBear Sweden
  • Hi Erik,

    Will try to match the headers with Jmeter and execute the test script again. Will let you know if we face any issues.

    Regards
    Deepak Rawat
  • HI Erik,

    We executed the request with the matching headers to Jmeter and we are able to get the response in Raw tab, but no audio file is downloaded/ attached in the response. Even tried with HTTP request with download resources check-box selected but couldn't find any luck.

    Please find the request response and log details below.

    Request:

    POST https://api.foundry.att.com/a1/speechalpha/texttospeech HTTP/1.1
    X-Arg: VoiceName= crystal,ClientApp=NoteTaker,ClientVersion=1.0.1
    Accept-Language: en-US
    Authorization: Bearer sb1kiyzefzb0tmuaqrwub1r7zsieexob
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 3.5.30729; InfoPath.3; .NET4.0C; .NET4.0E; Zune 4.7; USPortal)
    Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    Content-Type: text/plain
    Connection: keep-alive
    Content-Length: 26
    Host: api.foundry.att.com

    Hello Deepak, How are you?

    Response:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Set-Cookie: JSESSIONID=pa+j9dCh4G5KZY1z5gNiLhmj; Path=/3
    x-arg-deviceip: 167.219.52.10
    X-PostProcessTime: 0
    accept-language: en-US
    X-Forwarded-For: 10.0.240.22
    accept: audio/x-wav
    X-NLUProcessTime: 0
    X-TTSProcessTime: 299
    authorization: Bearer sb1kiyzefzb0tmuaqrwub1r7zsieexob
    Date: Mon, 25 Feb 2013 12:12:49 GMT
    Cache-Control: no-cache
    X-Watson-Version: watson-6.7.8278
    X-Watson-Server: ewr1alp2002wt:8880
    X-PreProcessTime: 0
    X-Watson-Session: ewr1alp2002wt-201302251212-47852
    X-Watson-AppId: enabler.tts.v1-0-3
    Content-Disposition: inline; filename=tts.wav
    x-arg: VoiceName= crystal,ClientApp=NoteTaker,ClientVersion=1.0.1
    X-Watson-Req-AppId: enabler.tts.v2proda
    Content-Type: audio/x-wav
    Content-Length: 54444
    Debug_productid: Sudheer test
    Debug_applicationid: 632b1dfb-441b-4d36-af79-2ca090b16d76
    Debug_content_length: 54444

    RIFF¤Ô

    SoapUI Log:
    Mon Feb 25 17:42:47 IST 2013:DEBUG:Attempt 1 to execute request
    Mon Feb 25 17:42:47 IST 2013:DEBUG:Sending request: POST /a1/speechalpha/texttospeech HTTP/1.1
    Mon Feb 25 17:42:49 IST 2013:DEBUG:Receiving response: HTTP/1.1 200 OK
    Mon Feb 25 17:42:49 IST 2013:DEBUG:Connection can be kept alive indefinitely
    Mon Feb 25 17:42:53 IST 2013:ERROR:com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 500 Internal Server Error for https://api.foundry.att.com/a1/speechalpha/texttospeech
    Mon Feb 25 17:42:53 IST 2013:ERROR:An error occured [Cannot create Mozilla Browser instance on Windows 7, 6.1, Service Pack 1, CPU arch: x86, Java Oracle Corporation 1.7.0_02, 32-bit], see error log for details
    Mon Feb 25 17:42:53 IST 2013:INFO:Got response for [Text2SpeechRequest] in 5610ms (54444 bytes)
    Mon Feb 25 17:43:24 IST 2013:DEBUG:Connection closed


    Error Log:
    Mon Feb 25 17:42:53 IST 2013:ERROR:java.lang.RuntimeException: Cannot create Mozilla Browser instance on Windows 7, 6.1, Service Pack 1, CPU arch: x86, Java Oracle Corporation 1.7.0_02, 32-bit
    java.lang.RuntimeException: Cannot create Mozilla Browser instance on Windows 7, 6.1, Service Pack 1, CPU arch: x86, Java Oracle Corporation 1.7.0_02, 32-bit
    at com.teamdev.jxbrowser.BrowserFactory.createBrowser(Unknown Source)
    at com.eviware.soapui.support.components.BrowserComponent.initBrowser(BrowserComponent.java:549)
    at com.eviware.soapui.support.components.BrowserComponent.setContent(BrowserComponent.java:669)
    at com.eviware.soapui.impl.rest.panels.request.views.html.HttpHtmlResponseView.setEditorContent(HttpHtmlResponseView.java:177)
    at com.eviware.soapui.impl.rest.panels.request.views.html.HttpHtmlResponseView.propertyChange(HttpHtmlResponseView.java:242)
    at java.beans.PropertyChangeSupport.fire(Unknown Source)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at com.eviware.soapui.model.support.AbstractModelItem.notifyPropertyChanged(AbstractModelItem.java:85)
    at com.eviware.soapui.impl.support.AbstractHttpRequest.setResponse(AbstractHttpRequest.java:716)
    at com.eviware.soapui.impl.wsdl.teststeps.HttpTestRequest.setResponse(HttpTestRequest.java:119)
    at com.eviware.soapui.impl.support.panels.AbstractHttpRequestDesktopPanel.afterSubmit(AbstractHttpRequestDesktopPanel.java:606)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.HttpTestRequestDesktopPanel.afterSubmit(HttpTestRequestDesktopPanel.java:402)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:157)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.mozilla.xpcom.XPCOMInitializationException: Must call Mozilla.getInstance().initialize() before using this method
    at org.mozilla.xpcom.Mozilla.getComponentManager(Unknown Source)
    at com.teamdev.jxbrowser.gecko.xpcom.ProxyObjectManager.<init>(Unknown Source)
    at com.teamdev.jxbrowser.gecko.xpcom.ProxyObjectManager.getInstance(Unknown Source)
    at com.teamdev.jxbrowser.gecko.xpcom.AppShellXPCOMThread.<init>(Unknown Source)
    at com.teamdev.jxbrowser.gecko.xpcom.impl.a.e.<init>(Unknown Source)
    at com.teamdev.jxbrowser.gecko.xpcom.XPCOMThreadFactory.createThread(Unknown Source)
    at com.teamdev.jxbrowser.gecko.xpcom.XPCOM.<init>(Unknown Source)
    at com.teamdev.jxbrowser.gecko.xpcom.XPCOM.initialize(Unknown Source)
    at com.teamdev.jxbrowser.gecko.xpcom.XPCOM.initialize(Unknown Source)
    at com.teamdev.jxbrowser.mozilla.MozillaBrowserFactory.<init>(Unknown Source)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.teamdev.jxbrowser.BrowserFactory$a.a(Unknown Source)
    ... 20 more
    Caused by: java.lang.NullPointerException
    ... 37 more


    Regards
    Deepak Rawat
  • Hi!

    According to the last sever response (HTTP 200 OK), it seems like the server was able to process the request, now the
    ERROR:java.lang.RuntimeException: Cannot create Mozilla Browser instance
    seams to be releated to the internal browser in soapui (jxbrowser).

    Could you try temporary disabling the internal browser in the UI Setting dialog in soapUI preferences?

    --
    Regards

    Erik
    SmartBear Sweden