We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Web Service error

I am getting an error like this, when i am trying to communicate to the webservice url hosted on other machine..Could u please able to help me?

body { margin: 0 0 0 0; padding:0 0 0 0 } td,div { font-family:Georgia;font-size:10pt;vertical-align:top } body { margin: 0 0 0 0; padding:0 0 0 0 } .transcript { background-color:#d2d2d2; } .messageBlock { margin-left:4px; margin-bottom:3px } .message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; } .messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;} .other { color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .myself { color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre; } .showTimestamp { margin-right:3px; float:right; color:#999999;font-style:normal;font-weight:normal; } .other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; } .otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .tsDisplay { display:block }

Unable to automatically step into the server. Connecting to the server machine 'XXXXX' Failed.The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer

Hi,

Can you please specify which Aspose product are you using?

Best Regards,

Hi,

I am using Aspose.Word.net for this.. here scenario like

I am able to get a document from a server by calling their web service,

DataObject Remote_Xml = sr.retrieveDocument(DocumentID);

return Remote_Xml;

The retrieveDocument method will actualy gives me adoc as soap attachment. I should download it in the form of docx and convert it as pdf using aspose.

please help me in this.

Hi

Thanks for your request. In your case, you need just get the document as a stream and then create a Document object from this Stream. The technique will be similar to the one described here:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-load-and-save-a-document-to-database.html

Please let us know if you have any difficulties in implementing this, we will be glad to help you.

Best regards,

Hi Thanks for your advice!

I tried implementing the logic and almsot succeeded in that but when actyually doing the conversion to memory stream from byte array i have land up in the below error:

Document doc_Documentum = new Document(doc_stream);//getting error here

Error : Unknown file format

Here is my code:

Documentum_Srvc.HCDocumentumService sr = new CreateDocument.Documentum_Srvc.HCDocumentumService();

DataObject Remote_Xml = sr.retrieveDocument(DocumentID);

byte[] _ByteArray = ObjectToByteArray(Remote_Xml);

MemoryStream doc_stream = new MemoryStream(_ByteArray);

Document doc_Documentum = new Document(doc_stream);

Here The Scenario like, I am getting the Response object "Remote Xml" in the form of DataObject , so i wrote a function(ObjectToByteArray) to convert it in to byte array. from byte array i am trying to load in to memory stream and from memroy stream i am converting it as document object. this point of time i am hitting this error. please help me.

If you ahve any other way to suggest then, that also would be helpful.

Thanks a lot,

Nikhil Nair

I Drilled down to the issue and found that the format is coming as "msw12" which is equalent to "docx" format. int his situation how can i move forward like saving this in to a doc object.

pls advice.

Hi

Thanks for your request. Could you please save the stream to file and attach this file here for testing? I will check it and provide you more information.

Best regards,

How to save stream object toa file.

Hi

Thanks for your request. You can use code like this:

public void SaveStreamToFile(string fileFullPath, Stream stream)

{

if (stream.Length == 0) return;

// Create a FileStream object to write a stream to a file

using (FileStream fileStream = System.IO.File.Create(fileFullPath, (int)stream.Length))

{

// Fill the bytes[] array with the stream data

byte[] bytesInStream = new byte[stream.Length];

stream.Read(bytesInStream, 0, (int)bytesInStream.Length);

// Use FileStream object to write to the specified file

fileStream.Write(bytesInStream, 0, bytesInStream.Length);

}

}

Best regards,

Hi,

Please find teh attached file, i have saved as stream object. When I am trying to convert this as dcoument I am getting this error.

Pls find teh file attached, while converting this in to document i am getting the error like (Unknown file format). Pls advice accordingly.

Hi

Thank you for additional information. The file you have attached is not a Word document, that is why you get an exception when try to create a document from it.

I think you should check your code where you extract stream, most likely the problem is there.

Best regards,

I saved the stream in to a txt file and attached previously.

stream = new MemoryStream(); // read xml in memory

writer = new StreamWriter(stream, Encoding.Unicode);

Documentum_Srvc.HCDocumentumService sr = new CreateDocument.Documentum_Srvc.HCDocumentumService();

DataObject Remote_Xml = sr.retrieveDocument(DocumentID);

byte[] _ByteArray = ObjectToByteArray(Remote_Xml);

if (_ByteArray != null)

{

MemoryStream doc_stream = new MemoryStream(_ByteArray);

SaveStreamToFile(@"C:\Documents and Settings\898588\Desktop\aspose-docs\New Folder\New Folder\\mystream.txt", doc_stream);

doc_stream.Position = 0;

yesdoc = new Document(doc_stream);

yesdoc.Save(@"C:\Documents and Settings\898588\Desktop\aspose-docs\New Folder\New Folder\\Documentum.docx");

}

return yesdoc;

this is the code, i am trying.. I am trying to see how i can change the format of the file with in stream itself, so that i can change the extension to .docx and aspose dll can make use of that. any idea?

Hi Nair,

Yes, I checked the attached file. And as I mention it is not a Word document. To create the Document object from stream your stream should contain a Word document. Since your stream does not contain a Word document, Aspose.Words throws an exception when you attempt to create a Document object from your stream.

Best regards,

Hi,

Is there any suggestion for converting an aspose document object to DataPackage?

while I am converting the Word Dcoument to Datapackage i am getting below error:

Error 6 Argument '1': cannot convert from 'Aspose.Words.Document' to 'CreateDocument.Documentum_Srvc.DataPackage'

Any suggestions is welcome.

Hi Nair,

Thanks for your inquiry. DataPackage seems to be your own custom class, so I cannot know how to work with it. But definitely, you cannot simply cast Aspose.Words.Document object to DataPackage.

Best regards,