473,403 Members | 2,284 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.

Webservices called from behind proxy server fails

..NET Framework 1.1
VS2003
Application is making webservice calls from behind a proxy server and then
freezes and dies.

Questoin is can i use webservice over proxy server( i guess another name of
them is ISA ... if i a not wrong), if yes how?

Sameer
Feb 10 '06 #1
6 2843
Yes, you can but you have provide your proxy server credentials to your web
service on the client side as in the following example.

The example assumes you have created your web service object (names
..WebService in this example):

WebProxy oProxy = new WebProxy(string.Format("{0}:{1}", sProxyServer,
nProxyPort), true);

oProxy.Credentials = new NetworkCredential(sProxyUsername, sProxyPassword);

oWebService.Proxy = oProxy;
oWebService.Discover();

Hope this helps,
Tony
"sameer" <sa****@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
.NET Framework 1.1
VS2003
Application is making webservice calls from behind a proxy server and then
freezes and dies.

Questoin is can i use webservice over proxy server( i guess another name
of
them is ISA ... if i a not wrong), if yes how?

Sameer

Feb 11 '06 #2
Tony,

since some of the clients of this application does not use proxy server, how
can i and where exactly in the code should i make changes so that depending
on a setting in the configuration file, it should set up a proxy object. When
i say "where can i", i mean to ask is there any call in the reference.vb file
where i can override a method which is called every time this webserivce
object is initialized so that once I feed the settings to the webservice,
code in no other places needs to be changed.

Also can you point me to a resource on any website which describes this in
detail.
thanks

"Tony" wrote:
Yes, you can but you have provide your proxy server credentials to your web
service on the client side as in the following example.

The example assumes you have created your web service object (names
..WebService in this example):

WebProxy oProxy = new WebProxy(string.Format("{0}:{1}", sProxyServer,
nProxyPort), true);

oProxy.Credentials = new NetworkCredential(sProxyUsername, sProxyPassword);

oWebService.Proxy = oProxy;
oWebService.Discover();

Hope this helps,
Tony
"sameer" <sa****@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
.NET Framework 1.1
VS2003
Application is making webservice calls from behind a proxy server and then
freezes and dies.

Questoin is can i use webservice over proxy server( i guess another name
of
them is ISA ... if i a not wrong), if yes how?

Sameer


Feb 12 '06 #3
I provide a configuration UI in my application where the user is allowed to
specify if they need to use a proxy server, and if so, they can provide the
proxy server, port, username and password (sometimes username and password
are options) and I write this info to a config file to remember them for the
next time.

I have a method that I use to get a the webservice instance and that method
attaches the proxy server stuff as indicated in my prev message.

Tony
"sameer" <sa****@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
Tony,

since some of the clients of this application does not use proxy server,
how
can i and where exactly in the code should i make changes so that
depending
on a setting in the configuration file, it should set up a proxy object.
When
i say "where can i", i mean to ask is there any call in the reference.vb
file
where i can override a method which is called every time this webserivce
object is initialized so that once I feed the settings to the webservice,
code in no other places needs to be changed.

Also can you point me to a resource on any website which describes this in
detail.
thanks

"Tony" wrote:
Yes, you can but you have provide your proxy server credentials to your
web
service on the client side as in the following example.

The example assumes you have created your web service object (names
..WebService in this example):

WebProxy oProxy = new WebProxy(string.Format("{0}:{1}", sProxyServer,
nProxyPort), true);

oProxy.Credentials = new NetworkCredential(sProxyUsername,
sProxyPassword);

oWebService.Proxy = oProxy;
oWebService.Discover();

Hope this helps,
Tony
"sameer" <sa****@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
> .NET Framework 1.1
> VS2003
> Application is making webservice calls from behind a proxy server and
> then
> freezes and dies.
>
> Questoin is can i use webservice over proxy server( i guess another
> name
> of
> them is ISA ... if i a not wrong), if yes how?
>
> Sameer


Feb 13 '06 #4
tony thanks for you reply, i now know that i can use the code that you
mentioend to involke webservices from behing a proxy server. Another question
which was part of the previous one is:
my application has a lot of places where it makes the webservice calls, and
the application is pretty huge. also if at all there is a proxy server then
my clients would let me know in advance and i could specify this value in the
application before they start using. So my question is , is there place in
the reference.VB file of the webservice where if i override a function and
specify the proxy Ip and port just ONES per webserivce then evertime this
webserice is initialized , it gets the proxy IP and port and i dont have to
make this change 100s of times all over the application.

thanks

"Tony" wrote:
I provide a configuration UI in my application where the user is allowed to
specify if they need to use a proxy server, and if so, they can provide the
proxy server, port, username and password (sometimes username and password
are options) and I write this info to a config file to remember them for the
next time.

I have a method that I use to get a the webservice instance and that method
attaches the proxy server stuff as indicated in my prev message.

Tony
"sameer" <sa****@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
Tony,

since some of the clients of this application does not use proxy server,
how
can i and where exactly in the code should i make changes so that
depending
on a setting in the configuration file, it should set up a proxy object.
When
i say "where can i", i mean to ask is there any call in the reference.vb
file
where i can override a method which is called every time this webserivce
object is initialized so that once I feed the settings to the webservice,
code in no other places needs to be changed.

Also can you point me to a resource on any website which describes this in
detail.
thanks

"Tony" wrote:
Yes, you can but you have provide your proxy server credentials to your
web
service on the client side as in the following example.

The example assumes you have created your web service object (names
..WebService in this example):

WebProxy oProxy = new WebProxy(string.Format("{0}:{1}", sProxyServer,
nProxyPort), true);

oProxy.Credentials = new NetworkCredential(sProxyUsername,
sProxyPassword);

oWebService.Proxy = oProxy;
oWebService.Discover();

Hope this helps,
Tony
"sameer" <sa****@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
> .NET Framework 1.1
> VS2003
> Application is making webservice calls from behind a proxy server and
> then
> freezes and dies.
>
> Questoin is can i use webservice over proxy server( i guess another
> name
> of
> them is ISA ... if i a not wrong), if yes how?
>
> Sameer


Feb 13 '06 #5
I wouldn't think you would want to hard code it into your application.
What I would do is create a factory class - a static class with a static
method that would setup the web service object with the needed proxy info
and return it. You would then change the 100 or so places to call the static
method instead of creating the object directly. This would enable you from
this point on to make changes in one place without having to change it
everywhere.

Another option is to add the info to a configuration file. I'm sure that it
probably supports specification of the proxy information, but I don't use
config files so I can't tell you how to do this.

Tony

"sameer" <sa****@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
tony thanks for you reply, i now know that i can use the code that you
mentioend to involke webservices from behing a proxy server. Another
question
which was part of the previous one is:
my application has a lot of places where it makes the webservice calls,
and
the application is pretty huge. also if at all there is a proxy server
then
my clients would let me know in advance and i could specify this value in
the
application before they start using. So my question is , is there place in
the reference.VB file of the webservice where if i override a function and
specify the proxy Ip and port just ONES per webserivce then evertime this
webserice is initialized , it gets the proxy IP and port and i dont have
to
make this change 100s of times all over the application.

thanks

"Tony" wrote:
I provide a configuration UI in my application where the user is allowed
to
specify if they need to use a proxy server, and if so, they can provide
the
proxy server, port, username and password (sometimes username and
password
are options) and I write this info to a config file to remember them for
the
next time.

I have a method that I use to get a the webservice instance and that
method
attaches the proxy server stuff as indicated in my prev message.

Tony
"sameer" <sa****@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
> Tony,
>
> since some of the clients of this application does not use proxy
> server,
> how
> can i and where exactly in the code should i make changes so that
> depending
> on a setting in the configuration file, it should set up a proxy
> object.
> When
> i say "where can i", i mean to ask is there any call in the
> reference.vb
> file
> where i can override a method which is called every time this
> webserivce
> object is initialized so that once I feed the settings to the
> webservice,
> code in no other places needs to be changed.
>
> Also can you point me to a resource on any website which describes this
> in
> detail.
> thanks
>
> "Tony" wrote:
>
>> Yes, you can but you have provide your proxy server credentials to
>> your
>> web
>> service on the client side as in the following example.
>>
>> The example assumes you have created your web service object (names
>> ..WebService in this example):
>>
>> WebProxy oProxy = new WebProxy(string.Format("{0}:{1}", sProxyServer,
>> nProxyPort), true);
>>
>> oProxy.Credentials = new NetworkCredential(sProxyUsername,
>> sProxyPassword);
>>
>> oWebService.Proxy = oProxy;
>> oWebService.Discover();
>>
>> Hope this helps,
>> Tony
>>
>>
>> "sameer" <sa****@discussions.microsoft.com> wrote in message
>> news:66**********************************@microsof t.com...
>> > .NET Framework 1.1
>> > VS2003
>> > Application is making webservice calls from behind a proxy server
>> > and
>> > then
>> > freezes and dies.
>> >
>> > Questoin is can i use webservice over proxy server( i guess another
>> > name
>> > of
>> > them is ISA ... if i a not wrong), if yes how?
>> >
>> > Sameer
>>
>>
>>


Feb 14 '06 #6
Tony thanks for your suggestions,
talking about configuration file, i am trying to add it to the config file
so that it picks up the default values from the configuration file but it
does not seem to work. Here is the code that i added to the config file, let
me know if you have any suggestions.

<system.net>
<defaultProxy>
<proxy
proxyaddress = "http://proxyserver:80"
/>
</defaultProxy>
</system.net>

thanks
"Tony" wrote:
I wouldn't think you would want to hard code it into your application.
What I would do is create a factory class - a static class with a static
method that would setup the web service object with the needed proxy info
and return it. You would then change the 100 or so places to call the static
method instead of creating the object directly. This would enable you from
this point on to make changes in one place without having to change it
everywhere.

Another option is to add the info to a configuration file. I'm sure that it
probably supports specification of the proxy information, but I don't use
config files so I can't tell you how to do this.

Tony

"sameer" <sa****@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
tony thanks for you reply, i now know that i can use the code that you
mentioend to involke webservices from behing a proxy server. Another
question
which was part of the previous one is:
my application has a lot of places where it makes the webservice calls,
and
the application is pretty huge. also if at all there is a proxy server
then
my clients would let me know in advance and i could specify this value in
the
application before they start using. So my question is , is there place in
the reference.VB file of the webservice where if i override a function and
specify the proxy Ip and port just ONES per webserivce then evertime this
webserice is initialized , it gets the proxy IP and port and i dont have
to
make this change 100s of times all over the application.

thanks

"Tony" wrote:
I provide a configuration UI in my application where the user is allowed
to
specify if they need to use a proxy server, and if so, they can provide
the
proxy server, port, username and password (sometimes username and
password
are options) and I write this info to a config file to remember them for
the
next time.

I have a method that I use to get a the webservice instance and that
method
attaches the proxy server stuff as indicated in my prev message.

Tony
"sameer" <sa****@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
> Tony,
>
> since some of the clients of this application does not use proxy
> server,
> how
> can i and where exactly in the code should i make changes so that
> depending
> on a setting in the configuration file, it should set up a proxy
> object.
> When
> i say "where can i", i mean to ask is there any call in the
> reference.vb
> file
> where i can override a method which is called every time this
> webserivce
> object is initialized so that once I feed the settings to the
> webservice,
> code in no other places needs to be changed.
>
> Also can you point me to a resource on any website which describes this
> in
> detail.
> thanks
>
> "Tony" wrote:
>
>> Yes, you can but you have provide your proxy server credentials to
>> your
>> web
>> service on the client side as in the following example.
>>
>> The example assumes you have created your web service object (names
>> ..WebService in this example):
>>
>> WebProxy oProxy = new WebProxy(string.Format("{0}:{1}", sProxyServer,
>> nProxyPort), true);
>>
>> oProxy.Credentials = new NetworkCredential(sProxyUsername,
>> sProxyPassword);
>>
>> oWebService.Proxy = oProxy;
>> oWebService.Discover();
>>
>> Hope this helps,
>> Tony
>>
>>
>> "sameer" <sa****@discussions.microsoft.com> wrote in message
>> news:66**********************************@microsof t.com...
>> > .NET Framework 1.1
>> > VS2003
>> > Application is making webservice calls from behind a proxy server
>> > and
>> > then
>> > freezes and dies.
>> >
>> > Questoin is can i use webservice over proxy server( i guess another
>> > name
>> > of
>> > them is ISA ... if i a not wrong), if yes how?
>> >
>> > Sameer
>>
>>
>>


Feb 14 '06 #7

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

Similar topics

0
by: Andy Todd | last post by:
Hi We have just moved an ASP.NET application into the live environment which is as follows: Sun Proxy Server / Firewall Windows 2000 Server / IIS5 The URL for the site maps to the Sun...
5
by: Bill Hauver | last post by:
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...
2
by: Daniel Santana | last post by:
Hi, about Java WebServices, accessed by C#, I have two questions: 1) what I have to do, in order to use java webservices? 2) I search and I guess I must type the wsdl path in "add web reference"....
8
by: Allan Ebdrup | last post by:
I just had a discussion with one of my fellow programmers. We have a class for doing some logging and sending an email, it has 5 different scenarioes of loggin that are common enough to share a...
1
by: Andy Todd | last post by:
Hi We have just moved an ASP.NET application into the live environment which is as follows: Sun Proxy Server / Firewall Windows 2000 Server / IIS5 The URL for the site maps to the Sun...
2
by: M.Posseth | last post by:
scenario : I had a remoting server , now this remoting server needed the ability to comunicate with a Delphi 5 client, so i got the advise to switch to webservices now i rebuilded the...
2
by: sameer | last post by:
hi all, Description of my .net application: Desktop application using webservices over the internet to communicate with the sql server2000 database which is sitting behind the webserver. Done...
0
by: sameer | last post by:
hi all, Description of my .net application: Desktop application using webservices over the internet to communicate with the sql server2000 database which is sitting behind the webserver. Done...
1
by: Jon Ebersole | last post by:
I am developing a webservice and a windows application that talk to each other. They are using a standard VB class library in the background. I am having problems understanding why I can't sync my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
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...

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.