Skip to main content
Solved

Test-a-rest with a command - URI is malformed

  • February 7, 2023
  • 2 replies
  • 526 views

paul harland
Superhero (Employee)
Forum|alt.badge.img+24

Hi,

I’m working with Test-a-rest 

I’m getting an issue when trying to run status change actions.  For example I have this simplified script:

 

```cs

Eval "S"  Into myRegionCode 
Get SalesRegionsHandling.svc/SalesRegions(RegionCode='{$myRegionCode}') Into myRegion
Print myRegion
Create SalesRegionsHandling.svc/SalesRegions(RegionCode='{$myRegionCode}')/IfsApp.SalesRegionsHandling.SalesRegion_SetHidden Using myRegion
{
}

```

 

It should set the Region from Active to Hidden.

But I get this error, URI is malformed.  Any ideas what’s going wrong?

 

Best answer by HET

Hi!

You cannot do a Create command with “using” parameter. You can see in the error message from the server that “using...” is sent in the HTTP request. Which the server does not accept (and gives error)

If the server requires e-tag in the header use “Patch” or similar command. Check the command reference documentation, it’s quite elaborated in the syntax and inner workings.

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img
  • Do Gooder
  • 2 replies
  • Answer
  • February 8, 2023

Hi!

You cannot do a Create command with “using” parameter. You can see in the error message from the server that “using...” is sent in the HTTP request. Which the server does not accept (and gives error)

If the server requires e-tag in the header use “Patch” or similar command. Check the command reference documentation, it’s quite elaborated in the syntax and inner workings.


paul harland
Superhero (Employee)
Forum|alt.badge.img+24

Thanks @HET !

I found how to do it.  keyword “Action”

 

Eval "T"  Into myRegionCode 

Get SalesRegionsHandling.svc/SalesRegions(RegionCode='{$myRegionCode}') Into myRegion

Action SalesRegionsHandling.svc/SalesRegions(RegionCode='{$myRegionCode}')/IfsApp.SalesRegionsHandling.SalesRegion_SetHidden Using myRegion  Into result
{
}

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings