AKB
AKB

Reputation: 5938

mule getting value from the url to message payload

I have url as:

localhost:8081/urltest?company=test?emplId=1234

I need to get the value of company and emplId in payload. Do I need to use transformer and get all the values or can get the values from payload in mule expression?

Upvotes: 0

Views: 349

Answers (2)

krishna
krishna

Reputation: 1

use this expression you get userid from url

<logger message="#[message.inboundProperties['userid']]" level="INFO" doc:name="Logger"/> 

Upvotes: 0

Anirban Sen Chowdhary
Anirban Sen Chowdhary

Reputation: 8311

Try with MEL expresssion to get the values like :-

#[message.inboundProperties['company']] and #[message.inboundProperties['emplId']]

Check wheteher you are getting the values in logger like the following :-

<logger message="#[message.inboundProperties['company']]" level="INFO" doc:name="Logger"/>

and

<logger message="#[message.inboundProperties['emplId']]" level="INFO" doc:name="Logger"/>

and I beleive your url format should be like :-

localhost:8081/urltest/?company=test&emplId=1234

as I beleive localhost:8081/urltest?company=test?emplId=1234 may not work

for your reference .. I found an article :- http://wiki.marketruler.com/What_is_the_correct_syntax_for_query_strings%3F

Upvotes: 1

Related Questions