1
votes

I am trying to do a server side doc/docx to pdf conversion using Word Automation Services. I am using the basic sample from MSDN, Link: http://msdn.microsoft.com/en-us/library/ff742315.aspx and encounter an obscure error every time ConversionJob's Start() method is called. Here's the exception;

Source: mscorlib

Message: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.

InnerException: System.ServiceModel.FaultException: An error occurred when verifying security for the message.

StackTrace: Server stack trace: at System.ServiceModel.Channels.SecurityChannelFactory1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory1.SecurityRequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.IdentityModel.Protocols.WSTrust.IWSTrustContract.Issue(Message message) at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr) at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst) at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo) at Microsoft.SharePoint.SPSecurityContext.<>c_DisplayClass7.b_6() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurityContext.GetProcessSecurityTokenForServiceContext() at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForServiceContext(Uri contextUri) at Microsoft.SharePoint.SPChannelFactoryOperations.InternalCreateChannelActingAsLoggedOnUser[TChannel](ChannelFactory1 factory, EndpointAddress address, Uri via) at Microsoft.SharePoint.SPChannelFactoryOperations.CreateChannelActingAsLoggedOnUser[TChannel](ChannelFactory1 factory, EndpointAddress address) at Microsoft.Office.Word.Server.Service.ConfigChannelFactory1.CreateChannel() at Microsoft.Office.Word.Server.Service.WordServiceApplicationProxy.AddJob(Ucid ucid, Nullable1 subscriptionId, SPUserToken userToken, ConversionJobSettings settings, String name) at Microsoft.Office.Word.Server.Conversions.ConversionJob.Start() at VisualWebPartProject1.VisualWebPart1.VisualWebPart1UserControl.Page_Load(Object sender, EventArgs e)

I tried the same code inside one of our sharepoint sites, still got the same error. Trying this inside a Wcf Service has same result. I made a visual web part for this and same error. Changing user accounts or RunWithElevatedPrivileges didn't help either.

Since the sample requires Microsoft.Sharepoint and Microsoft.Office.Word.Server.Conversions namespaces, I have to run this code on some server having sharepoint installed. So IMHO, the time skew issue is not related as the code is ran over the same server where Word Automation Services are present. I expect some configuration problems on the sharepoint server side, but I don’t know what to check.

Let me know if any other details are required, thanks.

1

1 Answers

1
votes

Without having more specifics around the code you're running it's hard to say. Take a look at the overall Word Automation Services content in the SDK. Also, check out the topics under "Configuring Word Automation Services for Development" in the SDK in particular.