Solved

Convert Byte array to XML

Posted on 2004-08-09
2
1,124 Views
Last Modified: 2010-05-18
Hi,

I have created a PDF document using a third party component and I can get the results as a Byte Array. I now need to add this to a xml document to be returned from a webservice. How do I go about this? I have looked at serialization but can't get my head around it!

Is my best method to save the PDF to a file and then read it into the XML of is there another method?

Either way, how is it done?

Thanks,

Smert
0
Comment
Question by:smert
2 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 11754703
well if you have it in a byte array ...

just to get Document ...

public function GetDocument(byval name as string) as byte ()
      return InternalGetDocument(name)
end function

that can be used as a webmethod to return the document without issue ...

If you would rather read it as if it were a stream you can use ...

Dim ms as MempryStream = new MemoryStream(InternalGetDocument(name))

then you can access it with a streamreader etc ...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.net PaintEventArgs Handling. 10 33
System32Int Error 8 55
Close word object 13 38
Visual Studio - "Windows Form Designer generated code" 2 39
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
A short film showing how OnPage and Connectwise integration works.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now