来自使用 xml.exe 生成的类实例的 XmlDocument
从 Web 服务等获取的数据中获取签名 xml(作为字符串)的最佳方法是什么? 我对该 XML 文档有相当复杂的架构,并且想使用 xsd.exe 生成类,用数据实例化它,然后使用 SignedXml 对其进行签名,但我不知道如何从架构创建的类的实例中获取 XmlDocument 。 (SignedXml 只读取 XmlDocument)。
我对此不确定,但我不明白该架构还包含一些有关签名的信息,如果可能的话,如果 SignedXml 可以直接从架构(即通过 xsd.exe 生成的类)读取该信息,那就太好了
What is the best way to get signed xml (as string) from data got from, for example, webservice?
I have pretty complex schema for that XML-document and would like to generate class with xsd.exe, instantiate it with data and then sign it with SignedXml, but I can't figure out how to get XmlDocument from instance of class created from schema. (SignedXml only reads XmlDocument).
I'm not sure about this, but I've undestood that schema also includes some information about signing, and if it's possible, it would be nice if SignedXml could directly read that from schema, i.e., through that class generated with xsd.exe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要从 xsd.exe 生成的类的实例中获取 xml 文档,请使用 XmlSerializer.Serialize()。
至于你问题中的“签名”部分,我认为你需要进一步澄清。
To get an xml document from an instance of a class generated by xsd.exe use XmlSerializer.Serialize().
As for the "signed" part of your question, I think you need clarify further.