>Has anyone solved the problem of connecting to a remote server from the pocket pc emulator when the "remote server" is sql server running on the local machine?
>
>When running the service from the emulator, there is an interminable wait and then an error is returned
>This is the error message:
>
>An unhandled exception of type ’System.Net.WebException’
>occurred in System.Web.Services.dll” …
>Unable to connect to the remote server
>
>The program has reached this line within reference.cs
>
>Object{} results = this.Invoke(“tOrdersByCustomerID”, new object [] (custID));
>
>
>Googling around I find that a lot of other people have come to the same error but I don't know that anyone else is running the test from the file server.
>
>A common comment is to ensure that all reference to local_host is replaced by a reference to the machine name. I have done that. No good. The local host web files are shared in Active Directory.
>
>Any suggestions?
>
>Godfrey
Godfrey,
Webservice proxy places uri with "localhost". Change that to IP.
ie: Web refernces\reference.cs file looks like (the file where you get the exception):
public myWS() {
this.Url = "http://localhost/myWebServices/myWS.asmx";
}
change it to:
public myWS() {
this.Url = "http://x.x.x.x/myWebServices/myWS.asmx";
}
Where x.x.x.x represents your computer's IP (not 127.0.0.1 - the one you get from IPConfig or your web server address).
PS: In webservice itself connection to SQL server looks like:
"Server=localhost;Integrated Security=SSPI;Initial Catalog=someDB"
IOW problem is in connecting to webservice not SQL server.
Cetin