Hello all,
I am facing a problem on a windows web service. Although I havent made any changes on my code, lately I ve been receiving this error. What I am trying to do is connecting to a web service and make a call and get a responce. So if i can get a responce I have a XML written to a string. But now it fails and goes directly to my catch statement.
The weird thing is, I can access the XML when I put the URL to the browser.
In addition to that;
in order to make a call I am using a IDictionary.
the code goes like that;
IDictionary<string, string> r3 = new Dictionary<string, String>();
r3["Service"] = "ECommerceService";
r3["Operation"] = "ItemLookup";
r3["ItemId"] = asin;
r3["MerchantId"] = "Featured";
r3["ResponseGroup"] = "Medium,OfferFull,Reviews";
string urlReq = HttpUtility.UrlDecode(r3.Values.ToString());
requestUrl = helper.Sign(urlReq);
This doesnt work because on the request url it apeears as;
- http://onca/xml?AccessKeyId=0JB3Q7C8ZC0YD8WE7BG2&System.Collections.Generic.Dictionary`2[System.String,System.String]=&Timestamp=2011-02-14T19:00:13Z
On the link here "
System.Collections.Generic.Dictionary`2[System.String,System.String]=&
" there should be values.
The correct must be ;
-http://onca/xml?AccessKeyId=0JB3Q7C8ZC0YD8WE7BG2&ItemId=B000E2EZDM&MerchantId=Featured&Operation=ItemLookup&ResponseGroup=Medium%2COfferFull%2CReviews&Service=AWSECommerceService&Timestamp=2011-02-14T17%3A14%3A25Z&
So instead of "
System.Collections.Generic.Dictionary`2[System.String,System.String]=&
" i need this there"
&ItemId=B000E2EZDM&MerchantId=Featured&Operation=ItemLookup&ResponseGroup=Medium%2COfferFull%2CReviews&Service=AWSECommerceService&
"
In order to get that how can I get it from IDictionary like that can someone help? I am open to new ideas as well?
What I am thinking but cant figure out yet; I tried
string urlReq = "";
foreach (string url in r3.Values)
{
urlReq = r3[url] + "&";
}
urlReq = urlReq.Substring(0, urlReq.Length - 1);
urlReq = HttpUtility.UrlDecode(urlReq);
But this foreach is faulty. what is the proper way for it? I hope I am clear.
Thanks.