How do I stop URL forward slash from being encoded?

Originally posted by waynemmn on October 20, 2015

I am creating some new tests calling a new rest end point.

I need to call the endpoint like this.

http://cit2.iam-secure.aaaaaa.com/bestbuy/transactions/online-transactions/20151020^960^960^48624024

but I am getting some forward slashes encoded like this.

http://cit2.iam-secure.aaaaaaaa.com/bestbuy%2Ftransactions/online-transactions%2F20151020^960^960^48624024}

How do I stop this??

Thank you.

Originally posted by nmrao on October 21, 2015

Not tried ever. But worth trying to put the value in a custom property and see that works.

Originally posted by waynemmn on October 21, 2015

The first part of the URL is indeed a custom property that is used in the Path: varialbe of the form builder. It is referenced like this. ${#Project#TransactionPath} and it is getting encoded in the actual URL call.

Like this.

bestbuy%2Ftransactions

but this is not happening for all of my tests..

Originally posted by SiKing on October 23, 2015

Did you try disabling encode URL?

http://www.soapui.org/rest-testing/reference/method-window.html

Although I rather suspect your URL is defined wrong. But withouth further information it is hard to tell.

Originally posted by kondasamy on October 23, 2015

If the value supplied in PATH/ TEMPLATE parameter is passed in the URL, then it is expected behavior that it gets encoded like this. I don’t think SoapUI does different on this,

http://cit2.iam-secure.aaaaaaaa.com/bestbuy%2Ftransactions/online-transactions%2F20151020%5E960%5E96…

From the above URL, the RED highlighted items should be PATH parameter. If you edit in WADL/ WSDL to supply as different PATH parameters, I guess we can eradicate this problem.

Thanks,

Samy

Originally posted by waynemmn on October 26, 2015


kondasamy wrote:

“If the value supplied in PATH/ TEMPLATE parameter is passed in the URL, then it is expected behavior that it gets encoded like this. I don’t think SoapUI does different on this,”


Many of my other quieres defined like this using a parameter passed in the Path variable are not encoded so I do not know why this one is.

???

Originally posted by waynemmn on October 26, 2015


SiKing wrote:

Did you try disabling encode URL?

http://www.soapui.org/rest-testing/reference/method-window.html

Although I rather suspect your URL is defined wrong. But withouth further information it is hard to tell.



SiKing wrote:

Did you try disabling encode URL?

http://www.soapui.org/rest-testing/reference/method-window.html

Although I rather suspect your URL is defined wrong. But withouth further information it is hard to tell.


I am using SoapUI NG and I do not see a place to turn off URL encoding??

How could my URL be defined incorrectly?

If I run this exact same URL via Postman manually without encoding the request works correctly.

but with the encoding I receive the error.

I am trying to turn off encoding but I can not find out where to do this.

Originally posted by SiKing on October 26, 2015


waynemmn wrote:


I am trying to turn off encoding but I can not find out where to do this.


http://www.soapui.org/rest-testing/reference/method-window.html

Originally posted by kondasamy on October 26, 2015

It sounds to be unusual in your case! Eventually, I have found the option to turn off auto encoding of the URI under Preferences → HTTP (PFB the pic. for your ref.),

Please share if you got any positive result!

Thanks,

Samy

Originally posted by SiKing on October 26, 2015

Two different things!

One (yours) is for encoding a provided URL, the other (mine) is for encoding one particular parameter.

Originally posted by kondasamy on October 26, 2015

Yes I agree! I guess you mean the encoding option avaialble under default properties for the particular REST method/ test step! Correct?

Thanks,

Samy

Originally posted by waynemmn on October 27, 2015

When I attempt to turn off URL encoding like this, my comeplete evenironment gets locked up and I eventually need to kill the Ready API dev environment.

:frowning:

Originally posted by waynemmn on October 27, 2015

Soap UI in Ready API does not have a way to turn off encoding for each Rest call that I can find.

See attached image.

There is only a way to turn it off for the entire project and my project locks up when I attempt to set that.

Originally posted by waynemmn on October 27, 2015

I see on thing that is happening for this Request.

In the fom view, my path is defined like this.

${#Project#TransactionPath} with an actual value of this bestbuy/transactions.

If I define my entity like this:

online-transactions/abcd

Having it defined like this builds the URL like this.

http://cit2.iam-secure.bestbuy.com/bestbuy/transactions/online-transactions/abcd

but my last item “abcd” is a data item that is actually defined like this “20151019^960^960^40615329”

So when I enter a value like this into the entity field

then my URL become like this

http://cit2.iam-secure.bestbuy.com/bestbuy%2Ftransactions/online-transactions%2F20151019^960^960^40615329

When I go ahead and encode my query value like this: 20151019%5E960%5E960%5E40615329

Then the one slash in my path still get encoded.

http://cit2.iam-secure.bestbuy.com/bestbuy%2Ftransactions/online-transactions/20151019^960^960^40615329

:frowning:

I can’t seem to turn off encoding!!

Originally posted by waynemmn on November 03, 2015

No resolution on this yet.

Does anyone have any help or insight?

Is there a way to encode just the data part of the url so that it does not force encoding the rest of the url??

Originally posted by GillerM on November 03, 2015

Yes. Just encode the part of the URL with the TEMPLATE parameter - http://readyapi.smartbear.com/structure/parameters/template

Then the slash would be around the TEMPLATE param and will not be encoded

Originally posted by waynemmn on November 03, 2015

I am already using a template for both the Path Section of the URL and the Entitiy Portion.

See attached image.

If the data portion of the URL has the character “^” in the data. like this.

20151103^960^960^104521

Then the Path part and the entity part get encoded.

http://cit2.iam-secure.bestbuy.com/bestbuy%2Ftransactions/online-transactions%2F20151103^960^960^102658

If I replace the “^” with an "_"then nothing gets encoded.

http://cit2.iam-secure.bestbuy.com/bestbuy/transactions/online-transactions/20151103_960_960_104521

I am not sure how you think using templates will stop this???

Originally posted by SiKing on November 03, 2015

Your parameter “entity” has a slash in it! You are either going to get the whole parameter encoded or nothing.

You need to break this up into two parameters, maybe: “entitypre” and “entitypost”, or something. The separating slash between parameters will not be encoded, but the two _parts_ will.

Originally posted by waynemmn on November 03, 2015

ok ok,

Your answer got me thinking and I finally was able to resolve this.

I broke the URL up into 4 seperate Parameters so there was no slash (/) in any value and then I placed the final data portion of the URL (20151103^960^960^103694) in it’s own parameter.

Only that final portion got encoded and that is what this query needed.

Thanks everyone for your help!!