473,800 Members | 2,518 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 SmartDeviceAppl ication the program crash
and the debug message is:
An unhandled exception of type 'System.Net.Web Exception'
occurred in System.Web.Serv ices.dll
Additional information: Unable to connect to the remote server

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


[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://tempuri.org/productList",
RequestNamespac e="http://tempuri.org/",
ResponseNamespa ce="http://tempuri.org/",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
public string productList(str ing query) {
object[] results = this.Invoke("pr oductList",
new object[] {
query});
*** return ((string)(resul ts[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 19983
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_C alabr=F2?=
<an*******@disc ussions.microso ft.com>
Sender: =?iso-8859-1?Q?Antonello_C alabr=F2?=
<an*******@disc ussions.microso ft.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+46pm GSReel49rB10lIA ==
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Path: cpmsftngxa10.ph x.gbl
Xref: cpmsftngxa10.ph x.gbl
microsoft.publi c.dotnet.framew ork.webservices :8171
NNTP-Posting-Host: tk2msftngxa13.p hx.gbl 10.40.1.165
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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 SmartDeviceAppl ication the program crash
and the debug message is:
An unhandled exception of type 'System.Net.Web Exception'
occurred in System.Web.Serv ices.dll
Additional information: Unable to connect to the remote server
And I have an error on the line marked with *** :

[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://tempuri.o
rg/productList",
RequestNamespac e="http://tempuri.org/",
ResponseNamespa ce="http://tempuri.org/",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
public string productList(str ing query) {
object[] results = this.Invoke("pr oductList",
new object[] {
query});
*** return ((string)(resul ts[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
3276
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 code just works fine: WebRequest request = WebRequest.Create(URL);
16
4228
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 project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
1
2817
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: Dim reader As New StreamReader(data) Line 38: Results = reader.ReadToEnd()
6
3638
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 list of all of my webs, however if I attempt to open a site under and web other than localhost I receive the message: "Unable to open the Web 'http://localhost/anywebappname'. The Web 'http://localhost/anywebappname' does not exist" Obviously...
3
2103
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 assembly which in turn calls a web service. You know the web service is reachable and that the COM app is able to instantiate your .Net assembly (because you RegAsm'ed it and it's good to go). However, when you attempt to make a call to the web...
3
9554
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 httpwebrequest.GetReponse() function call throws the above error. So here's what i do in the case it works.. //THIS WORKS
0
1598
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 showing the WSDL, but when I try to invoke a method of that service it is giving the following error : System.Net.WebException: The underlying connection was closed Unable to connect to the remote server at SYstem.Net.HTTP...
1
1111
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 Source=ServerName;UID=User Name;PWD=Password;Initial Catalog=Database") conProd.Open() I am getting following error while running this script SQL Server does not exist or access denied.
6
13694
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 use the Windows Explorer to go on the FTP-URI and this always works. So the problem should come from my app. my simplified code: Private m_oFTP As FtpWebRequest Private oResponseDir As FtpWebResponse = Nothing
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 the exe.config file is deleted, than it works. The exe.config contains : <?xml version="1.0" encoding="utf-8" ?>
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10501
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10250
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7574
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
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.