473,659 Members | 3,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Winform cannot connect to webservice via CAS policy

Dan

Hi

I have a dotnet application that communicates with a web service running
locally on my machine. It connects fine and works ok when I run the
application from the c: drive. Am having problems running it from my ftp
location, so

ftp://localhost/setup.exe

In the Runtime security policy I have created a new code group under my
machine entry, and made the membership conditions to use Strong name, and
assigned the public key from setup.exe to it. The permission set is set to
FullTrust.
The application now launces, but when accessing the web service I get the
following exception thrown:

************** Exception Text **************
System.Net.WebE xception: Unable to connect to the remote server --->
System.Net.Sock ets.SocketExcep tion: No connection could be made because the
target machine actively refused it
at System.Net.Sock ets.Socket.DoCo nnect(EndPoint endPointSnapsho t,
SocketAddress socketAddress)
at System.Net.Sock ets.Socket.Inte rnalConnect(End Point remoteEP)
at System.Net.Serv icePoint.Connec tSocketInternal (Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketSt ate
state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.Http WebRequest.GetR equestStream()
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
methodName, Object[] parameters)
I've tried setting all the permission manually, but nothing work. and I've
tried the evaluate assembly util which tells me I've got things setup
correctly.

But the application works fine when not via the ftp!!! so I now the web
service is working ok.
The FTP on ISS is set to use annouymous access

Am using vs2005 on windows xp pro.

thanks for any help
dan


Feb 26 '07 #1
1 2907
Dan
ah! fixed it!

just incase anybody needs to know. I had the apppointing to the webservice
from localhost - which wouldn't work from running from the ftp location. I
switched it to my machine name and it worked! must be because running via
CAS it's know about or allow localhost connections.

!
"Dan" <da*@somewhere. comwrote in message
news:ue******** ******@TK2MSFTN GP02.phx.gbl...
>
Hi

I have a dotnet application that communicates with a web service running
locally on my machine. It connects fine and works ok when I run the
application from the c: drive. Am having problems running it from my ftp
location, so

ftp://localhost/setup.exe

In the Runtime security policy I have created a new code group under my
machine entry, and made the membership conditions to use Strong name, and
assigned the public key from setup.exe to it. The permission set is set
to
FullTrust.
The application now launces, but when accessing the web service I get the
following exception thrown:

************** Exception Text **************
System.Net.WebE xception: Unable to connect to the remote server --->
System.Net.Sock ets.SocketExcep tion: No connection could be made because
the
target machine actively refused it
at System.Net.Sock ets.Socket.DoCo nnect(EndPoint endPointSnapsho t,
SocketAddress socketAddress)
at System.Net.Sock ets.Socket.Inte rnalConnect(End Point remoteEP)
at System.Net.Serv icePoint.Connec tSocketInternal (Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address,
ConnectSocketSt ate
state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.Http WebRequest.GetR equestStream()
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
methodName, Object[] parameters)
I've tried setting all the permission manually, but nothing work. and I've
tried the evaluate assembly util which tells me I've got things setup
correctly.

But the application works fine when not via the ftp!!! so I now the web
service is working ok.
The FTP on ISS is set to use annouymous access

Am using vs2005 on windows xp pro.

thanks for any help
dan


Feb 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1743
by: cgia | last post by:
I found out that only using winform I can use the winword interop and generate word document in the client machine and connect to a remote database, so that I have made a winform application which accesses winword on the client and a remote db. Afterwards I wanted to use the no touch deployment but the winform cannot anymore start winword on the client, and I get a security exception. Does that mean that I cannot use no touch deployment...
0
2921
by: Cenray | last post by:
How to generate a web request from a Winform Application using a WebService? In a C# Windows Application, when I try to genrate a web request using the following code, it is woking fine Winform code --------------- Browser.DocumentHTML = ""; string HTMLData="";
0
1004
by: Sharon McCarty | last post by:
Hi Everyone, I'm creating a webservice that's written in C++. So, I'm using the wizard by creating a c++ project using the template, ASP.net Web Service. I am trying to make method calls with third party api. So I am using a .h file and a .lib file that comes with this api. I've placed the actual .lib file in a bin directory that I created with the project.
2
7154
by: hazz | last post by:
I don't get it. I have a VS2005 solution with a web service project and a windows project. The web service when tested on its own works fine. But when I add it as a web reference and refer to it my windows form code behind I receive the following; {"The request failed with HTTP status 401: Unauthorized."} when trying to execute this.dataGridView1.DataSource = ws.ReturnStudentDS(); not sure if it is relevant but the web.config in the...
0
1668
by: Rene Ruppert | last post by:
Hi, On the web I found a simple sample/tutorial for a webservice, some kind of chat software. I implemented the server and the client. When I run the client form on the host PC everything works fine. When I run it on the PPC device emulator it keeps saying that it cannot connect to the server. The device emu is cradled and I can surf the web with Pocket Internet Explorer. But: when I call the ChatService.asmx file from Pocket Explorer
0
1082
by: Standist | last post by:
vs.net 2003 I create a webservice using vc.net.In the webservice invoked a method in a dll from third party. I compile and link the program without any error.But I got a error when I debug it,I got the same error when I access the webservice through IE directly. The following is the error message: line 196£º <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
0
1126
by: Dan | last post by:
Hi I have a dotnet application that communicates with a web service running locally on my machine. It connects fine and works ok when I run the application from the c: drive. Am having problems running it from my ftp location, so ftp://localhost/setup.exe In the Runtime security policy I have created a new code group under my
10
2394
by: IsRaEl | last post by:
Hello everybody... i reeeealy need a way to automatically execute a WinForm with the same permissions that i have with the LocalService user. Thanks in advance...
0
1304
by: icemx | last post by:
Hi, I'm trying to find a way to get and modify the stream sent by my winform application to a Java webservice. It was supose to be easy .... but.. Here are the problems.. 1- My first intend was to get the stream just before the send method and then modify it.. But inside the method protected override WebResponse GetWebResponse(WebRequest aRequest) the stream isn't readable and not writable.. So, I can't use it.. 2-My second...
0
8428
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
8851
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
8531
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
8628
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7359
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...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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...
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.