Soap Exception Reference.cs Line 38
Used to be fine, I could run my apps and the sample no problem. Now I get a soap exception when Search() is attempted to be invoked.
System.Web.Services.Protocols.SoapException: Client Error at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at [...].MSNSearchService.Search(SearchRequest Request) in [...]\Reference.cs:line 38
I get this when trying to run my apps or the sample apps, any ideas?
[620 byte] By [
ConradC] at [2008-1-25]
I've been running into the same problem too. It seems like the WSDL for the web service was updated, so I updated all my web references, but still no luck. I think there has been some sort of change in the API that we need to account for in our applications, but I'm not sure what.
I got the same error. Debugging through the received SoapException (look at the "Detail" property) I saw I needed to configure a new "CultureInfo" parameter. Set this to e.g. "en-US" and it worked for me. It's properly the same type of error you're having.
For reference, this works for v0.5.0 of the MSN Search Web Service:
| |
MSNSearchService msn = new MSNSearchService();SearchRequest req = new SearchRequest(); req.AppID = "[ your app id ]; req.Query = "[ your query ]"; req.Flags = SearchFlags.MarkQueryWords; req.CultureInfo = "en-US";SourceRequest source = new SourceRequest(); source.Source = SourceType.Web; source.Count = 10; source.ResultFields = ResultFieldMask.All; req.Requests = new SourceRequest[] { source };
|
Unfortunately, that didn't work for me and the sample has that property set but I still get that Soap exception when trying to run the sample. My relevant code is:
| |
MSNSearchService s = new MSNSearchService(); SearchRequest searchRequest = new SearchRequest(); searchRequest.Query = keyword; searchRequest.AppID = "AppID"; searchRequest.Flags = SearchFlags.MarkQueryWords; searchRequest.CultureInfo = "en-US"; SourceRequest sourceRequest = new SourceRequest(); sourceRequest.Source = SourceType.Web; sourceRequest.ResultFields = ResultFieldMask.All; sourceRequest.Offset = pass*50; sourceRequest.Count = 50; searchRequest.Requests = new SourceRequest[] { sourceRequest }; SearchResponse searchResponse = s.Search(searchRequest); |
I haven't had time to try to trace the problem to a specific instance but it looks like that's what I'll need to do :\
I'm glad it's working for you though!