473,526 Members | 3,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Service Behind A Firewall Problem

I am attempting to use a web service from my work pc
which is behind a firewall. I have used wsdl.exe to
create the web service reference class and added it to my
project. (this seems to work without a hitch).

Before I use this class, I make the necessary calls to
instantiate a WebProxy class and then pass in my
credentials to set the WebProxy.Credentials property so I
can get through the proxy server.

I am now receiving an error message: "Path property must
be set before calling the Send method" within the
WSDL.EXE generated code when invoking a method

Dim results() As Object = Me.Invoke("getQuote", New Object
() {symbol})

I am unsure as to what I may be missing, anyone have any
idea what this error message means?

Thanks - Bill
Nov 22 '05 #1
5 7290
Hello Bill,

Thanks for posting in the group.

Consuming web service when the client is behind a proxy server is a FAQ. We
could refer to MSDN article:
"HOW TO: Configure an XML Web Service Client by Using the .NET Framework to
Work with a Proxy Server"
http://support.microsoft.com/?id=307220

VS.NET uses the Wsdl.exe tool when you add web references. So you can use
Wsdl.exe directly. These are standard solutions to the proxy server issue.

Solution1
--------------
Get the wsdl file locally and add the reference to it.

- In IE on the client machine, type
http://MachineX/Webservice1/Service1.asmx?wsdl
- In IE on the client machine, go to View | Source, copy and save the wsdl
file locally named test.wsdl
- Under the VS.NET command prompt on the client machine, type c:\>wsdl.exe
test.wsdl.
- The Web service proxy source file named service1.cs is generated.
- In VS.NET, right click on the client project, Add, Add Existing Items...
to add service1.cs to the project.
- Code the client to use the web proxy server if it is necessary (see
note2).
- Build the project.

Solution2
--------------
Use the Wsdl.exe tool to specify the proxy and credentials to generate the
proxy code.

- Under the VS.NET command prompt, type: c:\>wsdl.exe
<http://MachineX/Webservice1/Service1.asmx> /proxy:proxyURL
/proxyusername:username /proxypassword:password /proxydomain:domain

- The Web service proxy source file named service1.cs is generated.
- In VS.NET, right click on the client project, Add, Add Existing Items...
to add service1.cs to the project.
- Code the client to use the web proxy server if it is necessary (see
note2).
- Build the project.

Note1:
Run wsdl.exe by itself, you will see a list of usage. Short forms are
'/pu:', '/pp:' and '/pd:'

Note2:
You need code the client to use the web proxy server as follows:

[C#]
MyMath.Math math = new MyMath.Math();
// Set the proxy server to proxyserver, set the port to 80, and specify to
bypass

the proxy server
// for local addresses.
IWebProxy proxyObject = new WebProxy("http://proxyserver:80", true);
math.Proxy = proxyObject;
// Call the Add XML Web service method.
int total = math.Add(8, 5);

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemWebServicesProtocolsHttpWebClientProtoc olClassProxyTopic.asp

I tested the above and it works fine on my side. Could you please check it
and post here with the testing results? Also, please posting sample code
slice may also help community to understand the problem well.

Does that answer your question?

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 22 '05 #2
Yes! This is exactly what I was looking for. To further
test this, I tried another web service and ran it against
wsdl.exe and it worked great!

Once I added the wsdl.exe output file to my VB .NET
project, I was able to use it after creating my proxy
server settings in code like this:

Dim x As New TestWebService.ZipCodesService
Dim proxy As New WebProxy("proxyaddress", port)
proxy.Credentials = New NetworkCredential"user", "passw")
x.Proxy = proxy

Thanks for the info, it was a big help! Hopefully the
folks at Microsoft will recognize that there are a lot of
users who live behind firewalls and provide a wizard or
dialog which will prevent the need for using wsdl.exe.

Bill

-----Original Message-----
Hello Bill,

Thanks for posting in the group.

Consuming web service when the client is behind a proxy server is a FAQ. Wecould refer to MSDN article:
"HOW TO: Configure an XML Web Service Client by Using the .NET Framework toWork with a Proxy Server"
http://support.microsoft.com/?id=307220

VS.NET uses the Wsdl.exe tool when you add web references. So you can useWsdl.exe directly. These are standard solutions to the proxy server issue.
Solution1
--------------
Get the wsdl file locally and add the reference to it.

- In IE on the client machine, type
http://MachineX/Webservice1/Service1.asmx?wsdl
- In IE on the client machine, go to View | Source, copy and save the wsdlfile locally named test.wsdl
- Under the VS.NET command prompt on the client machine, type c:\>wsdl.exetest.wsdl.
- The Web service proxy source file named service1.cs is generated.- In VS.NET, right click on the client project, Add, Add Existing Items...to add service1.cs to the project.
- Code the client to use the web proxy server if it is necessary (seenote2).
- Build the project.

Solution2
--------------
Use the Wsdl.exe tool to specify the proxy and credentials to generate theproxy code.

- Under the VS.NET command prompt, type: c:\>wsdl.exe
<http://MachineX/Webservice1/Service1.asmx> /proxy:proxyU RL/proxyusername:username /proxypassword:password /proxydom ain:domain
- The Web service proxy source file named service1.cs is generated.- In VS.NET, right click on the client project, Add, Add Existing Items...to add service1.cs to the project.
- Code the client to use the web proxy server if it is necessary (seenote2).
- Build the project.

Note1:
Run wsdl.exe by itself, you will see a list of usage. Short forms are'/pu:', '/pp:' and '/pd:'

Note2:
You need code the client to use the web proxy server as follows:
[C#]
MyMath.Math math = new MyMath.Math();
// Set the proxy server to proxyserver, set the port to 80, and specify tobypass

the proxy server
// for local addresses.
IWebProxy proxyObject = new WebProxy ("http://proxyserver:80", true);math.Proxy = proxyObject;
// Call the Add XML Web service method.
int total = math.Add(8, 5);

http://msdn.microsoft.com/library/default.asp? url=/library/en-us/cpref/html/frlrfSystemWebServicesProtocolsHttpWebClientProto colClass ProxyTopic.asp
I tested the above and it works fine on my side. Could you please check itand post here with the testing results? Also, please posting sample codeslice may also help community to understand the problem well.
Does that answer your question?

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
.

Nov 22 '05 #3
Hello Bill,

Thanks for the quick response. I am glad that the probem is resovled now. :)

By the way, I think we could add web reference in IDE directly even when
the client is behind a proxy. That should be what you need.

Note If you are developing a Web application on a machine that is behind
a firewall, and your application will consume Web services found outside of
the firewall, you must include the address and port of your network's proxy
server in the URL. Ask your network administrator to furnish this part of
the URL path. For more information, see The proxy settings on this computer
are not configured correctly for Web discovery..

Thanks again for participating the community.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 22 '05 #4
Yanhong, I have seen the message you posted below in the
Microsoft help file for .NET, but when I posted the
question about including the address and port of your
network's proxy in the URL to our network/firewall group
they could not provide an answer. Are there some examples
I can find for this??

Thanks again for your help!

Bill
server in the URL
-----Original Message-----
Hello Bill,

Thanks for the quick response. I am glad that the probem is resovled now. :)
By the way, I think we could add web reference in IDE directly even whenthe client is behind a proxy. That should be what you need.
Note If you are developing a Web application on a machine that is behinda firewall, and your application will consume Web services found outside ofthe firewall, you must include the address and port of your network's proxyserver in the URL. Ask your network administrator to furnish this part ofthe URL path. For more information, see The proxy settings on this computerare not configured correctly for Web discovery..

Thanks again for participating the community.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
.

Nov 22 '05 #5
Hi Bill,

Thanks for the response.

I think you could refer to this article:
"How to Configure Internet Explorer to Use a Proxy Server"
http://support.microsoft.com/?id=135982

It describes the format of this string. In IE 6.0, it could be set in
Tools->Options.

By the way, I found that you have changed your email alias. I suggest you
go to
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn
to create a no spam email alias.

If there is any question on it, please feel free to post here.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 22 '05 #6

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

Similar topics

3
11804
by: demonhunter | last post by:
Hi, I am trying to fetch a web content using LWP and HTTP modules behind corp firewall. I set proxy server as shown in my internet explorer connection setup. When i run the script, i got successful response, but the return content is not the webpage i requested at all. It shows something like:...
1
1951
by: John Dalberg | last post by:
Hello I have a project where I need to update a few tables in a SQL Server 2000 database which resides behind a firewall, ie port 1433 is blocked. I also need to verify the updates were successful. I am a C# developer. What are my options in doing this.. web services? John Dalberg
0
303
by: KumarForG | last post by:
hi, i have a webservice and it's client in dotnet. the client is coded to assign the proxy property to the service object, with the proxy url and authentication details. however, there is a particular configuration with seperate proxy and firewall where the invocation does not work.
4
2394
by: Sean | last post by:
Hi, I'm programming an IRC bot. I'm trying to establish a dcc connection with another IRC client. I give the ipaddress and port number to the client in the request. I listen to that port with TcpListener on IPAddress.Any. The listener never receives a connection. My situation is the bot computer is behind a router. Is there something...
1
1954
by: Coder | last post by:
Is there anyway to access this webservice that is behind a router/firewall? - Thanks.
0
1382
by: ericms | last post by:
I need to consume one of our vendor's web service. So, we need to consume the web service behind a proxy server. I am working with Visual Studio 2005 and .NET 2.0. I did right-click on a project and click "Add Web Reference". I kept getting an error either "The web server could not be resolved: "www.website.com" or Http Error 407:...
3
8049
by: fndjoum | last post by:
I have created a web service with Visual Studio 2005 on my machine. But because of firewall , I can't call it remotely from the browser. Any idea how to call a web service through firewall?? Thanks for helping
0
1242
by: fndjoum | last post by:
I have created a web service with Visual Studio 2005 on my machine. But because of firewall , I can't call it remotely from the browser. Any idea how to call a web service through firewall?? Thanks for helping
0
1432
by: fndjoum | last post by:
I have created a web service with Visual Studio 2005 on my machine. But because of firewall , I can't call it remotely from the browser. Any idea how to call a web service through firewall?? Thanks for helping
11
5684
by: TMN | last post by:
Hi I am trying to get fetch rss from news sites from behind our corporate proxy/firewall but no php function has worked - I have tried curl etc but simply get no response. These scripts work fine at home so I have to believe it is due to our restrictive network - any ideas ??? Thanks Tim
0
7251
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...
0
7474
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. ...
0
7646
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5776
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...
1
5173
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...
0
4812
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...
0
3310
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...
0
1700
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
1
887
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.