index > Windows Live Search: Development > Live search service not responding

Live search service not responding

Hi,

Is there any reason why when I run the sample from the search SDK on my personal server at home it works perfectly fine, yet when I load the same code to my hosted server I get an error message saying that the service did not repond correctly?

(System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at com.msn.search.soap.MSNSearchService.Search(SearchRequest Request) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\da57b35a\195329d3\App_WebReferences.e3jjpxdh.0.cs:line 47 at ASP.searchproxy_aspx.Page_Load(Object sender, EventArgs e) in e:\kunden\homepages\33\d174594834\searchProxy.aspx:line 57)...
Any thoughts? I'm rather stumped. No code has changed. The only thing that comes to mind is that maybe the hosting server doesn't allow communication via services? I can run services fine, but this is the only code that I have that accesses any services. Any help is greatly appreciated.
Steven Syfuhs

"The only thing that comes to mind is that maybe the hosting server doesn't allow communication via services?"

I don't think so.

Have you verified that the code, the files and the directory structure are the same on the local server and the shared hosting server?

me*

I figured that could be a possibility, but it's very straightforward: everything is in the root directory except the .js files, which is the same setup locally.

/masterpage.master - Holds the search stuff
/searchProxy.aspx - the file called from within the masterpage to display the search results
/scripts/layoutLibrary.js - used for html rendering
/scripts/searchClient.js - the code that does all the XMLHTTPRequest junk

the masterpage and layoutlibrary are unimportant to communications.

heres the searchProxy.aspx file:
(Sorry about the formatting)

<%@ Page Language="C#" AutoEventWireup="true" Debug="true" %>
<%
@ Import Namespace="com.msn.search.soap" %>
<%
@ Import Namespace="System.Web.Configuration" %>
<%
@ Import Namespace="System.Globalization" %>
<%
@ Import Namespace="Microsoft.Security.Application" %>
script language="C#" runat="server">

void Page_Load(object sender, EventArgs e) {
try {

string key = Request.QueryString["searchKey"];

if (!String.IsNullOrEmpty(key)) {
string offset = Request.QueryString["searchOffset"];
string count = Request.QueryString["searchCount"];
CultureInfo ci = new CultureInfo("en-us");
MSNSearchService s = new MSNSearchService();
SearchRequest sr = new SearchRequest();
SourceRequest[] srcr = new SourceRequest[1];
srcr[0] =
new SourceRequest();
srcr[0].Source =
SourceType.Web;
if (!String.IsNullOrEmpty(count)) {
int iCount = Int32.Parse(count, ci);
if (iCount > 0 && iCount <= 50)
srcr[0].Count = iCount;
else
srcr[0].Count = 10;
}
else
srcr[0].Count = 10;
if (!String.IsNullOrEmpty(offset)) {
int iOffset = Int32.Parse(offset, ci);
if (iOffset > 0 && iOffset <= 250)
srcr[0].Offset = iOffset;
else
srcr[0].Offset = 0;
}
else
srcr[0].Offset = 0;
sr.Requests = srcr;
sr.CultureInfo =
"en-us";
sr.Flags =
SearchFlags.MarkQueryWords;
sr.Query = Server.UrlDecode(key);
sr.SafeSearch =
SafeSearchOptions.Strict;
sr.ApID = WebConfigurationManager.AppSettings.Get("appIDSearch");
SearchResponse srsp = s.Search(sr);
PrintResults(srsp);
}
}
catch (Exception fault) {
Response.Write(fault.ToString());
}
}

private void PrintResults(SearchResponse searchResponse)
{
...... nothing important here
}
</script>

Steven Syfuhs

Hello Steven,

have you really verified the whole application including the configuration file web.config? For example your code shows that you have stored the Application ID for the Web Service in the the web.config. The web.config also sets the url of the service. Does your web.config on the hosting server has the correct settings?

me*
For the time being I switched it so the AppID is directly in the code. That is appID = "...". I checked the web.config file and that too is the same. Just for kicks I tried creating a new web resource and overwrote the old discomap file with no avail. Is there any source that you would like to take a look at that might help?
Steven Syfuhs

I do not know why you get this error message, Steve.

You should check your whole concept, the whole deployment and the hosting server.

Call the support of your hosting provider and ask if they have a problem to connect to external ressources.

Add a Web Reference to a Service and test if the server is able to connect.

me*
Thanks for the suggestions. I'll see what I can do. With any luck it will be something simple. I'll write up how I managed to fix it, when I finally get it to work. Thanks again for the suggestions.
Steven Syfuhs
I tried copying the SDK sample to the remote server to see if there was a problem with my own changes, however I end up with the same errors. I am thinking it may be the result of the host.
Steven Syfuhs
reply 8

You can use google to search for other answers

 

More Articles

• read am WSDL
• Sample Timeouts
• Windows Live Search API (Needs to be Simplified)
• Unattended Soap Installation
• No results after first SourceResponse
• How to change a search result?
• not well-formed (invalid token) error
• How to change a CultureInfo and what effect on search it has!?
• DateTime field
• MSN Search Results For A Meta Search Engine
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Displaying the search result
• Sample Timeouts
• Client Error
• Alternate Sources (specifically spelling)
• live.com too slow
• ApplicationId-Ip Specific
• Use msn api search with php
• escaped XML string ---> XML?
• Consuming MSN Search Web Service from PHP
• Offset and Count attributes of a SourceR
• Maximum number of site: arguments?
• XmlDataSource?
• application ids
• org.apache.axis.ConfigurationException:
• Python Interfacing with API

Hot Articles

• Commercial usage
• application ids
• Can't Sign in Either and the new profile
• Unattended Soap Installation
• Sample Timeouts
• Getting more than 250 results
• DateTime field
• ApplicationId-Ip Specific
• XmlDataSource?
• Yahoo API
• Keywords
• Visual Studio Only?
• Client Error
• No results with inurl: parameter
• 10,000 Search Query Limit

Recommend Articles

• Bounce on feedback email
• Maximum number of site: arguments?
• escaped XML string ---> XML?
• proxy authentication required error
• Search is returning only 25 results
• How can I turn on Child Search with MSN
• Image search?
• Accessing MSN Search Web Service from Perl
• error 1601
• Getting more than 250 results
• DateTime field
• Results Ranking
• Access RunTime installations
• SoapException on MSN search
• How to change a search result?