使用spring.net发布webservice时函数重名的问题的解决办法
Posted on 2013-02-07 13:22:00
使用spring.net发布webservice时函数重名的问题的解决办法
多态导致函数重名
解决办法:
<entry key="AddTextimageDraft(string,Model.Entities.TextimageDraft,System.IO.Stream)">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="添加待审核的资讯草稿" />
<property name="MessageName" value="AddTextimageDraft" />
</object>
</entry>
<entry key="AddTextimageDraft(string,Model.Entities.TextimageDraft,System.IO.Stream,System.IO.Stream)">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="添加待审核的资讯草稿" />
<property name="MessageName" value="AddTextimageDraftWithIcon" />
</object>
</entry>
在配置文件中声明函数的时候把类型也声明出来.
但是这样还是会报错:
Web 服务不符合WS-I Basic Profile v1.1
这个WS-I Basic Profile v1.1 是webservice 标准组织的一套规范
这个时候就要在具体的类前面加上特性:
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
附: 使用IIS7 以上版本的话,在部署的时候,要使用经典管道模式,并且 在脚本映射里 把*.asmx映射到aspnet_isapi.dll