I have a WCF service method that accepts 3 parameters that are all strings and will return back some data.
[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml,
RequestFormat = WebMessageFormat.Xml, UriTemplate = "MyHttpRequest/{request}/{LogonID}/{Key}")]
string TestRequest(string request, string LogonID, string Key);
The request string parameter is supposed to be xml. Here is an example of the input, there are additional attributes but here is a sample.
<DateOfBirth>19000101</DateOfBirth>
I am calling this code from client like this
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(@"https://someurl.com/LookupService.svc/MyHttpRequest/" + this.tbRequestString.Text.Trim() + "/" + this.tbLoginID.Text.Trim() + "/" + this.tbKey.Text.Trim());
req.Method = WebRequestMethods.Http.Get;
string result = null;
using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
{
StreamReader reader = new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();
}
When I attempt to construct the URI I get a "
A potentially dangerous Request.Path value was detected from the client (<). " 400 Bad Request. What am I doing wrong? I cant see a way to do it, and articles on the web dont seem to help or
are related to POST not GET. Any ideas?