Acrobat not validating signature with three pairs of ByteRange values

I have created a PDF with a Digital signature, when opened with Acrobat Reader 10 i see the signature not bieng validated with a message saying, "There are errors in the formatting or information contained in this signature (support information: SigDict /ByteRange value)". My signature's byterange  contains three pairs of integers(/ByteRange[0 569 6417 400 6817 1013]) which seems to be causing this problem. Will appreciate any input regarding this.

Hi SindhuCT,
I can't speak for PDF-XChange Viewer as to whether or not they are correctly processing the signature. The only thing I can point out is you are hashing the bytes from the beginning of the file (byte 0) to byte 569. Then you are leaving a hole for the signature from byte 570 through byte 6416. You are then hashing from byte 6417 and marching off another 400 bytes which gets you to byte 6817. Finally you are telling Acrobat/Reader to leave a hole from byte 6817 to the end of the file at byte 7830. The problem is your got byte 6817 on both sides of the fence, as part of the signed data and as part of the second unsigned portion of the file. That's probably where your problem lies.
Yes, the PDF specification does say you can include other ranges, but it also says that it's not recommended because you are not going to be checking for all changes to the document. The specification says you should sign the entire file, less the hole for the signature contents.
Steve

Similar Messages

  • Adobe Reader not validating signature with three pairs of ByteRange values

    I have created a PDF with a Digital signature, when opened with Acrobat  Reader 10 i see the signature not bieng validated with a message saying,  "There are errors in the formatting or information contained in this signature (support information: SigDict /ByteRange value)".  My signature's byterange  contains three pairs of integers(/ByteRange[0  569 6417 400 6817 1013]) which seems to be causing this problem. Will  appreciate any input regarding this.

    How have you created the signature? If you are using a program of your own creation, please repost in the Acrobat SDK forum.

  • Adobe Reader not validating signature with three byterange pairs

    I have created a PDF with a Digital signature from my program, when opened with Acrobat   Reader 10 i see the signature not bieng validated with a message  saying,  "There are errors in the formatting or information contained in this signature (support information: SigDict /ByteRange value)".   My signature's byterange  contains three pairs of  integers(/ByteRange[0  569 6417 400 6817 1013]) which seems to be  causing this problem. PDF-Xchange viewer works fine with the same file. It validates the signature!..  Appreciate any input regarding this.

    As described in ETSI TS 102778 (PAdES), the EU standard for PDF Digital
    Signatures that has been incorporated into ISO 32000-2, only a single set
    of byte ranges (aka two pairs) is permitted.

  • Not validating signature with jsr 105

    Hi all.
    I'm using the libraries of jsr105 xmldsig.jar and SunXmlSec-1.0.jar for signing a SAML token. I can sign the document apparently without problems but when I try to validate it in the same server that signed it simply I can't.
    This is my code for creating the signature:
    String providerName = System.getProperty("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
    XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM",(Provider) Class.forName(providerName).newInstance());
         Reference ref = fac.newReference
         ("", fac.newDigestMethod(DigestMethod.SHA1, null),
         Collections.singletonList
         (fac.newTransform
         (Transform.ENVELOPED, (TransformParameterSpec) null)),
         null, null);
         SignedInfo si = fac.newSignedInfo
         (fac.newCanonicalizationMethod
         (CanonicalizationMethod.INCLUSIVE,
         (C14NMethodParameterSpec) null),
         fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),
         Collections.singletonList(ref));
         KeyStore ks2 = KeyStore.getInstance(KeyStore.getDefaultType());
         ks2.load(new FileInputStream("C:\\KM\\keystore"), "".toCharArray());
         X509Certificate cert = (X509Certificate) pkEntry.getCertificate();
         KeyInfoFactory kif = fac.getKeyInfoFactory();
         List x509Content = new ArrayList();
         x509Content.add(cert.getSubjectX500Principal().getName());
         x509Content.add(cert);
         X509Data xd = kif.newX509Data(x509Content);
         KeyInfo ki = kif.newKeyInfo(Collections.singletonList(xd));
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         Document doc = dbf.newDocumentBuilder().parse(ad.newInputStream());
         doc.normalizeDocument();
         DOMSignContext dsc = new DOMSignContext
         (pkEntry.getPrivateKey(), doc.getDocumentElement());
         XMLSignature signature = fac.newXMLSignature(si, ki);
         dsc.setDefaultNamespacePrefix("ds");
         signature.sign(dsc);
    As you can see, I have added the prefix "ds" in it. Plus, the namespace won't appear in enveloping document (saml2:assertion in my case) but in the envelope of my message.
    And this is my code for validating:
    OMElementImpl ghj=(OMElementImpl)XMLUtils.toOM((doc.getDocumentElement()));
    assertdoc=AssertionDocument.Factory.parse(ghj.getXMLStreamReader());
    assertdoc2=AssertionDocument.Factory.parse(node,options);
    assertdoc3=(OMElementImpl)XMLUtils.toOM((XMLUtils.newDocument(assertdoc2.newInputStream(options)).getDocumentElement()));
    asdo=AssertionDocument.Factory.parse(ghj.getXMLStreamReader());
    SignatureDocument sido=SignatureDocument.Factory.newInstance();
    sido.setSignature(asdo.getAssertion().getSignature());
    // The code above will take the signature document from the assertion document. It's made using xmlbeans with axis2
    DOMValidateContext valContext = new DOMValidateContext      (cert.getPublicKey(), sido.newDomNode());
    XMLSignature signature2 = fac.unmarshalXMLSignature(valContext);
    boolean coreValidity = signature2.validate(valContext);
    boolean coreValidity2 = signature2.getSignatureValue().validate(valContext);
    The result is that coreValidity2 is true but coreValidity is false. I don't know where the problem could be.
    Could someone help me?This is very important for me. Thanks in advance.
    EDIT: I have added the next code to see if references were ok as well:
    Iterator i = signature.getSignedInfo().getReferences().iterator();
         for (int j=0; i.hasNext(); j++) {
         boolean refValid = ((Reference) i.next()).validate(valContext);
         throw new Exception("ref["+j+"] validity status: " + refValid);
    and the validity status is true (there was only one referenc so forget about the for loop). So if references and signature are ok. How I can get a false in boolean coreValidity = signature2.validate(valContext); ?
    Thank you very much for your cooperation.
    Message was edited by:
    the_killer_tomato

    Hi SindhuCT,
    I can't speak for PDF-XChange Viewer as to whether or not they are correctly processing the signature. The only thing I can point out is you are hashing the bytes from the beginning of the file (byte 0) to byte 569. Then you are leaving a hole for the signature from byte 570 through byte 6416. You are then hashing from byte 6417 and marching off another 400 bytes which gets you to byte 6817. Finally you are telling Acrobat/Reader to leave a hole from byte 6817 to the end of the file at byte 7830. The problem is your got byte 6817 on both sides of the fence, as part of the signed data and as part of the second unsigned portion of the file. That's probably where your problem lies.
    Yes, the PDF specification does say you can include other ranges, but it also says that it's not recommended because you are not going to be checking for all changes to the document. The specification says you should sign the entire file, less the hole for the signature contents.
    Steve

  • Not valid signature on hybrid extension

    I'm trying to sign an hybrid extension with my Globalsign certificate, I have tried using the signing toolkit and also directly in FlashBuilder ( Export Extension - hybrid).
    While installing the extension I always get "Extension ... does not contain valid signature". It creates the package without any warning or error, but I can't install it.
    I have successfully signed non hybrid extensions and they install fine, it's just the hybrid one. The certificate is also recent and I have tried including timestamp and without.
    Using Windows Vista and Extension Manager 6.0.1.26 , I have heard about issues with Mac OS X in the past but it's not the case.
    When using the signing tool the command is: java -jar ucf.jar -package -storetype PKCS12 -keystore globalsign.p12 com.mycompany.myextension.zxp -C "C:\myextfolder" .
    If I create the hybrid package using the Extension Manager it installs fine but I get this ugly warning for not signed extension.

    After a lot of try and error I have found the reason:
    My hybrid extension includes many resource files, the certificate adds a signature for each of this files, after around 300 files the signature starts to become corrupt ( this can be seen in the signature file included in the package) and logically extension manager issues a not valid certificate message when installing.
    The solution I have adopted is to include only one compressed file with all resource files instead of any single file, then my extension must unzip it the first time at runtime. It's not ideal but works and all packages are correctly signed.
    I have not found any mention to a limit of the files in the documentation but propably no one was thinking on so large extensions
    Hope it helps somebody

  • Persona not validated in signature

    Good afternoon!
    So I'm having an issue with a digital signature for one of our personnel and this is apparently the way to get support.
    We are having issues with people rejecting her digital signature because on the right hand side it says persona not validated.. Is there a way to make that go away, so that the persona is validated? I believe I have checked all my revocations and trusts and everything appears fine but doesn't mean I didn't miss something..
    We are using Adobe Acrobat Standard 11
    Debbie test.png - Google Drive

    Hi kihomachelpdesk,
    TSN is correct, this is not tech support, but in this one case you've have gotten a hold of Adobe anyways. 
    The name that you see in the textual portion of the digital signature appearance (the right half of the signature field) is the value of the CN (common name) entry in the Subject extension of the digital ID used to create the digital signature. You need to procure for Ms. Leonard a digital ID from Symantec with a less frightening set of entries in the Subject name. Note that the OU (organizational unit) also says "Persona Not Validated" along with the CN entry. One of the tenets of using a "trusted third-party" to supply the digital ID is it's their job it to have vetted the identity of the end-user to whom they are issuing the digital ID. That way the document recipient (who must physically trust the Symantec Root CA certificate in order for the signature to be valid) is assured the signer is who they say they are (it's known as non-repudiation). My guess is Ms. Leonard obtained a test (or sample) digital ID form Symantec and since Symantec gives those away they don't bother with the identity vetting procedure like they do with digital IDs that are paid for. Since they aren't doing any identity verification they add the "Persona Not Validated" text so the document recipient isn't fooled into the believing the signer is someone that they are not.
    As an aside, you can also make the graphics portion of the signature appearance (the left half of the signature field) look a bit better if you make the background of the signature appearance file transparent (aka removing all background opacity). That way the background won't obliterate the trefoil logo. And if you really want to get fancy you can replace the trefoil with your own company logo.
    Steve

  • Signatures applied with Acrobat 11 appear not valid in Acrobat 9

    I've attempted to contact Adobe support about this issue, but they referred me here because the issue is with a previous version of Acrobat. 
    We use Acrobat Standard 11 to digitally sign documents using Adobe Certified Document Services (CDS) certificates issued by GlobalSign.  Each document has multiple signatures, the first of which is the certifying signature, then the others are approval signatures.  We've followed the Adobe guidelines for applying certificate based signatures (http://helpx.adobe.com/acrobat/using/certificate-based-signatures.html) and have not had a problem until recently when a client reported that the signatures are coming up invalid.  When I asked which version of Acrobat they are using, he replied that they have Acrobat 9.
    To test, I booted up a VM with Win7 and Acrobat Standard 9 (9.5.5) and was able to reproduce the issue.  I opened the signed PDF in Acrobat 9, and the blue certification ribbon showed and indicated that all signatures are valid. 
    I opened the signatures panel and clicked the "Validate All" button and all of a sudden, the first (certifying) signature was now marked invalid. 
    The details of the invalid signature indicated that "there have been changes made to this document that invalidate the signature", but all I did was validate the signatures (they were checked and indicated as valid when the document was opened). 
    I know this is for an older version of Acrobat, but many of our clients are using version 9 and we'd like to be able to have the signatures appear valid (because they are).  I've spoken with GlobalSign support who has verified that the certificate chain saved within the document is properly linked to the Adobe certifiate for CDS.
    Any help is appreciated.
    Thanks,
    Phil

    This could be a bug in Acrobat 9. I presume you have "Validate on Open" preference set, so that when you open a signed PDF all signtures are validated. What may happen is that on open the first (certification) signatures is validated but the second signature is not processed yet. When you revalidated all signatures, both signatures were already processed and the second validation detects some incompatibility. There were changes in Acrobat X and XI with respect to signature permissions which may not had been ported back to Acrobat 9.

  • Acrobat is not validating digital signature

    Hi Everybody...
    I have generated a pdf file which includes digital signatures.
    But the acrobat is not validating the digital signature. But if
    we open this file in PDF-xchange viewer, it shows that the
    signatures are valid. Acrobat generates the following error...
    Error during signature verification.
    Signature contains incorrect, unrecognized, corrupted or
    suspicious data.
    Support Information: SigDict /Contents illegal data
    What may be the problem?

    Thank you Bernd for your kind and simple reply  
    I am uploading my file with my certificate which i am using for my digital
    signatures. Please have a deep look at contents entry. Use ASNVIEWER or
    decoder etc......
    Thanks again and Best Regards

  • Digital signature is not valid in acrobat reader 9

    digital signature is not valid in acrobat reader 9

    Your answers are very short, please give more details so that we can try to help.
    - Who signed the document - did you sign it?
    - where WAS it valid
    - how was it made
    - anything else relevant

  • Validating detached signature with jsr105

    Hi all.
    I need to sign a SOAP message and I need to use JSR105. I've created a message with the following code and is signed without problems. However, I can't validate the signature. As you can see the elements that contains the nodes are OMElement (specific for Axis2 SOAP server) that are an instance of Node and Element classes.
    The error I get is:
    Exception in thread "main" javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID 1
         at org.jcp.xml.dsig.internal.dom.DOMReference.dereference(DOMReference.java:366)
         at org.jcp.xml.dsig.internal.dom.DOMReference.validate(DOMReference.java:318)
         at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.validate(DOMXMLSignature.java:230)
         at SignedSoap.main(SignedSoap.java:272)
    Caused by: javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID 1
         at org.jcp.xml.dsig.internal.dom.DOMURIDereferencer.dereference(DOMURIDereferencer.java:84)
         at org.jcp.xml.dsig.internal.dom.DOMReference.dereference(DOMReference.java:358)
         ... 3 more
    Caused by: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID 1
         at com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverFragment.engineResolve(Unknown Source)
         at com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver.resolve(Unknown Source)
         at org.jcp.xml.dsig.internal.dom.DOMURIDereferencer.dereference(DOMURIDereferencer.java:77)
         ... 4 more
    javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID 1
         at org.jcp.xml.dsig.internal.dom.DOMURIDereferencer.dereference(DOMURIDereferencer.java:84)
         at org.jcp.xml.dsig.internal.dom.DOMReference.dereference(DOMReference.java:358)
         at org.jcp.xml.dsig.internal.dom.DOMReference.validate(DOMReference.java:318)
         at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.validate(DOMXMLSignature.java:230)
         at SignedSoap.main(SignedSoap.java:272)
    Caused by: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot resolve element with ID 1
         at com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverFragment.engineResolve(Unknown Source)
         at com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver.resolve(Unknown Source)
         at org.jcp.xml.dsig.internal.dom.DOMURIDereferencer.dereference(DOMURIDereferencer.java:77)
         ... 4 more
    My code is as follows
    import java.security.KeyPair;
    import java.security.KeyPairGenerator;
    import java.security.Provider;
    import java.security.SecureRandom;
    import java.util.Calendar;
    import java.util.Collections;
    import javax.xml.crypto.dsig.*;
    import javax.xml.crypto.dom.*;
    import javax.xml.crypto.dsig.dom.*;
    import javax.xml.crypto.dsig.keyinfo.*;
    import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
    import javax.xml.soap.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.stream.*;
    import org.apache.axiom.om.OMAttribute;
    import org.apache.axiom.om.OMElement;
    import org.apache.axiom.om.OMNamespace;
    import org.apache.axiom.om.impl.dom.factory.OMDOMFactory;
    import org.apache.xmlbeans.impl.piccolo.xml.XMLStreamReader;
    import org.w3c.dom.*;
    import org.w3c.dom.Node;
    import org.xml.sax.InputSource;
    //import org.xmlsoap.schemas.soap.encoding.DateTime;
    * Construct a SOAP message, sign it and then validate the signature.
    * This implementation follows the
    * <a ref="http://www.w3.org/TR/SOAP-dsig/">
    * W3C Note on digital signatures in SOAP messages
    * </a>.
    * The validating key is included in the signature.
    * DOM Level 2 is used throughout.
    * <p>
    * The following SOAP message is signed:
    * <pre><code>
    * <?xml version="1.0" encoding="UTF-8"?>
    * <soap-env:Envelope
    * xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
    * <soap-env:Header>
    * <SOAP-SEC:Signature
    * mustUnderstand="1"
    * xmlns:SOAP-SEC="http://schemas.xmlsoap.org/soap/security/2000-12"/>
    * </soap-env:Header>
    * <soap-env:Body id="Body">
    * <m:GetLastTradePrice xmlns:m="http://wombats.ztrade.com">
    * <symbol>SUNW</symbol>
    * </m:GetLastTradePrice>
    * </soap-env:Body>
    * </soap-env:Envelope>
    * </code></pre>
    public class SignedSoap {
    private static boolean debug = false;
    public static void main(String[] args) throws Exception {
         int argc = args.length;
         if (argc == 1) {
         if (args[0].equalsIgnoreCase("-help")) {
              System.out.println("Usage: SignedSoap [-debug]");
              System.out.println(" -debug\tactivates debug messages");
              return;
         debug = args[0].equalsIgnoreCase("-debug");
         // Create the SOAP message
         OMDOMFactory omfact=new OMDOMFactory();
         //Node nodo1=fd.newDomNode(options);
         OMNamespace namespace=omfact.createOMNamespace("http://schemas.xmlsoap.org/soap/security/2000-12", "soapenv");
         OMNamespace namespace2=omfact.createOMNamespace("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "wsu");
         OMAttribute attr=omfact.createOMAttribute("mustUnderstand",namespace,"1");
         OMAttribute id=omfact.createOMAttribute("id",namespace,"1");
         OMAttribute id2=omfact.createOMAttribute("id",namespace,"2");
         OMElement sec=omfact.createOMElement("Security", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","wsse");
         OMElement timestamp=omfact.createOMElement("Timestamp",namespace2);
         OMElement created=omfact.createOMElement("Created",namespace2);
         OMElement expires=omfact.createOMElement("Expires",namespace2);
         created.setText("12122007");
         expires.setText("12122008");
         timestamp.addAttribute(id);
         timestamp.addChild(created);
         timestamp.addChild(expires);
         sec.addChild(timestamp);
         System.out.println("Generating the DOM tree...");
         // Get input source
         org.w3c.dom.Node security = (Node)sec;
         //if (debug) {
         // dumpDOMDocument(root);
         // Generate a DSA key pair
         System.out.println("Generating the DSA keypair...");
         KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
         kpg.initialize(1024, new SecureRandom("not so random".getBytes()));
         KeyPair keypair = kpg.generateKeyPair();
    // Assemble the signature parts
         System.out.println("Preparing the signature...");
         String providerName = System.getProperty
    ("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
         XMLSignatureFactory sigFactory = XMLSignatureFactory.getInstance("DOM",
    (Provider) Class.forName(providerName).newInstance());
    Reference ref = sigFactory.newReference("#1",
         sigFactory.newDigestMethod(DigestMethod.SHA1, null));
    SignedInfo signedInfo = sigFactory.newSignedInfo(
         sigFactory.newCanonicalizationMethod(
              CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
              (C14NMethodParameterSpec) null),
    sigFactory.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
         Collections.singletonList(ref));
         KeyInfoFactory kif = sigFactory.getKeyInfoFactory();
         KeyValue kv = kif.newKeyValue(keypair.getPublic());
    KeyInfo keyInfo = kif.newKeyInfo(Collections.singletonList(kv));
    XMLSignature sig = sigFactory.newXMLSignature(signedInfo, keyInfo);
         // Insert XML signature into DOM tree and sign
         System.out.println("Signing the SOAP message...");
         // Find where to insert signature
         Element ts = getFirstChildElement(envelope);
         DOMSignContext sigContext =
         new DOMSignContext(keypair.getPrivate(), sec);
         // Need to distinguish the Signature element in DSIG (from that in SOAP)
         sigContext.putNamespacePrefix(XMLSignature.XMLNS, "ds");
         // register Body ID attribute getNextSiblingElement(
         sigContext.setIdAttributeNS
         (ts,
         "http://schemas.xmlsoap.org/soap/security/2000-12","id");
         sig.sign(sigContext);
         if (debug) {
         dumpDOMDocument(envelope);
         // Validate the XML signature
    // Locate the signature element
         Element sigElement = getNextSiblingElement(ts);
    // Validate the signature using the public key generated above
    DOMValidateContext valContext =
         new DOMValidateContext(keypair.getPublic(), sigElement);
         // register Body ID attribute getNextSiblingElement(
         valContext.setIdAttributeNS
         (ts,
         "http://schemas.xmlsoap.org/soap/security/2000-12","id");
    boolean isValid = sig.validate(valContext);
         System.out.println("Validating the signature... " +
         (isValid ? "valid" : "invalid"));
    * Outputs DOM representation to the standard output stream.
    * @param root The DOM representation to be outputted
    private static void dumpDOMDocument(org.w3c.dom.Node root)
         throws TransformerException, TransformerConfigurationException {
         System.out.println("\n");
         // Create a new transformer object
         Transformer transformer =
         TransformerFactory.newInstance().newTransformer();
         transformer.setOutputProperty(OutputKeys.INDENT, "yes");
         // Dump the DOM representation to standard output
         transformer.transform(new DOMSource(root), new StreamResult(System.out));
         System.out.println("\n");
    * Returns the first child element of the specified node, or null if there
    * is no such element.
    * @param node the node
    * @return the first child element of the specified node, or null if there
    *     is no such element
    * @throws NullPointerException if <code>node == null</code>
    private static Element getFirstChildElement(org.w3c.dom.Node node) {
         org.w3c.dom.Node child = node.getFirstChild();
         while (child != null &&
         child.getNodeType() != org.w3c.dom.Node.ELEMENT_NODE) {
    child = child.getNextSibling();
    return (Element) child;
    * Returns the next sibling element of the specified node, or null if there
    * is no such element.
    * @param node the node
    * @return the next sibling element of the specified node, or null if there
    *     is no such element
    * @throws NullPointerException if <code>node == null</code>
    public static Element getNextSiblingElement(org.w3c.dom.Node node) {
         org.w3c.dom.Node sibling = node.getNextSibling();
         while (sibling != null &&
         sibling.getNodeType() != org.w3c.dom.Node.ELEMENT_NODE) {
    sibling = sibling.getNextSibling();
    return (Element) sibling;
    Thanks in advance

    I've done further advancemets. It seems that the element to feed the sign validator MUST be a document AND that the ID attribute has to be registered in it even if has been already located in inner elements of the message. Now my code looks as follows but I'm not validating the reference. The sign itself can validate though.
    The problem is the reference validation. Any ideas? Could it be the prefixes or namespaces? I've been making tests changing both but no luck so far.
    Thanks in advance.
    package _2006_08.sa.liberty;
    import java.security.KeyPair;
    import java.security.KeyPairGenerator;
    import java.security.Provider;
    import java.security.SecureRandom;
    import java.util.Calendar;
    import java.util.Collections;
    import java.util.Iterator;
    import javax.xml.crypto.URIDereferencer;
    import javax.xml.crypto.URIReference;
    import javax.xml.crypto.dsig.*;
    import javax.xml.crypto.dom.*;
    import javax.xml.crypto.dsig.dom.*;
    import javax.xml.crypto.dsig.keyinfo.*;
    import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
    import javax.xml.soap.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.stream.*;
    import org.apache.axiom.om.OMAttribute;
    import org.apache.axiom.om.OMElement;
    import org.apache.axiom.om.OMNamespace;
    import org.apache.axiom.om.impl.dom.factory.OMDOMFactory;
    import org.apache.xmlbeans.impl.piccolo.xml.XMLStreamReader;
    import org.oasis_open.docs.wss._2004._01.oasis_200401_wss_wssecurity_secext_1_0_xsd.SecurityDocument;
    import org.w3c.dom.*;
    import org.w3c.dom.Node;
    import org.xml.sax.InputSource;
    //import org.xmlsoap.schemas.soap.encoding.DateTime;
    * Construct a SOAP message, sign it and then validate the signature.
    * This implementation follows the
    * <a ref="http://www.w3.org/TR/SOAP-dsig/">
    * W3C Note on digital signatures in SOAP messages
    * </a>.
    * The validating key is included in the signature.
    * DOM Level 2 is used throughout.
    * <p>
    * The following SOAP message is signed:
    * <pre><code>
    * <?xml version="1.0" encoding="UTF-8"?>
    * <soap-env:Envelope
    * xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
    * <soap-env:Header>
    * <SOAP-SEC:Signature
    * mustUnderstand="1"
    * xmlns:SOAP-SEC="http://schemas.xmlsoap.org/soap/security/2000-12"/>
    * </soap-env:Header>
    * <soap-env:Body id="Body">
    * <m:GetLastTradePrice xmlns:m="http://wombats.ztrade.com">
    * <symbol>SUNW</symbol>
    * </m:GetLastTradePrice>
    * </soap-env:Body>
    * </soap-env:Envelope>
    * </code></pre>
    public class SignedSoap {
    private static boolean debug = false;
    public static void main(String[] args) throws Exception {
         int argc = args.length;
         if (argc == 1) {
         if (args[0].equalsIgnoreCase("-help")) {
              System.out.println("Usage: SignedSoap [-debug]");
              System.out.println(" -debug\tactivates debug messages");
              return;
         debug = args[0].equalsIgnoreCase("-debug");
         // Create the SOAP message
         System.out.println("Creating the SOAP message...");
         SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
         SOAPPart soapPart = soapMessage.getSOAPPart();
         SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
         if(soapEnvelope instanceof Source){
              System.out.println("0");
         if(soapEnvelope instanceof Node){
         System.out.println("1");
         if(soapEnvelope instanceof Element){
         System.out.println("2");
         if(soapEnvelope instanceof Document){
              System.out.println("3");
         SOAPHeader soapHeader = soapEnvelope.getHeader();
         SOAPHeaderElement headerElement = soapHeader.addHeaderElement(
    soapEnvelope.createName("Signature", "SOAP-SEC",
    "http://schemas.xmlsoap.org/soap/security/2000-12"));
         SOAPBody soapBody = soapEnvelope.getBody();
         soapBody.addAttribute(soapEnvelope.createName("id", "SOAP-SEC",
         "http://schemas.xmlsoap.org/soap/security/2000-12"), "1");
         Name bodyName =soapEnvelope.createName("GetLastTradePrice", "m",
         "http://wombats.ztrade.com");
         SOAPBodyElement gltp = soapBody.addBodyElement(bodyName);
         Name name = soapEnvelope.createName("symbol");
         SOAPElement symbol = gltp.addChildElement(name);
         symbol.addTextNode("SUNW");
         // Generate a DOM representation of the SOAP message
         OMDOMFactory omfact=new OMDOMFactory();
         //Node nodo1=fd.newDomNode(options);
         OMNamespace namespace=omfact.createOMNamespace("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "wsu");
         OMNamespace namespace2=omfact.createOMNamespace("http://www.w3.org/2002/12/soap-envelope", "S");
         OMAttribute attr=omfact.createOMAttribute("mustUnderstand",namespace,"1");
         OMAttribute id=omfact.createOMAttribute("Id",namespace2,"1");
         OMAttribute id2=omfact.createOMAttribute("Id",namespace2,"2");
         OMElement sec=omfact.createOMElement("Security", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","wsse");
         OMElement timestamp=omfact.createOMElement("Timestamp",namespace);
         OMElement created=omfact.createOMElement("Created",namespace);
         OMElement expires=omfact.createOMElement("Expires",namespace);
         OMElement frame=omfact.createOMElement("Framework",namespace2);
         OMElement signa=omfact.createOMElement("Signature",namespace2);
         timestamp.declareDefaultNamespace(namespace.getNamespaceURI());
         timestamp.setNamespace(namespace);
         Calendar now=Calendar.getInstance();
         Calendar exp=Calendar.getInstance();
         exp.add(now.MINUTE, 5);
         System.out.println("test");
         created.setText("created");
         expires.setText("expires");
         System.out.println("test");
         timestamp.addAttribute(id);
         System.out.println("test");
         timestamp.addChild(created);
         timestamp.addChild(expires);
         //sec.addChild(signa);
         sec.addAttribute(id2);
         sec.addChild(timestamp);
         //sec.addChild(frame);
         //System.out.println(sec.getParent().toString());
         System.out.println("Generating the DOM tree...");
         // Get input source
         Source source = soapPart.getContent();
         if(soapPart instanceof Source){
                   System.out.println("10");
              if(soapPart instanceof Node){
              System.out.println("11");
              if(soapPart instanceof Element){
              System.out.println("12");
              if(soapPart instanceof Document){
                   System.out.println("13");
         //Source source2 = soapPart.getFirstChild();
         //System.out.println(source.toString());
              //javax.xml.stream.XMLStreamReader inSource = sec.getXMLStreamReader();
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         DocumentBuilder db = null;
         System.out.println("13");
         //synchronized (dbf) {
              db = dbf.newDocumentBuilder();
              System.out.println("13");
         Document doc = db.newDocument();
         doc.appendChild((Node)sec);
         org.w3c.dom.Node root = (org.w3c.dom.Node) doc.getDocumentElement();
         System.out.println("13");
         System.out.println("13: "+root.getFirstChild().getLocalName());
         org.w3c.dom.Node envelope = (Node)sec;//soapPart.getFirstChild();
    /* Node) sec;
         if (source instanceof DOMSource) {
         root = ((DOMSource)source).getNode();
         } else if (source instanceof SAXSource) {
         InputSource inSource = ((SAXSource)source).getInputSource();
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         DocumentBuilder db = null;
         synchronized (dbf) {
              db = dbf.newDocumentBuilder();
         Document doc = db.parse(inSource);
         root = (org.w3c.dom.Node) doc.getDocumentElement();
         } else {
         System.err.println("error: cannot convert SOAP message (" +
              source.getClass().getName() + ") into a W3C DOM tree");
         System.exit(-1);
         //if (debug) {
         // dumpDOMDocument(root);
         // Generate a DSA key pair
         System.out.println("Generating the DSA keypair...");
         KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
         kpg.initialize(1024, new SecureRandom("not so random".getBytes()));
         KeyPair keypair = kpg.generateKeyPair();
    // Assemble the signature parts
         System.out.println("Preparing the signature...");
         String providerName = System.getProperty
    ("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
         XMLSignatureFactory sigFactory = XMLSignatureFactory.getInstance("DOM",
    (Provider) Class.forName(providerName).newInstance());
    Reference ref = sigFactory.newReference("#1",
         sigFactory.newDigestMethod(DigestMethod.SHA1, null));
    SignedInfo signedInfo = sigFactory.newSignedInfo(
         sigFactory.newCanonicalizationMethod(
              CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
              (C14NMethodParameterSpec) null),
    sigFactory.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
         Collections.singletonList(ref));
         KeyInfoFactory kif = sigFactory.getKeyInfoFactory();
         KeyValue kv = kif.newKeyValue(keypair.getPublic());
    KeyInfo keyInfo = kif.newKeyInfo(Collections.singletonList(kv));
    XMLSignature sig = sigFactory.newXMLSignature(signedInfo, keyInfo);
         // Insert XML signature into DOM tree and sign
         System.out.println("Signing the SOAP message...");
         // Find where to insert signature
         //Element envelope = getFirstChildElement(root);
         Element header = getFirstChildElement(envelope);
         System.out.println("Signing the SOAP message...");
         //System.out.println(header.getLocalName());
         DOMSignContext sigContext =
         new DOMSignContext(keypair.getPrivate(), envelope);
         // Need to distinguish the Signature element in DSIG (from that in SOAP)
         System.out.println("Signing the SOAP message...");
         sigContext.putNamespacePrefix(XMLSignature.XMLNS, "ds");
         // register Body ID attribute getNextSiblingElement(
         sigContext.setIdAttributeNS
         (header,
                   "http://www.w3.org/2002/12/soap-envelope","Id");
         System.out.println("Signing the SOAP message...");
         sig.sign(sigContext);
         if (debug) {
         dumpDOMDocument(envelope);
         // Validate the XML signature
         String providerName2 = System.getProperty
    ("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
    XMLSignatureFactory sigFactory2 = XMLSignatureFactory.getInstance("DOM",
    (Provider) Class.forName(providerName2).newInstance());
    SecurityDocument secdoc=SecurityDocument.Factory.parse(envelope);
    System.out.println(secdoc.xmlText());
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         Document doc = dbf.newDocumentBuilder().parse(secdoc.newInputStream());
    // Locate the signature element
         //Element sigElement = //getFirstChildElement(header);
              //getNextSiblingElement(header);
    // Validate the signature using the public key generated above
         System.out.println(doc.getFirstChild().getLastChild().getLocalName());
         DOMValidateContext valContext = new DOMValidateContext
    (keypair.getPublic(), doc.getElementsByTagName("ds:Signature").item(0));
              valContext.setProperty("javax.xml.crypto.dsig.cacheReference", Boolean.TRUE);
              System.out.println(doc.getElementsByTagName("ds:Signature").item(0).getLocalName());
    // DOMValidateContext valContext =
         // new DOMValidateContext(keypair.getPublic(), sigElement);
         // register Body ID attribute getNextSiblingElement(
    // System.out.println(header.getNamespaceURI());
              //valContext.setIdAttributeNS((Element) doc.
                   //     getElementsByTagNameNS("wsu", "Timestamp").item
                        //(0), null, "Id");
              ((Element)doc.getElementsByTagName("wsu:Timestamp").item(0)).setAttributeNS("S", "Id", "1");
              ((Element)doc.getElementsByTagName("wsu:Timestamp").item(0)).setPrefix("wsu");
              valContext.setIdAttributeNS((Element)doc.getElementsByTagName("wsu:Timestamp").item(0),
         "http://www.w3.org/2002/12/soap-envelope","Id");
         //System.out.println(valContext.getElementById("1").getLocalName());
         //valContext.setBaseURI("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
         System.out.println("1");
         XMLSignature signature = sigFactory2.unmarshalXMLSignature(valContext);
         System.out.println("2: "+valContext.getDefaultNamespacePrefix());
         System.out.println(valContext.getElementById("1").getLocalName());
         //System.out.println(header.getLocalName());
         //System.out.println(getNextSiblingElement(header).getLocalName());
         //System.out.println(header.getAttribute("id"));
         //System.out.println(header.getBaseURI());
         if(signature.getSignatureValue().validate(valContext))
         System.out.println("Firma OK");
         Iterator it = signature.getSignedInfo().getReferences().iterator();
    if (((Reference) it.next()).validate(valContext))
         System.out.println("ref OK");
    boolean isValid = signature.validate(valContext);
         System.out.println("Validating the signature... " +
         (isValid ? "valid" : "invalid"));
    * Outputs DOM representation to the standard output stream.
    * @param root The DOM representation to be outputted
    private static void dumpDOMDocument(org.w3c.dom.Node root)
         throws TransformerException, TransformerConfigurationException {
         System.out.println("\n");
         // Create a new transformer object
         Transformer transformer =
         TransformerFactory.newInstance().newTransformer();
         transformer.setOutputProperty(OutputKeys.INDENT, "yes");
         // Dump the DOM representation to standard output
         transformer.transform(new DOMSource(root), new StreamResult(System.out));
         System.out.println("\n");
    * Returns the first child element of the specified node, or null if there
    * is no such element.
    * @param node the node
    * @return the first child element of the specified node, or null if there
    *     is no such element
    * @throws NullPointerException if <code>node == null</code>
    private static Element getFirstChildElement(org.w3c.dom.Node node) {
         org.w3c.dom.Node child = node.getFirstChild();
         while (child != null &&
         child.getNodeType() != org.w3c.dom.Node.ELEMENT_NODE) {
    child = child.getNextSibling();
    return (Element) child;
    * Returns the next sibling element of the specified node, or null if there
    * is no such element.
    * @param node the node
    * @return the next sibling element of the specified node, or null if there
    *     is no such element
    * @throws NullPointerException if <code>node == null</code>
    public static Element getNextSiblingElement(org.w3c.dom.Node node) {
         org.w3c.dom.Node sibling = node.getNextSibling();
         while (sibling != null &&
         sibling.getNodeType() != org.w3c.dom.Node.ELEMENT_NODE) {
    sibling = sibling.getNextSibling();
    return (Element) sibling;
    }

  • Error #2046: The loaded file did not have a valid signature.

    I have three different applications which suddenly stopped working with this error
    Error #2046: The loaded file did not have a valid signature.
    None of the sites has been touched in Months, I assumed they would keep working the way they had.
    I wonder how many other sites are experiencing this and how many PO'd customers there are out there??
    This is really bad business practice, what is causing it?
    Dan Pride
    Note: the three were developed around the same time, one domain went down for a few days and was then renewed????

    Daniel... have you found a solution to your problem?
    I am also having the same problem. I was googling with no avail, when I noticed you added this post just yesterday,
    so I am thinking that adobe has done something to the swz files hosted on thier servers.
    Can someone from Adobe confirm if anything was done to either swz files or the crossdomain files on their end?
    I am in the same boat as you... no changes on our side, but the application has suddenly stopped working.
    We were building against a beta build of flex 4 (4.0.0.10485)
    I wonder which sdk version you are using?
    Here is what I see through the debugger...
    Warning: Ignoring 'secure' attribute in policy file from http://fpdownload.adobe.com/pub/swz/crossdomain.xml. The 'secure' attribute is only permitted in HTTPS and socket policy files. See http://www.adobe.com/go/strict_policy_files for details.
    [SWF] C:\Inetpub\wwwdata\xxxxxxxxx_Application.swf - 847,661 bytes after decompression
    Error #2046: The loaded file did not have a valid signature.
    Failed to load RSL http://fpdownload.adobe.com/pub/swz/flex/4.0.0.10485/framework_4.0.0.10485.swz
    Failing over to RSL framework_4.0.0.10485.swz
    Error #2046: The loaded file did not have a valid signature.
    PS... I have tried multple PCs (XP, Vista, Server 2008) with different versions of flash player (10.0.45.2, 10.0.22.87)
    Any help appreciated.

  • Installation failing: "Strong name signature not valid for this assembly vslshost.exe"

    Hi
    My LightSwitch desktop client installation fail with the message below, but sure I cant sign vslshost.exe?
    Help would be much appreciated.
    OPERATION PROGRESS STATUS
     * [2014/01/16 09:59:06 AM] : Activation of M:\[path removed] has started.
     * [2014/01/16 09:59:06 AM] : Processing of deployment manifest has successfully completed.
     * [2014/01/16 09:59:06 AM] : Installation of the application has started.
     * [2014/01/16 09:59:06 AM] : Processing of application manifest has successfully completed.
     * [2014/01/16 09:59:09 AM] : Found compatible runtime version 4.0.30319.
     * [2014/01/16 09:59:09 AM] : Request of trust and detection of platform is complete.
    ERROR DETAILS
     Following errors were detected during this operation.
     * [2014/01/16 09:59:09 AM] System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
      - Strong name signature not valid for this assembly vslshost.exe.
      - Source: System.Deployment
      - Stack trace:
       at System.Deployment.Application.ComponentVerifier.VerifyStrongNameAssembly(String filePath, AssemblyManifest assemblyManifest)
       at System.Deployment.Application.ComponentVerifier.VerifyComponents()
       at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification
    notification, DownloadOptions options)
       at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
       at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
       at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
       at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
    COMPONENT STORE TRANSACTION DETAILS
     No transaction information is available

    Hi Gert.C
    If you don't deploy your LightSwitch successfully on your side, you could follow this guide to
    deploy a Three-Tier LightSwitch application.
    > - Strong name signature not valid for this assembly vslshost.exe.
    For this
    vslshost.exe issue, our community members gives detailed explanation before.
    You publish your LS App somewhere (even on your development machine) & run the setup program found in the folder that you publish to
    Once the application is published, there'll be an icon in the Start Menu to run the application from. You can run the published application by clicking on the icon.
    You can, but shouldn't, actually run the published application from the setup.exe file, but defintely not "vslchost.exe".
    hope it helps.
    Regards
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • An error occurred during local report processing.The definition of the report '' is invalid.The definition of this report is not valid or supported by this version of Reporting Services. he report definition may have been created with a later version of R

    Hi,
    I am trying to create rdlc file programmatically. Using Memory Table as dataset. Here is my code
    ' For each field in the resultset, add the name to an array listDim m_fields AsArrayList
      m_fields = NewArrayList()
      Dim i AsIntegerFor i = 0 To tbdataset.Tables(0).Columns.Count - 1
          m_fields.Add(tbdataset.Tables(0).Columns(i).ColumnName.ToString)
      Next i
      'Create Report 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition' Open a new RDL file stream for writingDim stream AsFileStream
      stream = File.OpenWrite("D:\MyTestReport2.rdlc")
      Dim writer AsNewXmlTextWriter(stream, Encoding.UTF8)
      ' Causes child elements to be indented
      writer.Formatting = Formatting.Indented
      ' Report element
      writer.WriteProcessingInstruction("xml", "version=""1.0"" encoding=""utf-8""")
      writer.WriteStartElement("Report")
      writer.WriteAttributeString("xmlns", Nothing, "http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition")
      writer.WriteAttributeString("xmlns:rd", "http://schemas.microsoft.com/SQLServer/reporting/reportdesigner")
      writer.WriteStartElement("ReportSections")
      writer.WriteStartElement("ReportSection")
      writer.WriteElementString("Width", "11in")
      writer.WriteStartElement("Body")
      writer.WriteElementString("Height", "5in")
      writer.WriteStartElement("ReportItems")
      writer.WriteStartElement("Tablix")
      writer.WriteAttributeString("Name", Nothing, "Tablix1")
      writer.WriteElementString("Top", ".5in")
      writer.WriteElementString("Left", ".5in")
      writer.WriteElementString("Height", ".5in")
      writer.WriteElementString("Width", (m_fields.Count * 1.5).ToString() + "in")
      writer.WriteStartElement("TablixBody")
      ' Tablix Columns
      writer.WriteStartElement("TablixColumns")
      ForEach fieldName In m_fields
          writer.WriteStartElement("TablixColumn")
          writer.WriteElementString("Width", "1.5in")
          writer.WriteEndElement() ' TableColumnNext fieldName
      writer.WriteEndElement() ' TablixColumns' Header Row
      writer.WriteStartElement("TablixRows")
      writer.WriteStartElement("TablixRow")
      writer.WriteElementString("Height", ".25in")
      writer.WriteStartElement("TablixCells")
      ForEach fieldName In m_fields
          writer.WriteStartElement("TablixCell")
          writer.WriteStartElement("CellContents")
          writer.WriteStartElement("Textbox")
          writer.WriteAttributeString("Name", Nothing, "Header" + fieldName)
          ' writer.WriteAttributeString("CanGrow",  True)' writer.WriteAttributeString("Keeptogether", True)
          writer.WriteStartElement("Paragraphs")
          writer.WriteStartElement("Paragraph")
          writer.WriteStartElement("TextRuns")
          writer.WriteStartElement("TextRun")
          writer.WriteElementString("Value", fieldName)
          writer.WriteStartElement("Style")
          writer.WriteElementString("TextDecoration", "Underline")
          writer.WriteElementString("PaddingTop", "0in")
          writer.WriteElementString("PaddingLeft", "0in")
          writer.WriteElementString("LineHeight", ".5in")
          ''writer.WriteElementString("Width", "1.5in")''writer.WriteElementString("Value", fieldName)
          writer.WriteEndElement() ' Style
          writer.WriteEndElement() ' TextRun
          writer.WriteEndElement() ' TextRuns
          writer.WriteEndElement() ' Paragraph
          writer.WriteEndElement() ' Paragraphs
          writer.WriteEndElement() ' TexBox
          writer.WriteEndElement() ' CellContents
          writer.WriteEndElement() ' TablixCellNext
      writer.WriteEndElement() ' TablixCells
      writer.WriteEndElement() ' TablixRow'writer.WriteEndElement() ' TablixRows          Do not close Rows tag here colse it after details'End of Headers'Details Rows'writer.WriteStartElement("TablixRows")         Since Rows tag in header is not closed not need to open fresh tag
      writer.WriteStartElement("TablixRow")
      writer.WriteElementString("Height", ".25in")
      writer.WriteStartElement("TablixCells")
      ForEach fieldName In m_fields
          writer.WriteStartElement("TablixCell")
          writer.WriteStartElement("CellContents")
          writer.WriteStartElement("Textbox")
          writer.WriteAttributeString("Name", Nothing, fieldName)
          '  writer.WriteAttributeString("CanGrow", True)'  writer.WriteAttributeString("Keeptogether", True)
          writer.WriteStartElement("Paragraphs")
          writer.WriteStartElement("Paragraph")
          writer.WriteStartElement("TextRuns")
          writer.WriteStartElement("TextRun")
          'writer.WriteElementString("Value", fieldName)
          writer.WriteElementString("Value", "=Fields!" + fieldName + ".Value")
          writer.WriteStartElement("Style")
          writer.WriteElementString("TextDecoration", "Underline")
          writer.WriteElementString("PaddingTop", "0in")
          writer.WriteElementString("PaddingLeft", "0in")
          writer.WriteElementString("LineHeight", ".5in")
          ''writer.WriteElementString("Width", "1.5in")''writer.WriteElementString("Value", fieldName)
          writer.WriteEndElement() ' Style
          writer.WriteEndElement() ' TextRun
          writer.WriteEndElement() ' TextRuns
          writer.WriteEndElement() ' Paragraph
          writer.WriteEndElement() ' Paragraphs
          writer.WriteEndElement() ' TexBox
          writer.WriteEndElement() ' CellContents
          writer.WriteEndElement() ' TablixCellNext
      writer.WriteEndElement() ' TablixCells
      writer.WriteEndElement() ' TablixRow
      writer.WriteEndElement() ' TablixRows'End of Details Rows
      writer.WriteEndElement() ' TablixBody
      writer.WriteStartElement("TablixRowHierarchy")
      writer.WriteStartElement("TablixMembers")
      writer.WriteStartElement("TablixMember")
      ' Group
      writer.WriteElementString("KeepWithGroup", "After")
      writer.WriteEndElement() ' TablixMember' Detail Group
      writer.WriteStartElement("TablixMember")
      writer.WriteStartElement("Group")
      writer.WriteAttributeString("Name", Nothing, "Details")
      writer.WriteEndElement() ' Group
      writer.WriteEndElement() ' TablixMember
      writer.WriteEndElement() ' TablixMembers
      writer.WriteEndElement() ' TablixRowHierarchy
      writer.WriteStartElement("TablixColumnHierarchy")
      writer.WriteStartElement("TablixMembers")
      'writer.WriteStartElement("TablixMember")ForEach fieldName In m_fields
          writer.WriteStartElement("TablixMember")
          writer.WriteEndElement() ' TablixMemberNext' writer.WriteEndElement() ' TablixMember
      writer.WriteEndElement() ' TablixMembers
      writer.WriteEndElement() ' TablixColumnHierarchy
      writer.WriteElementString("DataSetName", "tbdataset")
      writer.WriteEndElement() ' Tablix
      writer.WriteEndElement() ' ReportItems
      writer.WriteEndElement() ' Body
      writer.WriteStartElement("Page")
      ' Page Header Element
      writer.WriteStartElement("PageHeader")
      writer.WriteElementString("Height", "1.40cm")
      writer.WriteStartElement("ReportItems")
      writer.WriteStartElement("Textbox")
      writer.WriteAttributeString("Name", Nothing, "Textbox1")
      writer.WriteStartElement("Paragraphs")
      writer.WriteStartElement("Paragraph")
      writer.WriteStartElement("TextRuns")
      writer.WriteStartElement("TextRun")
      writer.WriteElementString("Value", Nothing, "ABC CHS.")
      writer.WriteEndElement() ' TextRun
      writer.WriteEndElement() ' TextRuns
      writer.WriteEndElement() ' Paragraph
      writer.WriteEndElement() ' Paragraphs
      writer.WriteEndElement() ' TextBox
      writer.WriteEndElement() ' ReportItems
      writer.WriteEndElement() ' PageHeader
      writer.WriteEndElement() ' Page
      writer.WriteEndElement() ' ReportSection
      writer.WriteEndElement() ' ReportSections' DataSources
      writer.WriteStartElement("DataSources")
      writer.WriteStartElement("DataSource")
      writer.WriteAttributeString("Name", Nothing, "tbdata")
      writer.WriteStartElement("DataSourceReference")
      writer.WriteEndElement() ' DataSourceReference
      writer.WriteEndElement() ' DataSource
      writer.WriteEndElement() ' DataSources'DataSet
      writer.WriteStartElement("DataSets")
      writer.WriteStartElement("DataSet")
      writer.WriteAttributeString("Name", Nothing, "tbdataset")
      writer.WriteStartElement("Query")
      writer.WriteElementString("DataSourceName", Nothing, "tbdata")
      'writer.WriteElementString("CommandText", Nothing, "/* Local Query */")
      writer.WriteElementString("CommandText", Nothing, "TableDirect")
      writer.WriteEndElement() ' Query'Fields
      writer.WriteStartElement("Fields")
      ForEach fieldName In m_fields
          writer.WriteStartElement("Field")
          writer.WriteAttributeString("Name", Nothing, fieldName)
          writer.WriteElementString("DataField", fieldName)
          writer.WriteElementString("rd:TypeName", fieldName.GetType.ToString)
          writer.WriteEndElement() ' FieldNext
      writer.WriteEndElement() ' Fields' rd datasetinfo
      writer.WriteEndElement() ' DataSet
      writer.WriteEndElement() ' DataSets
      writer.WriteEndElement() ' Report' Flush the writer and close the stream
      writer.Flush()
      stream.Close()
      'Convert to StreamDim myByteArray AsByte() = System.Text.Encoding.UTF8.GetBytes("D:\MyTestReport2.rdlc")
      Dim ms AsNewMemoryStream(myByteArray)
      'Supply Stream to ReportViewer
      ReportViewer1.LocalReport.LoadReportDefinition(ms)
      ReportViewer1.LocalReport.Refresh()When I open rdlc in designer I get following error"Data at the root level is invalid."When I run the aspx I get following error
    An error occurred during local report processing.
    The definition of the report '' is invalid.
    The definition of this report is not valid or supported by this version of Reporting Services.
    The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas.
    Details: Data at the root level is invalid. Line 1, position 1.
    Can anybody guide me?

    Hi Wendy Fu,
    Thanks for your feed back. I could see Microsoft.ReportViewer.ProcessingObjectModel.dll to add as reference to my project. Actually I can open generated rdlc in designer, at run time I get error. I could not make out where is the exact mistake out of three
    options flashed.
    The definition of this report is not valid or supported by this version of Reporting Services.
    The report definition may have been created with a later version of Reporting Services
    or contain content that is not well-formed or not valid based on Reporting Services schemas
    Details: Data at the root level is invalid
    My web config has following references
    <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
    <add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
    May be I have to change these versions to 9 or 10.
    First I will try adding Microsoft.ReportViewer.ProcessingObjectModel.dll .
    Once thanks for your reply.
    Races

  • The extension does not contain a valid signature

    hey guys, newbie on deck!
    So, after installing CS6 I ran the Adobe Update Manger. During the update the Adobe Extension Manager (AEM) fired off and began updating as well. One error I saw was:
    The extension 'Adobe_Flash_Professional_Toolkit_for_CreateJS' does not contain a valid signature. The extension will not be installed.
    I'm not sure what this is or what it does but I would like to:
    Understand the Adobe ecosystem and
    Clear any problems.
    Here's what I do know:
    The Mac I have is 2 days old and probably in the best shape of its life.
    I installed CS6 fresh from a DVD.
    Ran the Adobe Update Manager the next day (today).
    I don't intend to use Flash.
    If anyone can expain common causes for this behavior and a fix I would greatly appreciate it.
    Thanks in advance,
    TT

    Hi JesusPresley,
    The root cause is the updater updated Adobe Flash, which tried to install the extension above by Extension Manager in the installation. However, this extension was NOT signed with the updated Adobe certificate, so the extension installation will be rejected by Extension Manager. That is what you got. We have sent this issue to Flash team.
    If you don't use Flash, you can manually edit C:\Program Files\Adobe\Adobe Flash CS6\XManConfig.xml, and remove the line <Data key="SupportedInSuite">CS6</Data>. Thanks.
    Xiaoyi

  • Appstudio exporter does not contain a valid signature

    HI I am trying to install AppStudio plugin to work with InDesign but Extension Manager is throwing the following error...
    appstudio exporter does not contain a valid signature !
    I have updated all software.
    (I am downloading new apps in the background)
    I have a CC subscription

    Hi,
    please click "tools"->"preferences", unselect "Allow Extension Manager to access Internet" option, and then try to install it again.

Maybe you are looking for