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]
# 1
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.
RohanSingh at 2007-9-9 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Search: Development...
# 2
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 };

PeterTheill at 2007-9-9 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Search: Development...
# 3
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!
ConradC at 2007-9-9 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Search: Development...
# 4

The SOAP exception should have information regarding what is incorrect with the request. The exception you posted is the exception thrown by managed code when it received the exception from the server.

Erin

MSN Search Test

ErinMcGowan at 2007-9-9 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Search: Development...

Windows Live Developer Forums

Site Classified