,我有以下MessageContracts作为请求使用:WCF MessageContract名单系列化
<MessageContract(WrapperName:="get")> _
Public Class GetRequest
Inherits BaseAuthenticatedRequest
Protected _typeName As cEnum.eType
Protected _id As Integer
<MessageBodyMember()> _
Public Property TypeName() As cEnum.eType
...
<MessageBodyMember()> _
Public Property Id() As Integer
...
End Class
<MessageContract(WrapperName:="getLimited")> _
Public Class GetLimitedRequest
Inherits GetRequest
Protected _propertyList As List(Of String)
<MessageBodyMember(Namespace:=Api2Information.Namespace)> _
Public Property PropertyList() As List(Of String)
...
End Class
不过了SoapUI测试时,正在创建getLimited请求体为:
<v2:getLimited>
<!--Optional:-->
<v2:Id>?</v2:Id>
<!--Optional:-->
<v2:PropertyList>
<!--Zero or more repetitions:-->
<arr:string>?</arr:string>
</v2:PropertyList>
<!--Optional:-->
<v2:TypeName>?</v2:TypeName>
</v2:getLimited>
其中v2
= Api2Information.Namespace。我真正想要的是,PropertyList中包含的字符串命名空间为v2
,而不是arr
。无论如何对我来说实现这一目标?我正在将ASMX服务转换为使用WCF,并且我们有一些应用程序,我们无法负担必须重新编译和重新分配。
感谢您的帮助!
'Api2Information.Namespace'是在用我的服务方法也可以在命名空间下获取所有内容。给“PropertyList”添加一个名称空间并没有改变任何东西,这只是我试图让字符串正确地被命名空间。 – 2010-10-29 13:27:37