Forum Discussion

MattLaw's avatar
MattLaw
New Contributor
15 years ago

XSD:Duration causes (PT1S) - java.lang.NumberFormatException

Hi,

When I run my functional tests within SoapUI everything works just fine. When I try and run them from the Command Line or the Test Runner, the XSD:Duration value "PT1S" causes some integer conversion error.

16:42:31,809 ERROR [SoapUI] An error occured [For input string: "PT1S"], see error log for details
java.lang.NumberFormatException: For input string: "PT1S"

Is there a way around this?

Regards,

Matt



----

Running soapUI TestRunner for [TESTING SUITE - SEARCH SERVICE SYSTEST]
directory: C:\Program Files\eviware\soapUI-3.6\bin\.
command: cmd.exe /C testrunner.bat -ehttp://endpoint/searchservice.svc -s"Functional Tests" -cScenario6 -r -I -i "soapui-project.xml"
soapUI 3.6 TestCase Runner
Configuring log4j from [C:\Program Files\eviware\soapUI-3.6\bin\soapui-log4j.xml]
16:42:29,028 INFO [DefaultSoapUICore] initialized soapui-settings from [soapui-settings.xml]
16:42:29,403 INFO [SoapUITestCaseRunner] Enabling UI Components
16:42:29,590 INFO [WsdlProject] Loaded project from [file:soapui-project.xml]
16:42:30,387 INFO [SoapUITestCaseRunner] Running soapUI tests in project [SERVICE SYSTEST]
16:42:30,387 INFO [SoapUITestCaseRunner] Running TestCase [Scenario6]
16:42:30,403 INFO [SoapUITestCaseRunner] Running soapUI testcase [Scenario6]
16:42:30,403 INFO [SoapUITestCaseRunner] running step [SearchProperties]
16:42:30,449 INFO [SoapUITestCaseRunner] running step [Generate GUID]
16:42:31,028 INFO [SoapUITestCaseRunner] running step [Get current time]
16:42:31,059 INFO [SoapUITestCaseRunner] running step [Export current time to test property StartTime]
16:42:31,059 INFO [SoapUITestCaseRunner] running step [First request]
16:42:31,809 ERROR [SoapUI] An error occured [For input string: "PT1S"], see error log for details
java.lang.NumberFormatException: For input string: "PT1S"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.eviware.soapui.impl.wsdl.submit.filters.HttpSettingsRequestFilter.filterAbstractHttpRequest(HttpSettingsRequestFilter.java:100)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(AbstractRequestFilter.java:31)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:133)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:236)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:324)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runTestStep(WsdlTestCaseRunner.java:207)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:138)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:39)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:81)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:599)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:514)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:339)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:138)
at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:80)
at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:113)
16:42:35,902 ERROR [WsdlSubmit] Exception in request: java.net.ConnectException: Connection refused: connect
16:42:35,902 ERROR [SoapUI] An error occured [Connection refused: connect], see error log for details
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at com.eviware.soapui.impl.wsdl.support.http.SoapUIMultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(SoapUIMultiThreadedHttpConnectionManager.java:1666)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:194)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:236)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:324)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runTestStep(WsdlTestCaseRunner.java:207)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:138)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:39)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:81)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:599)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:514)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:339)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:138)
at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:80)
at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:113)16:42:35,981 INFO [SoapUITestCaseRunner] Assertion [SOAP Response] has status UNKNOWN
16:42:35,981 INFO [SoapUITestCaseRunner] Assertion [Not SOAP Fault] has status UNKNOWN
16:42:35,981 INFO [SoapUITestCaseRunner] Assertion [Contains Hits] has status UNKNOWN
16:42:35,981 INFO [SoapUITestCaseRunner] Assertion [XML contains results] has status UNKNOWN
16:42:35,981 INFO [SoapUITestCaseRunner] Assertion [Resultset contains no errors] has status UNKNOWN
16:42:35,981 INFO [SoapUITestCaseRunner] Assertion [FetchedDate(1) > RequestedDate(1)] has status UNKNOWN
16:42:35,996 INFO [SoapUITestCaseRunner] Assertion [ExpirationDate(1) = FetchedDate(1)+2s] has status UNKNOWN
16:42:35,996 ERROR [SoapUITestCaseRunner] First request failed, exporting to [C:\Program Files\eviware\soapUI-3.6\bin\Functional_Tests-Scenario6-First_request-0-FAILED.txt]

16:42:36,043 INFO [SoapUITestCaseRunner] Finished running soapUI testcase [Scenario6], time taken: 5563ms, status: FAILED
16:42:36,043 INFO [SoapUITestCaseRunner] TestCase [Scenario6] finished with status [FAILED] in 5563ms

SoapUI 3.6 TestCaseRunner Summary
-----------------------------
Time Taken: 5644ms
Total TestSuites: 0
Total TestCases: 1 (1 failed)
Total TestSteps: 5
Total Request Assertions: 7
Total Failed Assertions: 0
Total Exported Results: 1

4 Replies

  • Hi!

    It looks like soapUI is trying to use the value "PT1S" for the setting the timeout of the request.. does that make sense?

    If not, can you attach your project file so we can try to reproduce?

    In any case, the error logging is diagnostic and can be ignored.

    regards!

    /Ole
    eviware.com
  • MattLaw's avatar
    MattLaw
    New Contributor
    Hi Ole,

    Thanks for getting back in touch. We are using SoapUI to test our service, and the timeout is an essential piece of this, as we're also looking to see how the service handles timeout operations.

    In order to protect the inner workings of our service, I've only attached the Test Suite, not the project, hope this is OK?

    The datatype is defined in the WSDL as:
    <xs:element name="Timeout" type="ser:duration"/>
    xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/"


    Here is the soap request:
    I've emboldened the part that is causing the issue.
    I've also attached the raw response.

    <s:Envelope xmlns:s="">
    <s:Header>
    <RequestedDate>${SoapTestProperties#StartTime}</RequestedDate>
    </s:Header>
    <s:Body>
    <SearchInputMessage xmlns="">
    <Request xmlns:a="" xmlns:i="">
    <a:Options xmlns:b="">
    <b:DebugMode>false</b:DebugMode>
    <b:MultiThreading>true</b:MultiThreading>
    <b:UseCache>${SoapTestProperties#CacheOn}</b:UseCache>
    </a:Options>
    <a:Originator xmlns:b="">
    <b:UrlReferer i:nil="true"/>
    <b:UserAgent i:nil="true"/>
    </a:Originator>
    <a:SearchQueries xmlns:b="">
    <b:TheQuery>
    <b:Id>Alpha</b:Id>
    <b:Timeout>${SoapTestProperties#TimeOut}</b:Timeout>
    <b:CacheSeconds>30</b:CacheSeconds>
    <b:Parameters><![CDATA[<Parameters>
    <ThreadSleep>${SoapTestProperties#ThreadSleep}</ThreadSleep>
    <Action>${SoapTestProperties#ActionType}</Action>
    </Parameters>]]></b:Parameters>
    <b:LoadParametersFromRepository>false</b:LoadParametersFromRepository>
    </b:TheQuery>

    </a:SearchQueries>
    </Request>
    <Extension i:nil="true" xmlns:a="" xmlns:i=""/>
    </SearchInputMessage>
    </s:Body>
    </s:Envelope>


    -- RAW REQUEST 000

    <s:Envelope xmlns:s="">
    <s:Header>
    <RequestedDate>2010-11-12T10:25:31.992</RequestedDate>
    </s:Header>
    <s:Body>
    <SearchInputMessage xmlns="">
    <Request xmlns:a="" xmlns:i="">
    <a:Options xmlns:b="">
    <b:DebugMode>false</b:DebugMode>
    <b:UseCache>false</b:UseCache>
    </a:Options>
    <a:Originator xmlns:b="">
    <b:UrlReferer i:nil="true"/>
    <b:UserAgent i:nil="true"/>
    </a:Originator>
    <a:SearchQueries xmlns:b="">
    <b:TheQuery>
    <b:Id>Alpha</b:Id>
    <b:Timeout>PT1S</b:Timeout>
    <b:CacheSeconds>30</b:CacheSeconds>
    <b:Parameters><![CDATA[<Parameters>
    <ThreadSleep>500</ThreadSleep>
    <Action>Dummy Resultset</Action>
    </Parameters>]]></b:Parameters>
    <b:LoadParametersFromRepository>false</b:LoadParametersFromRepository>
    </b:TheQuery>

    </a:SearchQueries>
    </Request>
    <Extension i:nil="true" xmlns:a="" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
    </SearchInputMessage>
    </s:Body>
    </s:Envelope>
  • MattLaw's avatar
    MattLaw
    New Contributor
    Hi,

    Any update on this fix? We're still getting this error:

    16:45:18,688 ERROR [SoapUI] An error occured [For input string: "PT1S"], see error log for details
    java.lang.NumberFormatException: For input string: "PT1S"
    at java.lang.NumberFormatException.forInputString(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
  • Hi!

    could you please attach either the Project or the TestSuite so we can have a look?

    regards,

    /Ole
    eviware.com