473,320 Members | 1,845 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,320 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 19902
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.