473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cannot Create a DataSet from Signed XML Document

I have XML Documents that I am digitally signing, and need to be able to load
these documents into DataSet objects. However, after checking the signature
and using the DataSet.ReadXML method, I am getting an exception "The root
element is missing".

I have struggled over the last 24 hours trying to figure out ways of
correcting this, however I am stuck. I would appreciate any help that the
community can provide me on this.

Thanks,
Nov 16 '05 #1
11 2169
Brian,

Can you post an example of the signed document?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
I have XML Documents that I am digitally signing, and need to be able to
load
these documents into DataSet objects. However, after checking the
signature
and using the DataSet.ReadXML method, I am getting an exception "The root
element is missing".

I have struggled over the last 24 hours trying to figure out ways of
correcting this, however I am stuck. I would appreciate any help that the
community can provide me on this.

Thanks,

Nov 16 '05 #2
Here is an example of the file. The file is used to create 3 datatables in
the DataSet, I used the signature information in the first node position and
the last node. This example shows the signature in the first position using
the XmlDocument.DocumentElement.PrependChild() method.

Thanks

<?xml version="1.0" encoding="utf-8"?>
<FWT>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>hxyhMOAfdFJYOsDlADHTah0Gmmg=</DigestValue>
</Reference>
</SignedInfo>

<SignatureValue>rakRKha0vAX8cIsFwhJUsgzOB1NMNW6v iG/EsTUivy4Rt3Cg2k1LDTkmJv+bXhgWBoPBtdMxg9ZSXah0P1qw5 K/1npSWPmJ9uWGEQuWwZT5KqJNfq1iy7QKfUiKGTn1q+0Mc2WXPo 18v6Fnuqqh7+btrpfnvbTaKJ0mQHAw9H+0=</SignatureValue>
<KeyInfo>
<KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
<RSAKeyValue>

<Modulus>01k61JX5bc/jCLnnEHtzw3o08hs6+KjE58md8wkRrBgTTEU3gtmD1Q8SxPxpJ iSwGNRCWTAghxSrK7AFYOCGZTblstnHerqs0Z/LTVNW2JaVkI34kvquqWdd6JJ+GNYWWuKuTiTjyEpLSikjXXFTW kLJqDU/w1Lq6MN6g+z6lx8=</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
</Signature>
<FWT_CONFIG>
<keyName>#PEREXEMPAMT</keyName>
<keyValue>3100</keyValue>
</FWT_CONFIG>
<FWT_FORMULA>
<Step>1</Step>
<Token>MUL</Token>
<Arg1>@TAXWAGES</Arg1>
<Arg2>@PAYPERIODS</Arg2>
<Arg3>ANNUALWAGE</Arg3>
<Arg4 />
<Arg5 />
<Arg6 />
<Arg7 />
<Arg8 />
<DefValue>0</DefValue>
<Comment />
</FWT_FORMULA>
<FWT_TAXTABLES>
<filingStatus>1</filingStatus>
<taxTableId>3</taxTableId>
<baseWage>9700</baseWage>
<upperWage>30800</upperWage>
<taxAmt>705</taxAmt>
<taxRate>0.15</taxRate>
</FWT_TAXTABLES>
<FWT_TAXTABLES>
<filingStatus>1</filingStatus>
<taxTableId>4</taxTableId>
<baseWage>30800</baseWage>
<upperWage>68500</upperWage>
<taxAmt>3870</taxAmt>
<taxRate>0.25</taxRate>
</FWT_TAXTABLES>
</FWT>
"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

Can you post an example of the signed document?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
I have XML Documents that I am digitally signing, and need to be able to
load
these documents into DataSet objects. However, after checking the
signature
and using the DataSet.ReadXML method, I am getting an exception "The root
element is missing".

I have struggled over the last 24 hours trying to figure out ways of
correcting this, however I am stuck. I would appreciate any help that the
community can provide me on this.

Thanks,


Nov 16 '05 #3
Brian,

I saved that XML document to a file, and then loaded it into a DataSet
without any problems. Are you sure this is the right file, and how are you
loading it into the DataSet?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
Here is an example of the file. The file is used to create 3 datatables in
the DataSet, I used the signature information in the first node position
and
the last node. This example shows the signature in the first position
using
the XmlDocument.DocumentElement.PrependChild() method.

Thanks

<?xml version="1.0" encoding="utf-8"?>
<FWT>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>hxyhMOAfdFJYOsDlADHTah0Gmmg=</DigestValue>
</Reference>
</SignedInfo>

<SignatureValue>rakRKha0vAX8cIsFwhJUsgzOB1NMNW6v iG/EsTUivy4Rt3Cg2k1LDTkmJv+bXhgWBoPBtdMxg9ZSXah0P1qw5 K/1npSWPmJ9uWGEQuWwZT5KqJNfq1iy7QKfUiKGTn1q+0Mc2WXPo 18v6Fnuqqh7+btrpfnvbTaKJ0mQHAw9H+0=</SignatureValue>
<KeyInfo>
<KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
<RSAKeyValue>

<Modulus>01k61JX5bc/jCLnnEHtzw3o08hs6+KjE58md8wkRrBgTTEU3gtmD1Q8SxPxpJ iSwGNRCWTAghxSrK7AFYOCGZTblstnHerqs0Z/LTVNW2JaVkI34kvquqWdd6JJ+GNYWWuKuTiTjyEpLSikjXXFTW kLJqDU/w1Lq6MN6g+z6lx8=</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
</Signature>
<FWT_CONFIG>
<keyName>#PEREXEMPAMT</keyName>
<keyValue>3100</keyValue>
</FWT_CONFIG>
<FWT_FORMULA>
<Step>1</Step>
<Token>MUL</Token>
<Arg1>@TAXWAGES</Arg1>
<Arg2>@PAYPERIODS</Arg2>
<Arg3>ANNUALWAGE</Arg3>
<Arg4 />
<Arg5 />
<Arg6 />
<Arg7 />
<Arg8 />
<DefValue>0</DefValue>
<Comment />
</FWT_FORMULA>
<FWT_TAXTABLES>
<filingStatus>1</filingStatus>
<taxTableId>3</taxTableId>
<baseWage>9700</baseWage>
<upperWage>30800</upperWage>
<taxAmt>705</taxAmt>
<taxRate>0.15</taxRate>
</FWT_TAXTABLES>
<FWT_TAXTABLES>
<filingStatus>1</filingStatus>
<taxTableId>4</taxTableId>
<baseWage>30800</baseWage>
<upperWage>68500</upperWage>
<taxAmt>3870</taxAmt>
<taxRate>0.25</taxRate>
</FWT_TAXTABLES>
</FWT>
"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

Can you post an example of the signed document?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
>I have XML Documents that I am digitally signing, and need to be able to
>load
> these documents into DataSet objects. However, after checking the
> signature
> and using the DataSet.ReadXML method, I am getting an exception "The
> root
> element is missing".
>
> I have struggled over the last 24 hours trying to figure out ways of
> correcting this, however I am stuck. I would appreciate any help that
> the
> community can provide me on this.
>
> Thanks,


Nov 16 '05 #4
Thanks for the quick reply. I am passing it in as a StreamReader, as I am
using the same StreamReader to pull out the signature and verify it. Below is
the code that i am using.

sr is the StreamReader that contains the file
XmlDocument doc = new XmlDocument();

doc.Load(sr);
SignedXml verifier = new SignedXml(doc);
verifier.LoadXml(doc.GetElementsByTagName("Signatu re")[0] as XmlElement);

if (verifier.CheckSignature())
{

this.GetConfigFileToScreen(sr);
}
public void GetConfigFileToScreen ( StreamReader sr )
{
DataSet ds1 = new DataSet();
ds1.ReadXml(sr); // This is the error line.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

I saved that XML document to a file, and then loaded it into a DataSet
without any problems. Are you sure this is the right file, and how are you
loading it into the DataSet?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
Here is an example of the file. The file is used to create 3 datatables in
the DataSet, I used the signature information in the first node position
and
the last node. This example shows the signature in the first position
using
the XmlDocument.DocumentElement.PrependChild() method.

Thanks

<?xml version="1.0" encoding="utf-8"?>
<FWT>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>hxyhMOAfdFJYOsDlADHTah0Gmmg=</DigestValue>
</Reference>
</SignedInfo>

<SignatureValue>rakRKha0vAX8cIsFwhJUsgzOB1NMNW6v iG/EsTUivy4Rt3Cg2k1LDTkmJv+bXhgWBoPBtdMxg9ZSXah0P1qw5 K/1npSWPmJ9uWGEQuWwZT5KqJNfq1iy7QKfUiKGTn1q+0Mc2WXPo 18v6Fnuqqh7+btrpfnvbTaKJ0mQHAw9H+0=</SignatureValue>
<KeyInfo>
<KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
<RSAKeyValue>

<Modulus>01k61JX5bc/jCLnnEHtzw3o08hs6+KjE58md8wkRrBgTTEU3gtmD1Q8SxPxpJ iSwGNRCWTAghxSrK7AFYOCGZTblstnHerqs0Z/LTVNW2JaVkI34kvquqWdd6JJ+GNYWWuKuTiTjyEpLSikjXXFTW kLJqDU/w1Lq6MN6g+z6lx8=</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
</Signature>
<FWT_CONFIG>
<keyName>#PEREXEMPAMT</keyName>
<keyValue>3100</keyValue>
</FWT_CONFIG>
<FWT_FORMULA>
<Step>1</Step>
<Token>MUL</Token>
<Arg1>@TAXWAGES</Arg1>
<Arg2>@PAYPERIODS</Arg2>
<Arg3>ANNUALWAGE</Arg3>
<Arg4 />
<Arg5 />
<Arg6 />
<Arg7 />
<Arg8 />
<DefValue>0</DefValue>
<Comment />
</FWT_FORMULA>
<FWT_TAXTABLES>
<filingStatus>1</filingStatus>
<taxTableId>3</taxTableId>
<baseWage>9700</baseWage>
<upperWage>30800</upperWage>
<taxAmt>705</taxAmt>
<taxRate>0.15</taxRate>
</FWT_TAXTABLES>
<FWT_TAXTABLES>
<filingStatus>1</filingStatus>
<taxTableId>4</taxTableId>
<baseWage>30800</baseWage>
<upperWage>68500</upperWage>
<taxAmt>3870</taxAmt>
<taxRate>0.25</taxRate>
</FWT_TAXTABLES>
</FWT>
"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

Can you post an example of the signed document?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
>I have XML Documents that I am digitally signing, and need to be able to
>load
> these documents into DataSet objects. However, after checking the
> signature
> and using the DataSet.ReadXML method, I am getting an exception "The
> root
> element is missing".
>
> I have struggled over the last 24 hours trying to figure out ways of
> correcting this, however I am stuck. I would appreciate any help that
> the
> community can provide me on this.
>
> Thanks,


Nov 16 '05 #5
Brian,

You are reading from the stream, but you are not resetting the position,
it would seem. You basically want to do this before you read the data set:

// Set the position to the beginning.
sr.BaseStream.Position = 0;

// Discard buffered data.
sr.DiscardBufferedData();

// Read normally.

That should work.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
Thanks for the quick reply. I am passing it in as a StreamReader, as I am
using the same StreamReader to pull out the signature and verify it. Below
is
the code that i am using.

sr is the StreamReader that contains the file
XmlDocument doc = new XmlDocument();

doc.Load(sr);
SignedXml verifier = new SignedXml(doc);
verifier.LoadXml(doc.GetElementsByTagName("Signatu re")[0] as XmlElement);

if (verifier.CheckSignature())
{

this.GetConfigFileToScreen(sr);
}
public void GetConfigFileToScreen ( StreamReader sr )
{
DataSet ds1 = new DataSet();
ds1.ReadXml(sr); // This is the error line.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

I saved that XML document to a file, and then loaded it into a
DataSet
without any problems. Are you sure this is the right file, and how are
you
loading it into the DataSet?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
> Here is an example of the file. The file is used to create 3 datatables
> in
> the DataSet, I used the signature information in the first node
> position
> and
> the last node. This example shows the signature in the first position
> using
> the XmlDocument.DocumentElement.PrependChild() method.
>
> Thanks
>
> <?xml version="1.0" encoding="utf-8"?>
> <FWT>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod
> Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
> <SignatureMethod
> Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
> <Reference URI="">
> <Transforms>
> <Transform
> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
> />
> <DigestValue>hxyhMOAfdFJYOsDlADHTah0Gmmg=</DigestValue>
> </Reference>
> </SignedInfo>
>
> <SignatureValue>rakRKha0vAX8cIsFwhJUsgzOB1NMNW6v iG/EsTUivy4Rt3Cg2k1LDTkmJv+bXhgWBoPBtdMxg9ZSXah0P1qw5 K/1npSWPmJ9uWGEQuWwZT5KqJNfq1iy7QKfUiKGTn1q+0Mc2WXPo 18v6Fnuqqh7+btrpfnvbTaKJ0mQHAw9H+0=</SignatureValue>
> <KeyInfo>
> <KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
> <RSAKeyValue>
>
> <Modulus>01k61JX5bc/jCLnnEHtzw3o08hs6+KjE58md8wkRrBgTTEU3gtmD1Q8SxPxpJ iSwGNRCWTAghxSrK7AFYOCGZTblstnHerqs0Z/LTVNW2JaVkI34kvquqWdd6JJ+GNYWWuKuTiTjyEpLSikjXXFTW kLJqDU/w1Lq6MN6g+z6lx8=</Modulus>
> <Exponent>AQAB</Exponent>
> </RSAKeyValue>
> </KeyValue>
> </KeyInfo>
> </Signature>
> <FWT_CONFIG>
> <keyName>#PEREXEMPAMT</keyName>
> <keyValue>3100</keyValue>
> </FWT_CONFIG>
> <FWT_FORMULA>
> <Step>1</Step>
> <Token>MUL</Token>
> <Arg1>@TAXWAGES</Arg1>
> <Arg2>@PAYPERIODS</Arg2>
> <Arg3>ANNUALWAGE</Arg3>
> <Arg4 />
> <Arg5 />
> <Arg6 />
> <Arg7 />
> <Arg8 />
> <DefValue>0</DefValue>
> <Comment />
> </FWT_FORMULA>
> <FWT_TAXTABLES>
> <filingStatus>1</filingStatus>
> <taxTableId>3</taxTableId>
> <baseWage>9700</baseWage>
> <upperWage>30800</upperWage>
> <taxAmt>705</taxAmt>
> <taxRate>0.15</taxRate>
> </FWT_TAXTABLES>
> <FWT_TAXTABLES>
> <filingStatus>1</filingStatus>
> <taxTableId>4</taxTableId>
> <baseWage>30800</baseWage>
> <upperWage>68500</upperWage>
> <taxAmt>3870</taxAmt>
> <taxRate>0.25</taxRate>
> </FWT_TAXTABLES>
> </FWT>
>
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>
>> Brian,
>>
>> Can you post an example of the signed document?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in
>> message
>> news:26**********************************@microsof t.com...
>> >I have XML Documents that I am digitally signing, and need to be able
>> >to
>> >load
>> > these documents into DataSet objects. However, after checking the
>> > signature
>> > and using the DataSet.ReadXML method, I am getting an exception "The
>> > root
>> > element is missing".
>> >
>> > I have struggled over the last 24 hours trying to figure out ways of
>> > correcting this, however I am stuck. I would appreciate any help
>> > that
>> > the
>> > community can provide me on this.
>> >
>> > Thanks,
>>
>>
>>


Nov 16 '05 #6
Thanks again, I implemented your solution, however I am still receiving the
same exception. Any ideas? I appreciate your looking into this for me.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

You are reading from the stream, but you are not resetting the position,
it would seem. You basically want to do this before you read the data set:

// Set the position to the beginning.
sr.BaseStream.Position = 0;

// Discard buffered data.
sr.DiscardBufferedData();

// Read normally.

That should work.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
Thanks for the quick reply. I am passing it in as a StreamReader, as I am
using the same StreamReader to pull out the signature and verify it. Below
is
the code that i am using.

sr is the StreamReader that contains the file
XmlDocument doc = new XmlDocument();

doc.Load(sr);
SignedXml verifier = new SignedXml(doc);
verifier.LoadXml(doc.GetElementsByTagName("Signatu re")[0] as XmlElement);

if (verifier.CheckSignature())
{

this.GetConfigFileToScreen(sr);
}
public void GetConfigFileToScreen ( StreamReader sr )
{
DataSet ds1 = new DataSet();
ds1.ReadXml(sr); // This is the error line.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

I saved that XML document to a file, and then loaded it into a
DataSet
without any problems. Are you sure this is the right file, and how are
you
loading it into the DataSet?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
> Here is an example of the file. The file is used to create 3 datatables
> in
> the DataSet, I used the signature information in the first node
> position
> and
> the last node. This example shows the signature in the first position
> using
> the XmlDocument.DocumentElement.PrependChild() method.
>
> Thanks
>
> <?xml version="1.0" encoding="utf-8"?>
> <FWT>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod
> Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
> <SignatureMethod
> Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
> <Reference URI="">
> <Transforms>
> <Transform
> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
> />
> <DigestValue>hxyhMOAfdFJYOsDlADHTah0Gmmg=</DigestValue>
> </Reference>
> </SignedInfo>
>
> <SignatureValue>rakRKha0vAX8cIsFwhJUsgzOB1NMNW6v iG/EsTUivy4Rt3Cg2k1LDTkmJv+bXhgWBoPBtdMxg9ZSXah0P1qw5 K/1npSWPmJ9uWGEQuWwZT5KqJNfq1iy7QKfUiKGTn1q+0Mc2WXPo 18v6Fnuqqh7+btrpfnvbTaKJ0mQHAw9H+0=</SignatureValue>
> <KeyInfo>
> <KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
> <RSAKeyValue>
>
> <Modulus>01k61JX5bc/jCLnnEHtzw3o08hs6+KjE58md8wkRrBgTTEU3gtmD1Q8SxPxpJ iSwGNRCWTAghxSrK7AFYOCGZTblstnHerqs0Z/LTVNW2JaVkI34kvquqWdd6JJ+GNYWWuKuTiTjyEpLSikjXXFTW kLJqDU/w1Lq6MN6g+z6lx8=</Modulus>
> <Exponent>AQAB</Exponent>
> </RSAKeyValue>
> </KeyValue>
> </KeyInfo>
> </Signature>
> <FWT_CONFIG>
> <keyName>#PEREXEMPAMT</keyName>
> <keyValue>3100</keyValue>
> </FWT_CONFIG>
> <FWT_FORMULA>
> <Step>1</Step>
> <Token>MUL</Token>
> <Arg1>@TAXWAGES</Arg1>
> <Arg2>@PAYPERIODS</Arg2>
> <Arg3>ANNUALWAGE</Arg3>
> <Arg4 />
> <Arg5 />
> <Arg6 />
> <Arg7 />
> <Arg8 />
> <DefValue>0</DefValue>
> <Comment />
> </FWT_FORMULA>
> <FWT_TAXTABLES>
> <filingStatus>1</filingStatus>
> <taxTableId>3</taxTableId>
> <baseWage>9700</baseWage>
> <upperWage>30800</upperWage>
> <taxAmt>705</taxAmt>
> <taxRate>0.15</taxRate>
> </FWT_TAXTABLES>
> <FWT_TAXTABLES>
> <filingStatus>1</filingStatus>
> <taxTableId>4</taxTableId>
> <baseWage>30800</baseWage>
> <upperWage>68500</upperWage>
> <taxAmt>3870</taxAmt>
> <taxRate>0.25</taxRate>
> </FWT_TAXTABLES>
> </FWT>
>
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>
>> Brian,
>>
>> Can you post an example of the signed document?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in
>> message
>> news:26**********************************@microsof t.com...
>> >I have XML Documents that I am digitally signing, and need to be able
>> >to
>> >load
>> > these documents into DataSet objects. However, after checking the
>> > signature
>> > and using the DataSet.ReadXML method, I am getting an exception "The
>> > root
>> > element is missing".
>> >
>> > I have struggled over the last 24 hours trying to figure out ways of
>> > correcting this, however I am stuck. I would appreciate any help
>> > that
>> > the
>> > community can provide me on this.
>> >
>> > Thanks,
>>
>>
>>


Nov 16 '05 #7
Brian,

It's not an issue with the data set, but the position of the stream.
I'd focus there. If you save the XML to a file and load it into the data
set, it will work fine.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
Thanks again, I implemented your solution, however I am still receiving
the
same exception. Any ideas? I appreciate your looking into this for me.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

You are reading from the stream, but you are not resetting the
position,
it would seem. You basically want to do this before you read the data
set:

// Set the position to the beginning.
sr.BaseStream.Position = 0;

// Discard buffered data.
sr.DiscardBufferedData();

// Read normally.

That should work.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
> Thanks for the quick reply. I am passing it in as a StreamReader, as I
> am
> using the same StreamReader to pull out the signature and verify it.
> Below
> is
> the code that i am using.
>
> sr is the StreamReader that contains the file
>
>
> XmlDocument doc = new XmlDocument();
>
> doc.Load(sr);
> SignedXml verifier = new SignedXml(doc);
> verifier.LoadXml(doc.GetElementsByTagName("Signatu re")[0] as
> XmlElement);
>
> if (verifier.CheckSignature())
> {
>
> this.GetConfigFileToScreen(sr);
> }
>
>
> public void GetConfigFileToScreen ( StreamReader sr )
> {
> DataSet ds1 = new DataSet();
> ds1.ReadXml(sr); // This is the error line.
>
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>
>> Brian,
>>
>> I saved that XML document to a file, and then loaded it into a
>> DataSet
>> without any problems. Are you sure this is the right file, and how
>> are
>> you
>> loading it into the DataSet?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in
>> message
>> news:0B**********************************@microsof t.com...
>> > Here is an example of the file. The file is used to create 3
>> > datatables
>> > in
>> > the DataSet, I used the signature information in the first node
>> > position
>> > and
>> > the last node. This example shows the signature in the first
>> > position
>> > using
>> > the XmlDocument.DocumentElement.PrependChild() method.
>> >
>> > Thanks
>> >
>> > <?xml version="1.0" encoding="utf-8"?>
>> > <FWT>
>> > <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
>> > <SignedInfo>
>> > <CanonicalizationMethod
>> > Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
>> > <SignatureMethod
>> > Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
>> > <Reference URI="">
>> > <Transforms>
>> > <Transform
>> > Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
>> > </Transforms>
>> > <DigestMethod
>> > Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
>> > />
>> > <DigestValue>hxyhMOAfdFJYOsDlADHTah0Gmmg=</DigestValue>
>> > </Reference>
>> > </SignedInfo>
>> >
>> > <SignatureValue>rakRKha0vAX8cIsFwhJUsgzOB1NMNW6v iG/EsTUivy4Rt3Cg2k1LDTkmJv+bXhgWBoPBtdMxg9ZSXah0P1qw5 K/1npSWPmJ9uWGEQuWwZT5KqJNfq1iy7QKfUiKGTn1q+0Mc2WXPo 18v6Fnuqqh7+btrpfnvbTaKJ0mQHAw9H+0=</SignatureValue>
>> > <KeyInfo>
>> > <KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
>> > <RSAKeyValue>
>> >
>> > <Modulus>01k61JX5bc/jCLnnEHtzw3o08hs6+KjE58md8wkRrBgTTEU3gtmD1Q8SxPxpJ iSwGNRCWTAghxSrK7AFYOCGZTblstnHerqs0Z/LTVNW2JaVkI34kvquqWdd6JJ+GNYWWuKuTiTjyEpLSikjXXFTW kLJqDU/w1Lq6MN6g+z6lx8=</Modulus>
>> > <Exponent>AQAB</Exponent>
>> > </RSAKeyValue>
>> > </KeyValue>
>> > </KeyInfo>
>> > </Signature>
>> > <FWT_CONFIG>
>> > <keyName>#PEREXEMPAMT</keyName>
>> > <keyValue>3100</keyValue>
>> > </FWT_CONFIG>
>> > <FWT_FORMULA>
>> > <Step>1</Step>
>> > <Token>MUL</Token>
>> > <Arg1>@TAXWAGES</Arg1>
>> > <Arg2>@PAYPERIODS</Arg2>
>> > <Arg3>ANNUALWAGE</Arg3>
>> > <Arg4 />
>> > <Arg5 />
>> > <Arg6 />
>> > <Arg7 />
>> > <Arg8 />
>> > <DefValue>0</DefValue>
>> > <Comment />
>> > </FWT_FORMULA>
>> > <FWT_TAXTABLES>
>> > <filingStatus>1</filingStatus>
>> > <taxTableId>3</taxTableId>
>> > <baseWage>9700</baseWage>
>> > <upperWage>30800</upperWage>
>> > <taxAmt>705</taxAmt>
>> > <taxRate>0.15</taxRate>
>> > </FWT_TAXTABLES>
>> > <FWT_TAXTABLES>
>> > <filingStatus>1</filingStatus>
>> > <taxTableId>4</taxTableId>
>> > <baseWage>30800</baseWage>
>> > <upperWage>68500</upperWage>
>> > <taxAmt>3870</taxAmt>
>> > <taxRate>0.25</taxRate>
>> > </FWT_TAXTABLES>
>> > </FWT>
>> >
>> >
>> > "Nicholas Paldino [.NET/C# MVP]" wrote:
>> >
>> >> Brian,
>> >>
>> >> Can you post an example of the signed document?
>> >>
>> >>
>> >> --
>> >> - Nicholas Paldino [.NET/C# MVP]
>> >> - mv*@spam.guard.caspershouse.com
>> >>
>> >> "Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in
>> >> message
>> >> news:26**********************************@microsof t.com...
>> >> >I have XML Documents that I am digitally signing, and need to be
>> >> >able
>> >> >to
>> >> >load
>> >> > these documents into DataSet objects. However, after checking the
>> >> > signature
>> >> > and using the DataSet.ReadXML method, I am getting an exception
>> >> > "The
>> >> > root
>> >> > element is missing".
>> >> >
>> >> > I have struggled over the last 24 hours trying to figure out ways
>> >> > of
>> >> > correcting this, however I am stuck. I would appreciate any help
>> >> > that
>> >> > the
>> >> > community can provide me on this.
>> >> >
>> >> > Thanks,
>> >>
>> >>
>> >>
>>
>>
>>


Nov 16 '05 #8
Thanks for the pointer... I had to reset the position before I build the
doc.LoadXML and then before I loaded the dataset... I really appreciate your
help... thanks.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

It's not an issue with the data set, but the position of the stream.
I'd focus there. If you save the XML to a file and load it into the data
set, it will work fine.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
Thanks again, I implemented your solution, however I am still receiving
the
same exception. Any ideas? I appreciate your looking into this for me.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

You are reading from the stream, but you are not resetting the
position,
it would seem. You basically want to do this before you read the data
set:

// Set the position to the beginning.
sr.BaseStream.Position = 0;

// Discard buffered data.
sr.DiscardBufferedData();

// Read normally.

That should work.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
> Thanks for the quick reply. I am passing it in as a StreamReader, as I
> am
> using the same StreamReader to pull out the signature and verify it.
> Below
> is
> the code that i am using.
>
> sr is the StreamReader that contains the file
>
>
> XmlDocument doc = new XmlDocument();
>
> doc.Load(sr);
> SignedXml verifier = new SignedXml(doc);
> verifier.LoadXml(doc.GetElementsByTagName("Signatu re")[0] as
> XmlElement);
>
> if (verifier.CheckSignature())
> {
>
> this.GetConfigFileToScreen(sr);
> }
>
>
> public void GetConfigFileToScreen ( StreamReader sr )
> {
> DataSet ds1 = new DataSet();
> ds1.ReadXml(sr); // This is the error line.
>
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>
>> Brian,
>>
>> I saved that XML document to a file, and then loaded it into a
>> DataSet
>> without any problems. Are you sure this is the right file, and how
>> are
>> you
>> loading it into the DataSet?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in
>> message
>> news:0B**********************************@microsof t.com...
>> > Here is an example of the file. The file is used to create 3
>> > datatables
>> > in
>> > the DataSet, I used the signature information in the first node
>> > position
>> > and
>> > the last node. This example shows the signature in the first
>> > position
>> > using
>> > the XmlDocument.DocumentElement.PrependChild() method.
>> >
>> > Thanks
>> >
>> > <?xml version="1.0" encoding="utf-8"?>
>> > <FWT>
>> > <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
>> > <SignedInfo>
>> > <CanonicalizationMethod
>> > Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
>> > <SignatureMethod
>> > Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
>> > <Reference URI="">
>> > <Transforms>
>> > <Transform
>> > Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
>> > </Transforms>
>> > <DigestMethod
>> > Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
>> > />
>> > <DigestValue>hxyhMOAfdFJYOsDlADHTah0Gmmg=</DigestValue>
>> > </Reference>
>> > </SignedInfo>
>> >
>> > <SignatureValue>rakRKha0vAX8cIsFwhJUsgzOB1NMNW6v iG/EsTUivy4Rt3Cg2k1LDTkmJv+bXhgWBoPBtdMxg9ZSXah0P1qw5 K/1npSWPmJ9uWGEQuWwZT5KqJNfq1iy7QKfUiKGTn1q+0Mc2WXPo 18v6Fnuqqh7+btrpfnvbTaKJ0mQHAw9H+0=</SignatureValue>
>> > <KeyInfo>
>> > <KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
>> > <RSAKeyValue>
>> >
>> > <Modulus>01k61JX5bc/jCLnnEHtzw3o08hs6+KjE58md8wkRrBgTTEU3gtmD1Q8SxPxpJ iSwGNRCWTAghxSrK7AFYOCGZTblstnHerqs0Z/LTVNW2JaVkI34kvquqWdd6JJ+GNYWWuKuTiTjyEpLSikjXXFTW kLJqDU/w1Lq6MN6g+z6lx8=</Modulus>
>> > <Exponent>AQAB</Exponent>
>> > </RSAKeyValue>
>> > </KeyValue>
>> > </KeyInfo>
>> > </Signature>
>> > <FWT_CONFIG>
>> > <keyName>#PEREXEMPAMT</keyName>
>> > <keyValue>3100</keyValue>
>> > </FWT_CONFIG>
>> > <FWT_FORMULA>
>> > <Step>1</Step>
>> > <Token>MUL</Token>
>> > <Arg1>@TAXWAGES</Arg1>
>> > <Arg2>@PAYPERIODS</Arg2>
>> > <Arg3>ANNUALWAGE</Arg3>
>> > <Arg4 />
>> > <Arg5 />
>> > <Arg6 />
>> > <Arg7 />
>> > <Arg8 />
>> > <DefValue>0</DefValue>
>> > <Comment />
>> > </FWT_FORMULA>
>> > <FWT_TAXTABLES>
>> > <filingStatus>1</filingStatus>
>> > <taxTableId>3</taxTableId>
>> > <baseWage>9700</baseWage>
>> > <upperWage>30800</upperWage>
>> > <taxAmt>705</taxAmt>
>> > <taxRate>0.15</taxRate>
>> > </FWT_TAXTABLES>
>> > <FWT_TAXTABLES>
>> > <filingStatus>1</filingStatus>
>> > <taxTableId>4</taxTableId>
>> > <baseWage>30800</baseWage>
>> > <upperWage>68500</upperWage>
>> > <taxAmt>3870</taxAmt>
>> > <taxRate>0.25</taxRate>
>> > </FWT_TAXTABLES>
>> > </FWT>
>> >
>> >
>> > "Nicholas Paldino [.NET/C# MVP]" wrote:
>> >
>> >> Brian,
>> >>
>> >> Can you post an example of the signed document?
>> >>
>> >>
>> >> --
>> >> - Nicholas Paldino [.NET/C# MVP]
>> >> - mv*@spam.guard.caspershouse.com
>> >>
>> >> "Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in
>> >> message
>> >> news:26**********************************@microsof t.com...
>> >> >I have XML Documents that I am digitally signing, and need to be
>> >> >able
>> >> >to
>> >> >load
>> >> > these documents into DataSet objects. However, after checking the
>> >> > signature
>> >> > and using the DataSet.ReadXML method, I am getting an exception
>> >> > "The
>> >> > root
>> >> > element is missing".
>> >> >
>> >> > I have struggled over the last 24 hours trying to figure out ways
>> >> > of
>> >> > correcting this, however I am stuck. I would appreciate any help
>> >> > that
>> >> > the
>> >> > community can provide me on this.
>> >> >
>> >> > Thanks,
>> >>
>> >>
>> >>
>>
>>
>>


Nov 16 '05 #9
jji
Hi, Brian

I think you might change the contents in the Xml file by using "doc" , when
you call SignedXml constructor in the following context.

SignedXml verifier = new SignedXml(doc);

jason
"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
Thanks for the quick reply. I am passing it in as a StreamReader, as I am
using the same StreamReader to pull out the signature and verify it. Below is the code that i am using.

sr is the StreamReader that contains the file
XmlDocument doc = new XmlDocument();

doc.Load(sr);
SignedXml verifier = new SignedXml(doc);
verifier.LoadXml(doc.GetElementsByTagName("Signatu re")[0] as XmlElement);

if (verifier.CheckSignature())
{

this.GetConfigFileToScreen(sr);
}
public void GetConfigFileToScreen ( StreamReader sr )
{
DataSet ds1 = new DataSet();
ds1.ReadXml(sr); // This is the error line.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

I saved that XML document to a file, and then loaded it into a DataSet without any problems. Are you sure this is the right file, and how are you loading it into the DataSet?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message news:0B**********************************@microsof t.com...
Here is an example of the file. The file is used to create 3 datatables in the DataSet, I used the signature information in the first node position and
the last node. This example shows the signature in the first position
using
the XmlDocument.DocumentElement.PrependChild() method.

Thanks

<?xml version="1.0" encoding="utf-8"?>
<FWT>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> <DigestValue>hxyhMOAfdFJYOsDlADHTah0Gmmg=</DigestValue>
</Reference>
</SignedInfo>

<SignatureValue>rakRKha0vAX8cIsFwhJUsgzOB1NMNW6v iG/EsTUivy4Rt3Cg2k1LDTkmJv+b
XhgWBoPBtdMxg9ZSXah0P1qw5K/1npSWPmJ9uWGEQuWwZT5KqJNfq1iy7QKfUiKGTn1q+0Mc2WXP
o18v6Fnuqqh7+btrpfnvbTaKJ0mQHAw9H+0=</SignatureValue> <KeyInfo>
<KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
<RSAKeyValue>

<Modulus>01k61JX5bc/jCLnnEHtzw3o08hs6+KjE58md8wkRrBgTTEU3gtmD1Q8SxPxpJ iSwGNR
CWTAghxSrK7AFYOCGZTblstnHerqs0Z/LTVNW2JaVkI34kvquqWdd6JJ+GNYWWuKuTiTjyEpLSik
jXXFTWkLJqDU/w1Lq6MN6g+z6lx8=</Modulus> <Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
</Signature>
<FWT_CONFIG>
<keyName>#PEREXEMPAMT</keyName>
<keyValue>3100</keyValue>
</FWT_CONFIG>
<FWT_FORMULA>
<Step>1</Step>
<Token>MUL</Token>
<Arg1>@TAXWAGES</Arg1>
<Arg2>@PAYPERIODS</Arg2>
<Arg3>ANNUALWAGE</Arg3>
<Arg4 />
<Arg5 />
<Arg6 />
<Arg7 />
<Arg8 />
<DefValue>0</DefValue>
<Comment />
</FWT_FORMULA>
<FWT_TAXTABLES>
<filingStatus>1</filingStatus>
<taxTableId>3</taxTableId>
<baseWage>9700</baseWage>
<upperWage>30800</upperWage>
<taxAmt>705</taxAmt>
<taxRate>0.15</taxRate>
</FWT_TAXTABLES>
<FWT_TAXTABLES>
<filingStatus>1</filingStatus>
<taxTableId>4</taxTableId>
<baseWage>30800</baseWage>
<upperWage>68500</upperWage>
<taxAmt>3870</taxAmt>
<taxRate>0.25</taxRate>
</FWT_TAXTABLES>
</FWT>
"Nicholas Paldino [.NET/C# MVP]" wrote:

> Brian,
>
> Can you post an example of the signed document?
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard.caspershouse.com
>
> "Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message> news:26**********************************@microsof t.com...
> >I have XML Documents that I am digitally signing, and need to be able to> >load
> > these documents into DataSet objects. However, after checking the
> > signature
> > and using the DataSet.ReadXML method, I am getting an exception "The> > root
> > element is missing".
> >
> > I have struggled over the last 24 hours trying to figure out ways of> > correcting this, however I am stuck. I would appreciate any help that> > the
> > community can provide me on this.
> >
> > Thanks,
>
>
>


Nov 16 '05 #10
Jason, I found that I had to reset the stream reader to position 0 in a
couple of places, as it was being passed from a caller to the displayed
method to one other method. So by the time that it got to the doc.LoadXml(sr)
statement the stream was at the end. I think when the stream is passed in to
the method the stream reader is advanced forward to the last position.
Because further testing showed that each time that I sent the stream reader
in as a parameter to a method the streamreader position would be EOF.

"jji" wrote:
Hi, Brian

I think you might change the contents in the Xml file by using "doc" , when
you call SignedXml constructor in the following context.

SignedXml verifier = new SignedXml(doc);

jason
"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
Thanks for the quick reply. I am passing it in as a StreamReader, as I am
using the same StreamReader to pull out the signature and verify it. Below

is
the code that i am using.

sr is the StreamReader that contains the file
XmlDocument doc = new XmlDocument();

doc.Load(sr);
SignedXml verifier = new SignedXml(doc);
verifier.LoadXml(doc.GetElementsByTagName("Signatu re")[0] as XmlElement);

if (verifier.CheckSignature())
{

this.GetConfigFileToScreen(sr);
}
public void GetConfigFileToScreen ( StreamReader sr )
{
DataSet ds1 = new DataSet();
ds1.ReadXml(sr); // This is the error line.
"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

I saved that XML document to a file, and then loaded it into a DataSet without any problems. Are you sure this is the right file, and how are you loading it into the DataSet?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message news:0B**********************************@microsof t.com...
> Here is an example of the file. The file is used to create 3 datatables in > the DataSet, I used the signature information in the first node position > and
> the last node. This example shows the signature in the first position
> using
> the XmlDocument.DocumentElement.PrependChild() method.
>
> Thanks
>
> <?xml version="1.0" encoding="utf-8"?>
> <FWT>
> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfo>
> <CanonicalizationMethod
> Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
> <SignatureMethod
> Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
> <Reference URI="">
> <Transforms>
> <Transform
> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
> </Transforms>
> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> > <DigestValue>hxyhMOAfdFJYOsDlADHTah0Gmmg=</DigestValue>
> </Reference>
> </SignedInfo>
>
> <SignatureValue>rakRKha0vAX8cIsFwhJUsgzOB1NMNW6v iG/EsTUivy4Rt3Cg2k1LDTkmJv+b
XhgWBoPBtdMxg9ZSXah0P1qw5K/1npSWPmJ9uWGEQuWwZT5KqJNfq1iy7QKfUiKGTn1q+0Mc2WXP
o18v6Fnuqqh7+btrpfnvbTaKJ0mQHAw9H+0=</SignatureValue> > <KeyInfo>
> <KeyValue xmlns="http://www.w3.org/2000/09/xmldsig#">
> <RSAKeyValue>
>
> <Modulus>01k61JX5bc/jCLnnEHtzw3o08hs6+KjE58md8wkRrBgTTEU3gtmD1Q8SxPxpJ iSwGNR
CWTAghxSrK7AFYOCGZTblstnHerqs0Z/LTVNW2JaVkI34kvquqWdd6JJ+GNYWWuKuTiTjyEpLSik
jXXFTWkLJqDU/w1Lq6MN6g+z6lx8=</Modulus> > <Exponent>AQAB</Exponent>
> </RSAKeyValue>
> </KeyValue>
> </KeyInfo>
> </Signature>
> <FWT_CONFIG>
> <keyName>#PEREXEMPAMT</keyName>
> <keyValue>3100</keyValue>
> </FWT_CONFIG>
> <FWT_FORMULA>
> <Step>1</Step>
> <Token>MUL</Token>
> <Arg1>@TAXWAGES</Arg1>
> <Arg2>@PAYPERIODS</Arg2>
> <Arg3>ANNUALWAGE</Arg3>
> <Arg4 />
> <Arg5 />
> <Arg6 />
> <Arg7 />
> <Arg8 />
> <DefValue>0</DefValue>
> <Comment />
> </FWT_FORMULA>
> <FWT_TAXTABLES>
> <filingStatus>1</filingStatus>
> <taxTableId>3</taxTableId>
> <baseWage>9700</baseWage>
> <upperWage>30800</upperWage>
> <taxAmt>705</taxAmt>
> <taxRate>0.15</taxRate>
> </FWT_TAXTABLES>
> <FWT_TAXTABLES>
> <filingStatus>1</filingStatus>
> <taxTableId>4</taxTableId>
> <baseWage>30800</baseWage>
> <upperWage>68500</upperWage>
> <taxAmt>3870</taxAmt>
> <taxRate>0.25</taxRate>
> </FWT_TAXTABLES>
> </FWT>
>
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>
>> Brian,
>>
>> Can you post an example of the signed document?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Brian W. Smith" <Br*********@discussions.microsoft.com> wrote in message >> news:26**********************************@microsof t.com...
>> >I have XML Documents that I am digitally signing, and need to be able to >> >load
>> > these documents into DataSet objects. However, after checking the
>> > signature
>> > and using the DataSet.ReadXML method, I am getting an exception "The >> > root
>> > element is missing".
>> >
>> > I have struggled over the last 24 hours trying to figure out ways of >> > correcting this, however I am stuck. I would appreciate any help that >> > the
>> > community can provide me on this.
>> >
>> > Thanks,
>>
>>
>>


Nov 16 '05 #11
If it is possible, can you write the original DataSet data into the xml
file by using the FillSchema and Fill methods of the DataAdapter?

with regards,
J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Alfetta159 | last post by:
I've been setting up a schema with the XML Designer in VS .NET 2003. The designer lets me set up a lot of things including a complex type that contains an unnamed complex type called modified. ...
1
by: STeve | last post by:
Hi guys, I was wondering how I would go about creating a string array from a single column from a dataset. What I was thinking was iterate through each row in the dataset, finding out the size...
4
by: Miguel Dias Moura | last post by:
Hello, I created a datalist in an ASP.Net / VB page. I display the image and price of a few products. When a user clicks an image I want to load the page "detail.aspx?number=id" and send the...
7
by: Wayne Brantley | last post by:
I have found what appears to be an error in streaming with Datasets. It causes an error of 'Cannot find relation 0' when recreating the dataset from a stream. Here is how you reproduce it. ...
2
by: John | last post by:
I get this error while reading my config file but it is only occasionally and not all the time. I'm not sure why its happening. Does anyone know what could be going wrong? Thanks. The process...
0
by: Pete Newman | last post by:
In running vs (vb ) .net 2005 and Sql 2005 On my form i have an oledbconnection, an oledbdataadapter and a dataset. when i try and do an update i get an error; 'Child list for field...
4
by: sirjohnofthewest | last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man. Hi guys, I frequently visit this site to get answers to my...
4
by: =?Utf-8?B?VG9yZW4gVmFsb25l?= | last post by:
Was editing code, am getting the following errors } expected Type or namespace definition, or end-of-file expected Eyes crossed cannot find code below! using System; using...
2
by: JohnLorac | last post by:
Hello, I'm trying to load and write file on local disc drive using signed javascript file. But I have experienced problem running this url: ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.