hi, sorry for my english but i don't speak good english.
in this web service i send 2 data stream(xml and xsl file) and i would like to return a xslt trasform-file byte array (now i return string because i'm in testing)
when the transResult file is been created, it's source is all NULL char.
why? where i'm wrong? -
public string getData(byte[] xmlData, byte[] xslData)
-
{
-
-
string workDir = "D:\\provaWebService\\";
-
-
-
int xmlFileSize = xmlData.Length;
-
int xslFileSize = xslData.Length;
-
-
-
Stream xmlStreamData = new MemoryStream(xmlData);
-
Stream xslStreamData = new MemoryStream(xslData);
-
Stream output = new MemoryStream();
-
-
XPathDocument XPathDoc = new XPathDocument(xmlStreamData);
-
XslCompiledTransform xslTrans = new XslCompiledTransform();
-
-
XmlReader reader = XmlReader.Create(xslStreamData);
-
-
xslTrans.Load(reader);
-
-
-
output.Position = 0;
-
XmlTextWriter writer = new XmlTextWriter(output,Encoding.UTF8);
-
writer.Formatting = Formatting.Indented;
-
-
xslTrans.Transform(XPathDoc.CreateNavigator(), null, writer);
-
-
-
FileStream outFile = new FileStream(workDir + "result.html", FileMode.Create);
-
byte[] byteArray = new byte[output.Length];
-
int numBytesToRead = (int)output.Length;
-
int n = output.Read(byteArray, 0, numBytesToRead);
-
-
outFile.Write(byteArray, 0, byteArray.Length);
-
outFile.Close();
-
Thanks,
P.
1 1640
it's source is all NULL char
his source is all NULL char
:-)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: radnoraj |
last post by:
Hi,
I am sucessfull in redirecting console output to a file. but in this
case nothing is displayed on the console, cout output is written to
file without display.
how do write the output to console as well as to file, my code is as
below,
=======================================================================
#include <iostream.h>
#include<ostream>
#include<sstream>
|
by: ben beroukhim |
last post by:
I have huge number of legacy code which use standard files functions.
I would like to pass a memory pointer rather than a FILE pointer.
I am trying to use FILEs in the code to refer to memory buffers.
Basically, I want to be able to use all the standard read and write
functions, but I want them to refer to memory locations, rather than
disk
files.
I do not want to touch the legacy code. Does any one know of a library
|
by: Ireney Berezniak |
last post by:
Hi, I am trying to send an UTF-8 XML string to remote resource via
HttpWebRequest using POST method, which means that I need to get the
request stream and write my XML string to it. No problems here.
The problem that I'm running into is that the "+" sign that one of the
XML elements contains is lost somehow in the transaction. I verified
that the "+" is actually in the XML string prior to getting bytes, and
writing to stream:
...
|
by: Buddy Home |
last post by:
Hello,
I'm trying to upload a file programatically and occasionally I get the
following error message.
Unable to write data to the transport connection: An established connection
was aborted by the software in your host machine.
Stack Trace
at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
|
by: Buddy Home |
last post by:
Hello,
I'm trying to upload a file programatically and occasionally I get the
following error message.
Unable to write data to the transport connection: An established connection
was aborted by the software in your host machine.
Stack Trace
at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
| |
by: Dinsdale |
last post by:
I must be totally missing something.
I am trying to use DirectX to play an AVI file that is stored as a
Manifest Resource. Apperently the Video class only takes a string path
as a parameter, so I wanted to write the avi to a file from the
manifest. I thought I would just be able to read it in as a Stream and
then write it out to a FileStream but this does not seem to be the
case.
To complicate things, I just found out about the...
|
by: Bill Cunningham |
last post by:
I don't think I can do this without some help or hints. Here is the code
I have.
#include <stdio.h>
#include <stdlib.h>
double input(double input) {
int count=0,div=0;
double mean=0,linput=0;
FILE *fpr, *fpw;
|
by: =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?= |
last post by:
I'm sorry, but I've read your code a couple of times and just don't see where
the Form1 is initialized. Form1 also sounds like a class name, and this
would be how you could do some form operations in vb6, but not in .Net. This
would explain why the messagebox works, as it is not instantiated, but called
statically as you did in your code.
I think you need this where your MsgBox is called:
dim ui as New Form1()
ui.txt_rec.Text =...
|
by: AAaron123 |
last post by:
trying to understand the below shown code.
After this is run the browser opens a file-save dialog box for saving the
file.
I wonder how it knows I want the file saved?
But more important, the dialog box has as the default file name the name of
this ashx file.
I'd like to make that name more meaningfull but don't know how it gets set.
I'm looking for a Response.Write but don't find one. Maybe that why the
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |