'Illegal characters in path.' occurred when attempting to 'Run script'

Hi,

I’m using Aspose Words for .NET in combination with Metastorm BPM 9.0.3.1. When I use external assembly Aspose.Word.dll (checked with both 9.and last 9.7) I receive an error:

Log Name: Application
Source: Metastorm Web Extensions
Date: 18.3.2011 11:02:28
Event ID: 113
Task Category: (13)
Level: Error
Keywords: Classic
User: N/A
Computer: Brane-THINK
Description:
Error in: http://localhost/Metastorm/eActionFormContents.ashx
Action: FirstAction
Map: POCProcess
Service: Metastorm BPM Server
Error Message: Exception ‘Illegal characters in path.’ occurred when attempting to ‘Run script’.
Illegal characters in path.

I saw several messages in forum on this subject, but no solution. Any help would be appreciated.

Best regards,
Branko

Hi

Thanks for your inquiry. Could you please provide me the code and the document, which will allow me to reproduce the problem on my side? I will investigate it and provide you more information.

Best regards,

Hi,

the code is really just basic example from documentation:

#region Using Statement

using System;
using System.Data;
using System.Collections.Generic;
using Metastorm.Ide.Extensibility;
using Metastorm.Runtime.Core;
using Metastorm.Runtime.Types;
using System.ComponentModel;

using Aspose.Words;

#endregion Using Statement

namespace Metastorm.Runtime.Models.POC
{
    public class PocScript
    {
        #region Method createDoc

        [Promote(PromotionTargets.ExpressionBuilder)]
        [Category("Inovo")]
        public static string createDoc()
        {
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder();
            builder.Writeln("test");
            doc.Save("C:\tmp\test.docx");
            return ("test");
        }

        #endregion Method createDoc
    }
}

If needed we can provide access to Metastorm BPM + Aspose environment.

Best regards,
Branko

Hi

Thank you for additional information. I cannot reproduce the problem on my side using the latest version of Aspose.Words. Could you please explain how I can reproduce the problem, or create simple application which allows me to reproduce it.

Best regards,

Hi,

to reproduce the problem you would have to install Metastorm BPM Evironment. Although I reproduced the same problem also through Visual Studio 2010 C# web service. Received the same error:

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Aspose.Words;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]

public class Service : System.Web.Services.WebService
{
    public Service()
    {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string HelloWorld()
    {
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder();
        builder.Writeln("test");
        doc.Save("C:\tmp\test.docx");

        return ("test");
    }

}

On web service invokation I receive error:

System.ArgumentException: Illegal characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path)
   at System.IO.Path.GetExtension(String path)
   at Aspose.Words.Saving.SaveOptions.CreateSaveOptions(String fileName)
   at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
   at Aspose.Words.Document.Save(String fileName)
   at Service.HelloWorld() in c:\Users\Brane\Documents\Visual Studio 2010\WebSites\WebSite1\App_Code\Service.cs:line

I can give you access to test environment if needed.

Best regards,
Branko

Hello

Thanks for your request. Please try using the following code and let me know how it goes on your side:

[WebMethod]
public string HelloWorld()
{
    Document doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);
    builder.Writeln("MyTest");
    doc.Save("C:\\Temp\\Test.docx");
    return ("test");
}

Best regards,

Hi,

double backslash works.Thnx for help.

Best regards,
Branko