WNetAddConnection2A & Web Services
-
I have a class which wraps the mpr.dll functions that I've used in may applications before. But now I'm attempting to use them in a WebService and the WNetAddConnection2A fails everytime. Any known issue with using these method with Web Services ?
-
I have a class which wraps the mpr.dll functions that I've used in may applications before. But now I'm attempting to use them in a WebService and the WNetAddConnection2A fails everytime. Any known issue with using these method with Web Services ?
Of course it does! The ASPNET account that your webservice runs under, by default, doesn't have permissions to any other network resources. No permissions, no access and the call fails. Either grant the ASPNET account permissions to the network resource you are trying to map to or create a user account that has those permissions and change the account your webservice runs under. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Of course it does! The ASPNET account that your webservice runs under, by default, doesn't have permissions to any other network resources. No permissions, no access and the call fails. Either grant the ASPNET account permissions to the network resource you are trying to map to or create a user account that has those permissions and change the account your webservice runs under. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
So even though I providing a username and password in the call to WNetAddConnection2A, I need to give permissions in order to even make the call ?
-
So even though I providing a username and password in the call to WNetAddConnection2A, I need to give permissions in order to even make the call ?
Does the account name you're providing have the appropriate rights to the network resource? Are you sure your using the correct name and password? Things can be a bit confusing in a domain environment and different in a workgroup. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Does the account name you're providing have the appropriate rights to the network resource? Are you sure your using the correct name and password? Things can be a bit confusing in a domain environment and different in a workgroup. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Yes, the account name I'm providing is the local administrator on that machine. I'm not using any domains at this point. The weird thing is that the function returns immediatly, it seems like there isn't even enough time for the remote machine to accept or reject the call.
-
Yes, the account name I'm providing is the local administrator on that machine. I'm not using any domains at this point. The weird thing is that the function returns immediatly, it seems like there isn't even enough time for the remote machine to accept or reject the call.
Try changing the account that your web service is running under. I get the feeling that the ASPNET account doesn't have any network resource rights to make a connection to anything. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Try changing the account that your web service is running under. I get the feeling that the ASPNET account doesn't have any network resource rights to make a connection to anything. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
I've already searched online for instructions on how to do this correctly and attempted it, but have been unable to do so. I've changed the ASPNET user password on both machines to the same password and given the account read/write access to the files. But even after I change the password field in the machine.config file the web server will not load the web service. The only way I get it to function properly is to run the aspnet_regiis.exe command to reset the password toa randomly generated one. Have you ever successfully change the ASPNET password ?
-
I've already searched online for instructions on how to do this correctly and attempted it, but have been unable to do so. I've changed the ASPNET user password on both machines to the same password and given the account read/write access to the files. But even after I change the password field in the machine.config file the web server will not load the web service. The only way I get it to function properly is to run the aspnet_regiis.exe command to reset the password toa randomly generated one. Have you ever successfully change the ASPNET password ?
What are you changing the password for???? There's no reason to do it. Create an account that your web service will run under and change it to that account in IIS. On a second thought, why are you mapping a drive inside a web service? This drive mapping will disappear as soon as the current call to the web service returns. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
What are you changing the password for???? There's no reason to do it. Create an account that your web service will run under and change it to that account in IIS. On a second thought, why are you mapping a drive inside a web service? This drive mapping will disappear as soon as the current call to the web service returns. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
I guess I thought that all ASP.NET web services and applications ran under the ASPNET account. Where do I change the account at ? I know where to change the anonymous access but that is using IUSR_MACHINE account. I don't see anyplace to change the ASPNET user account. I don't neccessarily have to map a drive, I'm just triing to get access to files on a share on another machine. I have been unable to do so thus far and thought providing a login while mapping a drive would get around the security problems.