小编Jua*_*nez的帖子

如何在.NET/ASMX中更改WebService的响应标记名称?

我有以下代码:

namespace WebService1
{
    [System.Web.Services.WebService(Namespace = "mynamespace", 
                Name = "ControlModuleService")]
    [System.ComponentModel.ToolboxItem(false)]
    [System.Web.Services.WebServiceBindingAttribute(Name = "ControlModulePort"),
    SoapDocumentService(SoapBindingUse.Literal,SoapParameterStyle.Bare)]

    public class Service1 : CommandCenter
    {

        [WebMethod, SoapDocumentMethod(
        ResponseElementName = "setConfigurationResponse")]
        public setConfigurationResponse setConfiguration(setConfigurationRequest request) 
        {

            return new setConfigurationResponse();
        }
}
Run Code Online (Sandbox Code Playgroud)

类型:

[System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.MessageContractAttribute(WrapperName = "setConfigurationResponse", WrapperNamespace = "mynamespace", IsWrapped = false)]
    public partial class setConfigurationResponse
    {

        [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "mynamespace", Order = 0)]
        [System.Xml.Serialization.XmlElementAttribute("return", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public transaction[] @return;

        public setConfigurationResponse()
        {
        }

        public setConfigurationResponse(transaction[] @return)
        {
            this.@return = @return;
        }
    } …
Run Code Online (Sandbox Code Playgroud)

.net c# web-services

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

.net ×1

c# ×1

web-services ×1