469,326 Members | 1,541 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

Unable to connect to the remote server

Hi all,
I created a webservice that execute a sql query on demand.

If I try to execute the query from the WebForm, all is ok.
If I try to execute the query from a normal Windows
Application, all is ok.

The WebService run correctly.. but if I try to call the
Webservice from a SmartDeviceApplication the program crash
and the debug message is:
An unhandled exception of type 'System.Net.WebException'
occurred in System.Web.Services.dll
Additional information: Unable to connect to the remote server

And I have an error on the line marked with *** :


[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://tempuri.org/productList",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
public string productList(string query) {
object[] results = this.Invoke("productList",
new object[] {
query});
*** return ((string)(results[0]));
}

Any idea? I start developing webservice from few time...
sorry if it's a noob question :)

Thanks in advance.
Nov 23 '05 #1
1 19171
Hi Antonello,

This would happen if the query didn't return any results. The code you
showed is the client side proxy logic, correct? Note that you are using
the array element 0 without checking to see that any results came back.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
Content-Class: urn:content-classes:message
From: =?iso-8859-1?Q?Antonello_Calabr=F2?=
<an*******@discussions.microsoft.com>
Sender: =?iso-8859-1?Q?Antonello_Calabr=F2?=
<an*******@discussions.microsoft.com>
Subject: Unable to connect to the remote server
Date: Fri, 17 Dec 2004 09:01:05 -0800
Lines: 41
Message-ID: <03****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcTkWf7sAS+46pmGSReel49rB10lIA==
Newsgroups: microsoft.public.dotnet.framework.webservices
Path: cpmsftngxa10.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:8171
NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi all,
I created a webservice that execute a sql query on demand.
If I try to execute the query from the WebForm, all is ok.
If I try to execute the query from a normal Windows
Application, all is ok.
The WebService run correctly.. but if I try to call the
Webservice from a SmartDeviceApplication the program crash
and the debug message is:
An unhandled exception of type 'System.Net.WebException'
occurred in System.Web.Services.dll
Additional information: Unable to connect to the remote server
And I have an error on the line marked with *** :

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://tempuri.o
rg/productList",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
public string productList(string query) {
object[] results = this.Invoke("productList",
new object[] {
query});
*** return ((string)(results[0]));
}
Any idea? I start developing webservice from few time...
sorry if it's a noob question :)
Thanks in advance.

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Serdar Kalaycý | last post: by
reply views Thread by =?Utf-8?B?dG9t?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.