Remove xml namespaces from WCF restful response

前端 未结 9 1663
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-05 11:13

I am using WCF to return a plain old XML (POX) document to the caller. I am using the XML Serializer formatter to turn the objects into XML.

In the returned docum

9条回答
  •  既然无缘
    2020-12-05 11:34

    I assume you are trying instead of getting something like this at the beginning of your xml:

    
    

    You want just:

    
    

    Sadly, I haven't seen an easy way yet to remove those fields. I was googling for solutions and most of the options for removing it require creating your own Message inspector, or your own encoder.

提交回复
热议问题