Prefix SOAP XML Instead direct namespace

折月煮酒 提交于 2019-11-29 11:08:47

I fixed proxy class generated by SVC Util. I added a new property that emit the prefix. For example in class SignonRq, I added the following property. That serialized the XML with prefix acd

        [XmlNamespaceDeclarations()]
    public XmlSerializerNamespaces xmlsn
    {
        get
        {
            XmlSerializerNamespaces xsn = new XmlSerializerNamespaces();
            xsn.Add("acd", "http://www.ACORD.org/standards/PC_Surety/ACORD1/xml/");
            return xsn;
        }
        set
        {
            //Just provide an empty setter. 
        }
    }

For example class ACORD, I added the following property. That serialized the XML with prefix stc1.

        [XmlNamespaceDeclarations()]
    public XmlSerializerNamespaces xmlsn
    {
        get
        {
            XmlSerializerNamespaces xsn = new XmlSerializerNamespaces();
            xsn.Add("stc1", "http://schemas.WebServiceProvider.com/us/ileads/types/Servicing");
            return xsn;
        }
        set
        {
            //Just provide an empty setter. 
        }
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!