0

I have written a Console application that makes an HTTP POST to a ASMX Web Service (within Sharepoint) that I am looking to invoke remotely with WinRM. I have written a PowerShell process that bundles up the built application, moves it to the destination server, and executes it locally. The process works completely fine (ie moving copying, what-have-you), but fails when it gets to the Web Service call. Looking at logs on Fiddler, the HTTP Post request has no credentials in it at all, even though the application is being ran with an account that has all the proper permissions.

Since the application is moved to the destination server locally, I can run it locally, which I have done, and it works completely fine, as the Fiddler logs show the correct credentials in the header.

I am not sure where the issue resides, but I am having a hard time thinking its my code, since it works fine when ran locally. It may be with the WinRM process, but the exact same process works for other environments (this project is part of a larger deployment solution that deploys databases, ssis packages , etc).

I am happy to provide code of certain pieces if needed, and any basic troubleshooting advice would be greatly appreciated.

EDIT

The user credentials I specify in a xml file that contains the username and a hashed password, like this in Powershell

 powershell.exe -version 3.0 -ExecutionPolicy RemoteSigned -command "& { $cred=Import-Clixml '%CREDENTIAL_FILENAME%' ; $cred.Password=ConvertTo-SecureString $cred.Password ; $Credential=New-Object System.Management.Automation.PsCredential($cred.UserName, $cred.Password) ; invoke-command -computername %MACHINE% -filepath %Result% -Credential $Credential }"
Isaac Levin
  • 2,549
  • 6
  • 41
  • 78
  • What user account is the client application running under exactly? Where, and how, in your code do you indicate that you want credentials to be attached to the request? – EricLaw May 14 '14 at 19:56
  • @EricLaw I added what you requested to the question. – Isaac Levin May 14 '14 at 21:44
  • Your app has to establish a HTTP session and login to Sharepoint first, then it'll have the data. You might need to enable NTLM auth in Sharepoint, and use IE to connect to SP and then form the POST request. – Vesper May 15 '14 at 10:44
  • So there is no way to just call the SharePoint webservice in code? The call works fine locally but fails via WinRM. Is it a double hop issue? – Isaac Levin May 15 '14 at 13:21

0 Answers0