473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 19913
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
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
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.