WCF - Read File - Logon failure: unknown user name or bad password

Hi guys,

I have a WCF service that needs to read a file off a network drive.

Everytime the service tries to access the file I'm getting an error saying:

Logon failure: unknown user name or bad password


What do I need to do to allow the service to access the file? I'm guessing I need to set something in the Web.Config file, but I'm not sure what?

Thanks
basil365Asked:
Who is Participating?
 
Vel EousConnect With a Mentor Research & Development ManagerCommented:
Are you getting the error attempting to access the service, or the file.  Also does your service have an security configurations applied such as Windows Authentication?

http://msdn.microsoft.com/en-us/library/ms733089.aspx
0
 
basil365Author Commented:
I'm getting the error when trying to access the file.

I haven't set the security configurations, below is bindings section of my Web.Config file:

<bindings>
  <wsHttpBinding>
	<binding name="Binding1"  maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
	  <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
		  maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
	  <security mode="None"/>
	  <!-- Binding property values can be modified here. -->
	  <!--See the next procedure. -->
	</binding>
  </wsHttpBinding>
  <basicHttpBinding>
	<binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
		openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
		allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
		maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
		messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
		useDefaultWebProxy="true">
	  <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
		  maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
	  <security mode="None">
		<transport clientCredentialType="None" proxyCredentialType="None"
			realm="" />
		<message clientCredentialType="UserName" algorithmSuite="Default" />
	  </security>
	</binding>
  </basicHttpBinding>
</bindings>

Open in new window

I've looked at the Message Security articles in the link you provided, but I'm still not sure what exactly needs to be set to allow the service to access the file.

Thanks.
0
 
n_vijayCommented:
How are you connecting to network drive (UNC, WebDAV), and are you passing user name and password for connecting to the drive.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.