Dynamically create XSN - InfoPath Dev
in

InfoPath Dev

Dynamically create XSN

Last post 10-13-2006 12:29 AM by ivl. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-12-2006 12:15 AM

    • ivl
    • Not Ranked
    • Joined on 08-25-2006
    • Posts 12

    Dynamically create XSN

    Hi there,

    I need to create a xsn programmatically, on demand, from a Web App. So far, I have downloaded source for programmatically creating a CAB file (CabLib) and have sucessfully created my own xsn using the file system, but I would like to use Isolated Storage for the generation of the xsn. I have no idea how I would get CabLib to use Isolated Storage since it does not use the .NET framework to write the CAB to the file system (or so it seems).

    Does anybody have a better way of programmatically generating a full xsn? Or a more .NET "friendly" way of programmatically creating CAB files?

    Thanks
  • 10-12-2006 08:07 PM In reply to

    Hey ivl,

    We were actually trying to do something similiar to this recently. In our situation we were trying to uncab an XSN that had been made the legitimate way, doctor some values, and then recab it. In our situation we were trying to use Memory Mapping, but after reading about this Isolated Storage it seems like it would have fit our scenario also. The reason we wanted to do this in memory was then it would not require Full Trust on the form.

    However, I came to the conclusion that this was not possible. The reason I came to this conclusion is because the CabSdk provided by Microsoft has last been updated on March 20, 1997 so it is quite old. It still uses unmanaged code and the only method it provides for uncabbing a cabinet file takes a local filepath parameter (whereas it should take a Stream argument). Due to this descrepancy between unmanaged and managed code you cannot use MS's CabSdk to do what you are trying to do. The only way I can think of doing this would be to implement all of the decompression and compression algorithms from scratch (on a byte-by-byte basis), and create your own managed library that would handle the cabinet files. This, however, seemed like much too great of a task for what we were trying to accomplish and we are currently looking for a workaround.

    I'll keep you posted and hope you do the same. This is a very interesting problem.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 10-13-2006 12:29 AM In reply to

    • ivl
    • Not Ranked
    • Joined on 08-25-2006
    • Posts 12
    Hi Matt,

    Thanks for the kind reply.

    While doing research on how I could solve this, I came across the following article:

    http://www.angrycoder.com/article.aspx?cid=5&y=2001&m=3&d=23

    The class mentioned in the article has been removed however and so that was pretty much a dead end for me.

    I am going to bookmark this thread just in case, but I think both of us have come to the same conclusion. It would seem that the only solution to this problem is to create our own CAB compression / decompression managed code library which is compatible with memory streams and isolated storage. I guess if there was an easier way to do this, one of us would have come across the solution by now.

    I'm not sure whether the effort put in to implement the CAB codec algorithms will be worth the end result, but I will keep this in mind.

    There is another question that I thought of. Say for arguments sake that we do get to the point where we successfully create the XSNs using Isolated Storage or Streams. How can we then sign the form or embed a certificate into the CAB in the same way as InfoPath does? Another algorithm will be required for this and it may or may not be proprietary (I haven't checked at all).

    I'll keep you posted if I find anything.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.