SvcUtil generates “Order” Named Parameter for xsd:all complexcontent

試著忘記壹切 提交于 2019-12-04 13:40:14

There's no way that I know of to suppress the "Order" attribute with svcutil, so we've written a Powershell script that strips it out. It's dirty, but it works and we don't have to worry about manually stripping it out when we regenerate.

We use a powershell script to generate our proxy classes which strips out the "Order" attributes:

svcutil /serializer:XmlSerializer '..\.\Schema\MyService.wsdl' '/n:*,MyService.GeneratedCode'  '/o:MyServiceProxy.cs'  '/nologo' 


(Get-Content .\o:MyServiceProxy.cs) | 
Foreach-Object {
$_ -replace ", ReplyAction=`"\*`"", "" `
       -replace ", Order=.", "" `
       -replace "Order=.", ""
} | 
Set-Content .\o:MyServiceProxy.cs

You can also try this : http://wscfblue.codeplex.com

Works pretty well for me

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!