English 中文(简体)
如何获得正确的名称空间产出
原标题:How to get the right namespace output

我有一个可以实施九舍五入的班子。 当我使用一种习俗XmlWriter/XmlReader时,它只是做的是罚款和产出。 然而,当我使用这一工具时,我获得了非常干净的产出,由于它没有包含任何类型的信息,因此该产出太清洁:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <GetModelCResponse xmlns="http://tempuri.org/">
            <GetModelCResult>
                <D xmlns="">D</D>
                <E xmlns="">
                    <B>B</B>
                    <A>A</A>
                </E>
            </GetModelCResult>
        </GetModelCResponse>
    </s:Body>
</s:Envelope>

然而,我期望这样一些东西(它用XmlWriter书写):

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <GetModelCResponse xmlns="http://tempuri.org/">
            <GetModelCResult xmlns:a="http://schemas.datacontract.org/2004/07/Model" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                <a:D>D</a:D>
                <a:E i:type="a:ModelA">
                    <a:A>A</a:A>
                    <a:B>B</a:B>
                </a:E>
            </GetModelCResult>
        </GetModelCResponse>
    </s:Body>
</s:Envelope>

我做了什么错误? 它是一个组合问题吗?

最佳回答

You can change the serializer that wcf uses.

实现这一目的的一个途径是与我们脱节。

[XmlSerializerFormat]

归属于您的服务执行。

如果你需要另外几条警钟和告示,你可以考虑一个序列器。

Dan Rigsby撰写了一篇有关这一专题的文章,内容是:其博客。 在该条款的接近尾声中,他放弃了创建“IOperationBehavior”号行动的实施。

这一概念足够简单,会产生一种操作行为,用一种习俗取代正常的序列器。 只要这一类人继承阿特曼,你就可以利用它来贬低执行。

问题回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签