Unable to FTP into Azure web app - azure

This problem first came about when I learned that a client of ours was running into permission errors on their site.
[IOException: The media is write protected.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +11804343
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1326
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +60
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync) +54
System.Xml.XmlWriterSettings.CreateWriter(String outputFileName) +155
System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings) +23
System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options) +116
Umbraco.Core.Services.ApplicationTreeService.LoadXml(Action`1 callback, Boolean saveAfterCallback) +202
Umbraco.Core.Services.ApplicationTreeService.Intitialize(IEnumerable`1 existingTrees) +68
Umbraco.Web.Trees.ApplicationTreeRegistrar.ScanTrees(ApplicationContext applicationContext) +667
Umbraco.Web.Trees.ApplicationTreeRegistrar.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +9
Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +37
Umbraco.Core.CoreBootManager.<Complete>b__5(IApplicationEventHandler x) +19
Umbraco.Core.EnumerableExtensions.ForEach(IEnumerable`1 items, Action`1 action) +141
Umbraco.Core.CoreBootManager.Complete(Action`1 afterComplete) +94
Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) +38
Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) +154
Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e) +9
[HttpException (0x80004005): The media is write protected.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9966013
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +352
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): The media is write protected.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9947380
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261
So I tried to connect to the server with
ftp://waws-prod-bay-###.ftp.azurewebsites.windows.net
to troubleshoot the issue. Unfortunately, it errored out with the following message.
Can't connect to 'waws-prod-bay-###.ftp.azurewebsites.net' on port 21. Check the server name and proxy settings. If the settings are correct, the server may be temporarily unavailable.
So I tried creating a second ftp user, since the current one wasn't shown in the FTP/DEPLOYMENT USER field underneath the app's properties. This failed too.
Then I tried downloading the publish settings and used the credentials in there. No luck.
Lastly, I tried creating a new a new app to see whether it was a problem for all apps on the account or just the one. While it took much longer than usual to initialize, I was able to ftp into it once it was done.
Any ideas on what the problem is? I had found this, which lead to
this which says the problem (or a similar one at least) was resolved about 8 months ago.
Thanks for the help.
Edit:
I am able to ftp now, but I'm not going to flag this as resolved, since I don't know what fixed it. If anyone encounters this issue, please try juvchan's suggestion in the comments.

I would recommend trying the following to gain access
The simplest thing to try would be to restart the app in the portal. I've seen this same issue and restarting the app fixes it.
If that does not work, try actually resetting the deployment credentials rather than adding a new user.
To reset your deployment credentials go to the web app blade, click on All Settings -> Deployment Credentials. It will then let you reset the username AND password. Again; I have seen this as an issue too.

Related

RavenDB interface runs on Pipelight but can't authenticate in linux?

I have strange problem. Unfortunately i have to use RavenDB and the local machine is linux. Thankfully i managed to install some silverlight support by using Pipelight and it seems to work ok.
Jut one thing doesn't work at all.
When i open the database interface, it loads in, shows my documents but when i need to authenticate and it opens the authentication window, it simply doesn't pass the authentication. Or as it seems to me, it even doesn't pass username and password further to the server at all.
(of course, i tested on windows from Internet Explorer and it works OK)
This is the error that i get:
Could not authenticate against the server
Message: [HttpWebRequest_WebException_RemoteServer]
Arguments: NotFound
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.20513.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer
Uri: /edit?id=asdf&database=test
Server Uri: http://asdfasfd/databases/asdfasdf/docs/asdfadf
-- Error Information --
System.Net.WebException: [HttpWebRequest_WebException_RemoteServer]
Arguments: NotFound
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.20513.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer
at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Func`2.Invoke(T arg)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise)
Inner StackTrace:
at Raven.Studio.Infrastructure.InvocationExtensions.Catch(Task parent, Action`1 action)
at Raven.Studio.Models.EditableDocumentModel.SaveDocumentCommand.SaveDocument()
at Raven.Studio.Models.EditableDocumentModel.SaveDocumentCommand.Execute(Object parameter)
at System.Windows.Controls.Primitives.ButtonBase.ExecuteCommand()
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

Error associating Azure SQL database with Azure website: System.NullReferenceException: Object reference not set to an instance of an object

I am having a strange error with publishing my website to Azure. I published it to the service using VS 2010 but then have run into this error in connecting my database to the website. The login page works, as do most of the pages on the site, even those that rely on the very same database. The page with the issue comes up with the following text:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
MAO.Controllers.ReviewController.Index() +603
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +214
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
System.Web.Mvc.Controller.ExecuteCore() +106
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +48
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629708
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
The error occurs within the following section of code:
public ActionResult ShortDateResponse(int reviewId, int questionId, string response) {
if (string.IsNullOrEmpty(response)) {
var answer = repository.GetAnswerByQuestionId(reviewId, questionId);
if (answer != null) {
repository.DeleteAnswerById(answer.Id);
}
} else {
try {
DateTime date = DateTime.ParseExact(response, "MM/yyyy", CultureInfo.InvariantCulture);
repository.ShortDateResponse(reviewId, questionId, date);
} catch (Exception fe) {
throw new ArgumentException("Date format should be MM/yyyy", fe);
}
}
return Json(new {
success = true,
error = "none"
});
}
on this line:
DateTime date = DateTime.ParseExact(response, "MM/yyyy", CultureInfo.InvariantCulture);
As such, it seems to me the code is not responsible.
I have tried uploading the database to Azure multiple different ways, and according to the various Microsoft tutorials, and have reviewed others who have presented very similar questions on SO and other places. At this point I am not sure how to move forward, so I'm asking.
Initially, I used SQL Management Studio 2008R's "Extract Data-Tier Application" and "Import Data-Tier Application" to load the schema for the database, then "Export Data" and "Import Data" to load up the data onto the server. I ensured that the commandtimeout variable was sat to 0 for all tables so nothing would get lost along the way, and sure enough, everything showed up on the Azure database.
When this presented the aforementioned error, I attempted to use the "Generate scripts" to upload the schema, in case there had been some error with my previous process. I then used Export/Import Data to put the data on the website. I received the same error.
This website does work properly on internal servers, an has been deployed successfully elsewhere, but I'd like to migrate to Azure if possible. Also, I have checked the uploaded website linked to local SQL servers and it has worked properly, so the issue lies in the upload of the SQL database to Azure servers.
I am aware that many people with this error have been able to solve it by editing their connection strings within web.config. I have looked into this, and have manually edited my connection string via Filezilla to the format put forth on various websites, to no avail.
I would really appreciate any insights you have, and let me know if you need more details. Thank you!
One thought is that it might be the firewall rule on the SQL Azure instance. In the Windows Azure Management Portal, go to the "Configure" page for that SQL Azure server. Is it set to "Yes" for allow windows azure services?
Can you also post the code for the controller action MAO.Controllers.ReviewController.Index() so we can see where the null reference exception occurs?

Trouble getting Caching working inside Azure Web Sites

I'm trying to get Caching working on my Windows Azure Website. The caching is configured on one of my Worker Roles.
I used this article to get started: http://www.windowsazure.com/en-us/develop/net/how-to-guides/cache/
Initially I've had trouble to get the Azure Cache Client dll working because of missing assembly errors.
Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'msshrtmi, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Though I've been helped by this article to resolve this: http://www.thedailyparker.com/PermaLink,guid,0be6425e-b509-4122-af01-7086ce2f811e.aspx
But next I'm getting a SEHException which sounds like a configuration problem. Though I've no idea what I'm missing.
Exception Details:
[SEHException (0x80004005): External component has thrown an exception.]
RdGetApplicationConfigurationSetting(UInt16* , UInt16** ) +0
RoleEnvironmentGetConfigurationSettingValueW(UInt16* pszName, UInt16* pszDest, UInt32 cchDest, UInt32* pcchRequiredDestSize) +47
Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropRoleManager.GetConfigurationSetting(String name, String& ret) +91
Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue(String configurationSettingName) +54
Microsoft.ApplicationServer.Caching.AzureCommon.TopologyHelper.TryGetServiceConfigurationSetting(String value, String& result) +40
Microsoft.ApplicationServer.Caching.AzureCommon.DiagnosticsUtility.GetDiagnosticLevel(String propertyName) +47
Microsoft.ApplicationServer.Caching.AzureCommon.DiagnosticsUtility.GetClientLogLevel() +20
Microsoft.ApplicationServer.Caching.AzureClientHelper.RoleUtility.ReadClientLogLevel() +5
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
Microsoft.ApplicationServer.Caching.DataCacheFactoryConfiguration.Initialize(String clientName) +205
Microsoft.Web.DistributedCache.DataCacheFactoryWrapper.CreateDataCacheFactoryConfiguration(String dataCacheClientName) +77
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.CreateInternalProvider(IHttpRuntime httpRuntime, OutputCacheInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler`1 cacheFetching, EventHandler`1 cacheFetched) +28
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.GetInternalProvider() +148
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.Get(String key) +11
System.Web.Caching.OutputCache.Get(String key) +56
System.Web.Caching.OutputCacheModule.OnEnter(Object source, EventArgs eventArgs) +9717054
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
I hope someone can help me in the right direction.
You cannot access Windows Azure Caching from a Web Site. You can only access it from a Web Role or Worker Role.
Have you tried Windows Azure Shared Caching in your Web Site? This should work (haven't tried this myself in a Web Site).

SharePoint PropertyBag Settings 2010 access denied 0x80070005

I'm trying to get SharePoint PropertyBag Settings 2010 working in my Central Administration site, and it seems to be working, at least partly. However, there's a problem: when I click the web application dropdown and select a web application (on :8000) I get this access denied error:
Site Enumeration Stack:
at Microsoft.SharePoint.SPBaseCollection.GetEnumerator()
at ASP._admin_pbs2010_propertybagssettings_aspx.ddlWebApplications_SelectedIndexChanged(Object sender, EventArgs e)
at System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e)
at System.Web.UI.Page.RaiseChangedEvents()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP._admin_pbs2010_propertybagssettings_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
Followed by:
Unknown SPRequest error occurred. More information: 0x80070005
The strange thing is that on another web application (:80), it all works just fine. The only appreciable difference between these sites is that :8000 is configured for both Windows auth and forms auth, while :80 is Windows auth only.
Any hints?
There is a patch that just came out that fixed this issue for me. Check out http://pbs2010.codeplex.com/workitem/7839
Are you referring to this codeplex project: http://pbs2010.codeplex.com/ If so, you might want to try posting in the discussions for the original author of the code to answer http://pbs2010.codeplex.com/discussions Otherwise, I suggest you check out the MS Patterns and Practice Group SharePoint Guidance project: http://spg.codeplex.com/ It also has code for property bags and you may find it more reliable.

Sharepoint Word Automation Services Exception

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.
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.

Resources