Prefix SOAP XML Instead direct namespace

后端 未结 1 1798
借酒劲吻你
借酒劲吻你 2020-12-19 16:09

I am working with one of our partner to integrate our business services. I am using WCF (.Net 3.5) to communicate with partner web service. I think partner web service is wr

相关标签:
1条回答
  • 2020-12-19 16:22

    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. 
            }
        }
    
    0 讨论(0)
提交回复
热议问题