By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,743 Members | 1,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,743 IT Pros & Developers. It's quick & easy.

Webservices called from behind proxy server fails

P: n/a
..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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.