Forum Discussion

marcl's avatar
marcl
Occasional Contributor
10 years ago

[Ready API 1.2] Double slash (//) in path

I get a "double slash" error when calling a REST method using GET. Note that I have lots of other REST calls in my project which do not seems to trigger this bug.

Any idea where the error is coming from and/or how I can identify the cause of the problem ?

 

 

Thu Jul 16 13:05:50 UTC 2015:ERROR:nu.xom.MalformedURIException: Double slash (//) in path
   nu.xom.MalformedURIException: Double slash (//) in path
   	at nu.xom.Verifier.throwMalformedURIException(Verifier.java:161)
   	at nu.xom.Verifier.checkPath(Verifier.java:396)
   	at nu.xom.Verifier.checkAbsoluteURIReference(Verifier.java:907)
   	at nu.xom.Element._setNamespaceURI(Element.java:869)
   	at nu.xom.Element.setNamespaceURI(Element.java:852)
   	at com.eviware.soapui.impl.rest.support.handlers.JsonXmlSerializer.processJSONObject(JsonXmlSerializer.java:973)
   	at com.eviware.soapui.impl.rest.support.handlers.JsonXmlSerializer.write(JsonXmlSerializer.java:649)
   	at com.eviware.soapui.impl.rest.support.handlers.JsonXmlSerializer.write(JsonXmlSerializer.java:616)
   	at com.eviware.soapui.impl.rest.support.handlers.JsonMediaTypeHandler.createXmlRepresentation(JsonMediaTypeHandler.java:61)
   	at com.eviware.soapui.impl.wsdl.submit.transports.http.BaseHttpResponse.getContentAsXml(BaseHttpResponse.java:382)
   	at com.eviware.soapui.impl.rest.panels.request.inspectors.schema.InferredSchemaInspector.afterSubmit(InferredSchemaInspector.java:106)
   	at com.eviware.soapui.impl.wsdl.WsdlSubmit.notifyListenersAfterSubmit(WsdlSubmit.java:102)
   	at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:143)
   	at java.util.concurrent.Executors$RunnableAdapter.call(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)

 

The request causing the problem is the following

 

GET http://myhost:42221/doit HTTP/1.1
Accept-Encoding: gzip,deflate
Host: myhost:42221
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.3.1 (java 1.5)

 

And the received answer contains this:

 

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 13

{"success":1}

 

 

  • RiteshY's avatar
    RiteshY
    Occasional Contributor

    I fixed this issue by going through the suite xml file. Search for any trailing / or // in between URL and fix that. You can use notepad++ to find all the instant. I used \w// pattern and /< pattern to find trailing / or // in between URL.

     

    Hope this helps for the time being.

    • shlshl211's avatar
      shlshl211
      New Contributor

      Thank you RiteshY, I have found the double slash and solved problem.

    • vvvvaib's avatar
      vvvvaib
      Occasional Contributor

      This should be the official workaround for this problem as for now. Thx.

  • divergentor's avatar
    divergentor
    Occasional Contributor

    I had the same problem, and I solved by delete // from project file.

    Below I describe my case, maybe it will help you to fix it.

    I have base edpoint /api/dashboard/processes-summaries/{processId}/change-pin-state

    But this endpoint was added to the project as

    <con:originalUri>https://test.com/api/dashboard/processes-summaries//change-pin-state</con:originalUri>

    {processId} have been cut from the uri, that's why this error happens.

    • cauvery's avatar
      cauvery
      Contributor

      Yes able to fix the double slash issue. Opened the project in an editor and searched for // in between my endpoint url.

      Finally fixed it. It's not something soapui need to fix.

  • johandelaat's avatar
    johandelaat
    Occasional Contributor

    Hi,

    I'm using Ready! API 1.3.1 - SoapUI NG and experience the same problem.

     

    I'm doing a call where in the resource/Method there is a reference to a custom Properety of the TestCase (.../${#TestCase#sourceCode}/...).

    Now it looks like if this reference is not used and thus an ERROR:nu.xcom.MalformedURIException: Double slash (//) in path is trown.

    BUT the step is executed correctly, with the correct value of the properety and giving the expected result.

     

    So where is this ERROR comming from?

    On the forum I've read it's a known bug.

    Any idea what triggers this error and how to avoid it?

    Any idea when it wil be fixed?

     

    Johan 

      • marcl's avatar
        marcl
        Occasional Contributor

        Hello Rao,

         

        I'm aware of this bug (although I hope it's fixed, given how old it is), but there's no trailing slash in my request at least.

        GET http://myhost:42221/doit HTTP/1.1

        Thanks!

        Marc

  • blade's avatar
    blade
    Occasional Contributor

    Hi,

     

    Has there been any update from smartbear on this issue? I am currently getting this error in Ready API 1.5.0. Will this be addressed in the next release? It has a downstream impact that when I run a Test Case, upon reaching the last step it takes approx 15-20 seconds to complete.

     

     

    • marcl's avatar
      marcl
      Occasional Contributor

      Nope, on news on my side :-/

      • Hebla's avatar
        Hebla
        Occasional Contributor

        I'm having the same problem. We run the integration testsuite as part of a Jenkins pipeline, and build will be blocked if the soapui project fails. Now it fails always because of this error...

         

        Any update on this would be greatly appresiated.