Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Question Rest webservice : Encoding parameters

More
11 Feb 2019 15:46 #1 by nada
Bonjour ,

J'ai un webservice Rest , avec un paramètre CONTNO :



Les valeurs du CONTNO peuvent être sous la forme de "Toto/Titi", ce qui générera des erreurs .



La valeur du Contno est récupérée à partir d'une opération SQL (1) et est utilisée lors de l'invocation du WS (2)

Y a t il une posisbilité d'encoder la valeur du CONTNO ?

Merci .
Attachments:
More
12 Feb 2019 04:44 - 12 Feb 2019 05:43 #2 by nahid3152
Replied by nahid3152 on topic Rest webservice : Encoding parameters
Hi,
Can you share a little bit more about why "Contno " is required and use of it? And also the error message.
Last edit: 12 Feb 2019 05:43 by nahid3152.
More
12 Feb 2019 10:52 #3 by nada
Replied by nada on topic Rest webservice : Encoding parameters
Hello ,

So basically I'm trying to update a contract , the contract is identified by the CONTNO , so I must set it in the endpoint to be able to access it .

Here is the error message , in yellow is the CONTNO = 'LF/1001290' it has an ' / ' that isn't encoded .

Attachments:
More
12 Feb 2019 12:58 #4 by nahid3152
Replied by nahid3152 on topic Rest webservice : Encoding parameters
HI,

Can you please check this link
www.stambia.org/doc/65-technology-articl...-an-http-get-service
Take a look at this part
"DECLARATION OF THE INPUT PARAMETERS"

Attachments:
More
12 Feb 2019 15:40 - 12 Feb 2019 15:41 #5 by Thomas BLETON
Replied by Thomas BLETON on topic Rest webservice : Encoding parameters
I agree with Nahid's suggestion.
Don't place a ${parameter}$ in the Address: its value will not be encoded.
Instead, declare this as a Part with BindingType "http:urlReplacement", and set the value to '${parameter}$' in the mapping => the value will be encoded.

If you really don't want to pass this value in the mapping, then keep the ${parameter}$ but make sure its value is encoded (scripting action to replace "/" with "%2F", etc.).
Last edit: 12 Feb 2019 15:41 by Thomas BLETON.
More
13 Feb 2019 10:53 #6 by nada
Replied by nada on topic Rest webservice : Encoding parameters
Thank you , my problem is solved .