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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vel EousResearch & 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.