Results 1 to 5 of 5
Hi,
Problem Description: Our project have web service created which we use to create data files from database. To create these files we have to open a particular link which ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-20-2012 #1Just Joined!
- Join Date
- Oct 2012
- Posts
- 2
Calling a web service link through linux script
Hi,
Problem Description: Our project have web service created which we use to create data files from database. To create these files we have to open a particular link which automatically start creating files and MQ them as soon as we hit it in web browser.
Link looks like as below
xxxx.xx.:8000/$filter=Country eq 'US' & language='EN-US' & $format=MQ
There is a user id and password too,which appear as a prompt after putting the link in web browser and hitting enter.
We have to create a script to execute this link everyday through linux. We have tried "curl" command to achieve the result but couldn't get success.We are following issue
1) In link "space" "$" and "&" characters have been used, which are pre-defined symbol for linux. So when it pass through curl command so it takes them as standard {for example it takes $format as variable)
2) when we are somehow able to manage to pass correct link,its give below error
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="//schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>Policy Falsified</faultstring>
<faultactor>xxxx.xx.com:8000/$filter=Country eq 'US' & language='EN-US' & $format=MQ</faultactor>
<detail>
<l7
olicyResult status="Assertion Falsified" xmlns:l7=".layer7tech.com/ws/policy/fault"/>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Could anyone provide the suggestions to solve the issue ?
- 10-20-2012 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,673
Hello and welcome,
try escaping the "$" character with a \ and the ampersand and other special chars using URL encoded equivalents.Last edited by atreyu; 10-20-2012 at 03:05 PM. Reason: Welcome, first time poster!
- 10-20-2012 #3Just Joined!
- Join Date
- Oct 2012
- Posts
- 2
Thanks for your Inputs !!
We tried with "\" with "$" but it goes in browser with "\" too which creates and invalid link. Also on receiving side there is no decoding hence replacing the characters won't work either.
- 10-21-2012 #4
Single quotes prevent the shell from expanding/interpreting special characters, maybe you could try this?
You'd need to replace the existing single quotes in the string to double quotes, or all sorts of things will go wrong... hope this hasn't any side effects.Code:curl 'xxxx.xx.:8000/$filter=Country eq "US" & language="EN-US" & $format=MQ'
Can't tell an OS by it's GUI
- 10-22-2012 #5Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,673
okay, your URL is a bit confusing. this is what i think are the CGI parameters:
questions...Code:CGI param CGI value ---------- --------- filter Country eq 'US' language 'EN-US' format MQ
1. first of all, are the above assumptions correct?
2. what is with the spaces inb/t parameter names (before and after the '&' character)? does the web server really expect that? e.g., the CGI perl module I use does not like that.
3. can "Country" not be its own CGI parameter?
4. does "language" really need the enclosing single quotes?


Reply With Quote

