Free Support Forum - aspose.com

Web service and deployment license

Just a question – on calling a web service and how to use deployment licence.

The web application sets on a machine called dsnet – the machine I made a licence for – filename: aspose.report.lic.

There is a middle-ware machine called dsapps1 behind the firewall that the web application calls – Where do I place the deployment licence? or how to I call the web method to remove the evaluation message if the function is split between the two machines?

On the webServer I have:

Dim strFileNamePath As String = ConfigurationSettings.AppSettings(“DocPath”) + e.Item.Cells(1).Text

Dim loArray As Byte()

Dim loProxy As New CorrLtrWS.CorrLtrs

Dim loWord As New Aspose.Word.Word

loWord.SetLicense(linencePath,Me.Page)

loArray = loProxy.GetStream(strFileNamePath)

Dim loStream As New MemoryStream(loArray)

Dim xmlDoc As XmlDocument = New XmlDocument

xmlDoc.Load(loStream)

'Read the document in Aspose.Pdf.Xml format into Aspose.Pdf.

Dim pdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf

pdf.SetLicense(licencePath, Me.Page)

pdf.BindXML(xmlDoc, Nothing)

'Instruct to delete temporary image files.

pdf.IsImagesInXmlDeleteNeeded = True

'Produce the PDF file.

pdf.Title = “Correction Letter”

pdf.Security = New Aspose.Pdf.Security

pdf.Security.IsContentsModifyingAllowed = False

pdf.Security.IsCopyingAllowed = False

pdf.OpenType = Aspose.Pdf.OpenType.Auto

pdf.Save(“Correction Letter”, Aspose.Pdf.SaveType.OpenInBrowser, Me.Response)

Me.Response.End()

In the web service:

Dim word As Word = New Word

'This is where I assume I have to reference the licence file – but, how?

Dim doc As Document = New Document(strFileNamePath)

Dim loStream As New MemoryStream

doc.Save(loStream, SaveFormat.FormatAsposePdf)

loStream.Seek(0, SeekOrigin.Begin)

Return loStream.ToArray

Am I misssing something? If so, would I have to redo the deployment licence for our middle-ware machine and do all the processing on that machine in the web service and then stream the result to the web server? I guess I could rewrite it and change the licence, but is that necessary?

With Aspose.Word you need to call SetLicense on the machine that will execute Document.Save. It is likely to be the same for Aspose.Pdf.

Our licenses can be for Web or Windows platform. You normally use a Web platform license when you have an easy access to a Page object such as in ASP.NET application. For all other cases Windows platform license is recommended.

If you need to regenerate a license or change its type, it is no problem. Please contact sales@aspose.com and quote your order number, I will let them know about this question too.