473,508 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 19940
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
3233
by: Kristof Thys | last post by:
Hello, I'm developing a C# - windows forms application. To get some information for my application, I'm connecting to an URL, wich gives me XML generated using php. With 90% of the users, this...
16
4173
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
1
2800
by: Jim | last post by:
I have the following code: Line 35: Dim sURL As String = "http://www.google.com" Line 36: Dim data As Stream = client.OpenRead(Server.UrlPath­Encode(sURL)) Line 37: ...
6
3612
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a...
3
2085
by: Monty | last post by:
OK, I had an issue with this and found lots of advice that did not apply, so I'm posting what I found hoping it might help someone else. Here's the sitch: you have a COM app that calls to a .Net...
3
9526
by: nandan | last post by:
Yes. My client has a proxy server. That much i know. In my application I make two kinds of calls that are affected by the proxy server I finally got the webservice call working. But my...
0
1563
by: troubleswithaspscripts | last post by:
hi all, We have a third party WebService that is hosted in a remote server. It exposes some Web Methods to be consumed by our C# .Net Application. When I access the wsdl of the WebService it is...
1
1097
by: sathyaprakashg | last post by:
Hi All, I am trying to connect to an SQL SERVER in a remote production server from ASP.net using following code. Dim conProd As New OleDbConnection("Provider=SQLOLEDB.1;Data...
6
13648
by: Patrick.Simons | last post by:
I try to connect a FTPWebRequest through Proxy and VPN to a remote FTP- server. Sometimes it works sometimes not. When my VB.Net-App (2005) returns the error on the GetResponse-Method, I'll try to...
0
1934
by: =?Utf-8?B?dG9t?= | last post by:
Hi, I have a .net 2.0 windows client that connects to webservices. In most cases it works fine. However I have one client that gets 'Unable to connect to the remote server'. If on that client...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.