Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Need to set username and password in web.config for ISA Proxy for WCF client

Reply
Thread Tools

Need to set username and password in web.config for ISA Proxy for WCF client

 
 
Andrew Jocelyn
Guest
Posts: n/a
 
      12-02-2008
Hi

I need to explicity set a username and password in the web.config file of a
SharePoint server to use a ISA proxy server. Aparantly the ISA server won't
accept credentials if they are not the currently logged on user. Real code
examples needed please.

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ServiceSoap"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
allowCookies="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536"
maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Text"
textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="false"
bypassProxyOnLocal="false"
proxyAddress="http://localhost:8888/">
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"
/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://endpoint/service.asmx"
binding="basicHttpBinding" bindingConfiguration="ServiceSoap"
contract="Service.ScsServiceSoap" name="ServiceSoap"/>
</client>
</system.serviceModel>

This doesn't work if useDefaultWebProxy is true in the basicHttpBinding.

<system.net>
<defaultProxy>
<proxy usesystemdefault="True" proxyaddress=http://localhost:8888 />
</defaultProxy>
</system.net>

Many thanks
Andrew



 
Reply With Quote
 
 
 
 
Steven Cheng
Guest
Posts: n/a
 
      12-03-2008
Hi Andrew,

From your description, I understand that you have a sharepoint server which
contains some code that invoke a remote WCF service. And since the WCF
service is accessed through a ISA proxy, you're wondering how to specify
the username/password credentials for the ISA proxy's authentication,
correct?

If so, I think the problem here is that web.config(or app.config) file only
contains the proxy address info(such as whether use system default one or
your cusotm proxy address). There is no configuration entry for you to
supplyl the authentication credentials for proxy.

For your case, I've also handled a former issue with the similar scenario.
In WCF if you need to perform authentication against a proxy server, and
the credentials for the proxy server authentication is different from your
WCF client's process account(security context), you might consider using
the following means:

1. still set the <system.net> and WCF <binding> useDefaultWebProxy to true.
In such cases, the WCF runtime will retrieve proxy info from the
"WebRequest.DefaultWebProxy" static property. Thus, you can supply a
custom WebProxy object at your application's initial stage(with
authentication credentials ). e.g.

===================
//before your WCF method call executes

WebProxy wproxy = new WebProxy("new proxy",true);
wproxy.Credentials = CredentialCache.DefaultNetworkCredentials;// or you
can construct a custom NetworkCredential from username/password

WebRequest.DefaultWebProxy = wproxy;

===================

here is the former thread which mentioned details on this:

#WCF Proxy Server settings not working - cmuelle
http://www.eggheadcafe.com/software/...server-setting
s.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
http://www.velocityreviews.com/forums/(E-Mail Removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.





--------------------
>From: "Andrew Jocelyn" <(E-Mail Removed)>
>Subject: Need to set username and password in web.config for ISA Proxy for

WCF client
>Date: Tue, 2 Dec 2008 18:39:46 -0000


>
>Hi
>
>I need to explicity set a username and password in the web.config file of a
>SharePoint server to use a ISA proxy server. Aparantly the ISA server won't
>accept credentials if they are not the currently logged on user. Real code
>examples needed please.
>
><system.serviceModel>
> <bindings>
> <basicHttpBinding>
> <binding name="ServiceSoap"
> closeTimeout="00:01:00"
> openTimeout="00:01:00"
> receiveTimeout="00:10:00"
> sendTimeout="00:01:00"
> allowCookies="false"
> hostNameComparisonMode="StrongWildcard"
> maxBufferSize="65536"
> maxBufferPoolSize="524288"
> maxReceivedMessageSize="65536"
> messageEncoding="Text"
> textEncoding="utf-8"
> transferMode="Buffered"
> useDefaultWebProxy="false"
> bypassProxyOnLocal="false"
> proxyAddress="http://localhost:8888/">
> <readerQuotas maxDepth="32" maxStringContentLength="8192"
>maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"
>/>
> </binding>
> </basicHttpBinding>
> </bindings>
> <client>
> <endpoint address="http://endpoint/service.asmx"
>binding="basicHttpBinding" bindingConfiguration="ServiceSoap"
>contract="Service.ScsServiceSoap" name="ServiceSoap"/>
> </client>
></system.serviceModel>
>
>This doesn't work if useDefaultWebProxy is true in the basicHttpBinding.
>
><system.net>
> <defaultProxy>
> <proxy usesystemdefault="True" proxyaddress=http://localhost:8888

/>
> </defaultProxy>
></system.net>
>
>Many thanks
>Andrew
>
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Ajax Enabled WCF service and regular WCF? Cindy Lee ASP .Net 1 03-19-2010 05:59 PM
WCF service call - problem when behind ISA Server proxy SESDev ASP .Net Web Services 6 10-29-2009 08:41 AM
how to set username and password for each isa client seekndestroy88@gmail.com ASP .Net Web Services 0 12-16-2008 03:46 AM
Need to set username and password in web.config for ISA Proxy for WCF client Andrew Jocelyn ASP .Net Web Services 0 11-29-2008 05:21 PM
Help: Connecting to a password-protected webservice through a proxy server (ISA 2000) Hanz Gruuber ASP .Net Web Services 0 04-29-2005 04:58 AM



Advertisments