- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello. I'm trying to understand the nuances of custom jobs for the job processor and i've hit a snag. Basically, when i try to reference the context.connection, I'm getting the following:
CreatePDF started...;Error=311;Type=System.Web.Services.Protocols.SoapException;Stack= at Connectivity.JobHandlers.Services.Utils.JobHelper.LoginToVault(String username, String password, String vaultname, String server, Boolean winAuth)
at Connectivity.JobHandlers.Services.Objects.ServiceJobProcessorServices.get_Connection()
at Walmart.StoreLayout.VaultJobs.TestJobHandler.Execute(IJobProcessorServices context, IJob job) in d:\jpark18\Visual Studio 2012\Projects\wmtuscad\CadUtilities\VaultUploader\StoreLayoutTestJob\TestJob.cs:line 42
The code looks like this:
public class TestJobHandler : ACJE.IJobHandler { public string WorkingFolder { get; set; } public TestJobHandler() { WorkingFolder = "C:\\temp\\vault\\jobprocessor"; } public bool CanProcess(string jobType) { if (jobType.ToLower() == "walmart.storelayout.createpdf") return true; return false; } public ACJE.JobOutcome Execute(ACJE.IJobProcessorServices context, ACJE.IJob job) { context.Log("CreatePDF started...", ACJE.MessageType.eInformation); try { long fileMasterId = Convert.ToInt64(job.Params["FileId"]); // Retrieve the file object from the server // Code fails here --> Debug.WriteLine("connected={0};iswindows={1};user={2}", context.Connection.IsConnected, context.Connection.IsWindowsAuthenticatedConnection, context.Connection.UserName); ACW.File file = context.Connection.WebServiceManager.DocumentService.GetLatestFileByMasterId(fileMasterId); VDF.Vault.Currency.Entities.FileIteration fileIter = context.Connection.FileManager.GetFilesByIterationIds(new long[] { file.Id }).First().Value; // Download and publish the file // Publish(fileIter, context.Connection); return ACJE.JobOutcome.Success; } catch (Exception e) { context.Log("Error={0}".FMe(e.Message), ACJE.MessageType.eError); context.Log("Type={0}".FMe(e.GetType().FullName), ACJE.MessageType.eError); context.Log("Stack={0}".FMe(e.StackTrace), ACJE.MessageType.eError); return ACJE.JobOutcome.Failure; } }
A fiddler trace shows:
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Length: 1839
Content-Type: multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:b6feab63-b9c1-4e08-a8fa-7d7ab552a3d6+id=46";start-info="text/x...
Server: Microsoft-IIS/7.5
MIME-Version: 1.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 09 Jun 2014 22:25:54 GMT
--uuid:b6feab63-b9c1-4e08-a8fa-7d7ab552a3d6+id=46
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Server</faultcode><faultstr... xml:lang="en-US">311</faultstring><detail><sl:sldetail xmlns:sl="http://streamline.autodesk.com/faultschema"><sl:errorcode>311</sl:errorcode><sl:mesg-id>635379315551... sl:pid="1">domain\userid</sl:param><sl:param sl:pid="2">ActiveDirectory</sl:param><sl:stack> at Connectivity.Server.Proxies.ServiceAccessor`3.tryexecute(String remoteServer, Action`1 action, Int32 attemptCount)
at Connectivity.Server.Proxies.ServiceAccessor`3.Execute(String remoteServer, Action`1 action)
at Connectivity.Filestore.AuthenticationService.CreateSession(AuthCredentials creds, String dataServer, String knowledgeVault, Boolean isLicensed, Byte[] p)
at Connectivity.Web.Filestore.v18.AuthService.SignIn(String dataServer, String userName, String userPassword, String knowledgeVault)
at SyncInvokeSignIn(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</sl:stack></sl:sldetail></detail></s:Fault></s:Body></s:Envelope>
--uuid:b6feab63-b9c1-4e08-a8fa-7d7ab552a3d6+id=46--
Any thoughts or advice would be appreciated. I've just been referring to the sample code and i don't see any reason for the reference to the connection to blow up. The domain\userid has rights to log in and it starts up, pulls the job, but when it tries to execute it, it fails.
Please advise,
Jon
Solved! Go to Solution.