>source

이 질문이 이전에 요청 된 적이 있다는 것을 알고 있지만 어디에도 내 대답을 찾을 수 없습니다.

문제는 asmx 파일에 아래 code가 있다는 것입니다.

namespace IrancellSmsServer
{
    [SoapDocumentService(RoutingStyle= SoapServiceRoutingStyle.RequestElement)]
    [WebService(Namespace=   "http://www.csapi.org/schema/parlayx/data/sync/v1_0/local")]
    [WebServiceBinding(ConformsTo= WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    public class SoapServer : System.Web.Services.WebService
    {
        [WebMethod]
        public syncOrderRelationResponse syncOrderRelation(
            Sync.UserID userID,
            string spID,
            string productID,
            string serviceID,
            string serviceList,
            int updateType,
            string updateTime,
            string updateDesc,
            string effectiveTime,
            string expiryTime,
            item[] extensionInfo
            )
        {
            syncOrderRelationResponse a= new syncOrderRelationResponse();
            a.result= 0;
            a.resultDescription= "OK";
            return a;
        }
     }
}

결과는 다음과 같습니다.

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  <soap:Body>    <syncOrderRelationResponse xmlns="http://www.csapi.org/schema/parlayx/data/sync/v1_0/local">      <syncOrderRelationResult>   //dont want this
        <result>0</result>        <resultDescription>OK</resultDescription>      </syncOrderRelationResult>  //dont want this
    </syncOrderRelationResponse>  </soap:Body></soap:Envelope

문제는 내가 그 여분을 원하지 않는다는 것< syncOrderRelationResult >.net이 자동으로 생성 한 태그입니다. 완전히 제거하고 싶습니다. 나는 [SoapDocumentMethod (ParameterStyle= SoapParameterStyle.Bare)]를 시도했다

하지만 하나의 매개 변수가 있어야한다는 것은 운이 없습니다. 내가 할 수있는 방법이 있습니까?

예상 결과 :

<?xml version="1.0" encoding="utf-8"?>    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">      <soap:Body>        <syncOrderRelationResponse xmlns="http://www.csapi.org/schema/parlayx/data/sync/v1_0/local">            <result>0</result>            <resultDescription>OK</resultDescription>        </syncOrderRelationResponse>      </soap:Body>    </soap:Envelope

다음은 syncOrderRelationResponse의 code입니다.

namespace IrancellSmsServer.Sync {
    using System;
    using System.Web.Services;
    using System.Diagnostics;
    using System.Web.Services.Protocols;
    using System.Xml.Serialization;
    using System.ComponentModel;
    ///<remarks/>    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="DataSyncBinding", Namespace="http://www.csapi.org/wsdl/parlayx/data/sync/v1_0/service")]
    public partial class DataSyncService : System.Web.Services.Protocols.SoapHttpClientProtocol {
        private bool useDefaultCredentialsSetExplicitly;
        ///<remarks/>        public DataSyncService() {
            this.Url= global::IrancellSmsServer.Properties.Settings.Default.IrancellSmsServer_Sync_DataSyncService;
            if ((this.IsLocalFileSystemWebService(this.Url)== true)) {
                this.UseDefaultCredentials= true;
                this.useDefaultCredentialsSetExplicitly= false;
            }
            else {
                this.useDefaultCredentialsSetExplicitly= true;
            }
        }
        public new string Url {
            get {
                return base.Url;
            }
            set {
                if ((((this.IsLocalFileSystemWebService(base.Url)== true)
                            &amp;
&amp;
 (this.useDefaultCredentialsSetExplicitly== false))
                            &amp;
&amp;
 (this.IsLocalFileSystemWebService(value)== false))) {
                    base.UseDefaultCredentials= false;
                }
                base.Url= value;
            }
        }
        public new bool UseDefaultCredentials {
            get {
                return base.UseDefaultCredentials;
            }
            set {
                base.UseDefaultCredentials= value;
                this.useDefaultCredentialsSetExplicitly= true;
            }
        }
        ///<remarks/>        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
        [return: System.Xml.Serialization.XmlElementAttribute("syncOrderRelationResponse", Namespace="http://www.csapi.org/schema/parlayx/data/sync/v1_0/local")]
        public syncOrderRelationResponse syncOrderRelation([System.Xml.Serialization.XmlElementAttribute("syncOrderRelation", Namespace="http://www.csapi.org/schema/parlayx/data/sync/v1_0/local")] syncOrderRelation syncOrderRelation1) {
            object[] results= this.Invoke("syncOrderRelation", new object[] {
                        syncOrderRelation1});
            return ((syncOrderRelationResponse)(results[0]));
        }
        ///<remarks/>        public void syncOrderRelationAsync(syncOrderRelation syncOrderRelation1, object userState) {
            if ((this.syncOrderRelationOperationCompleted== null)) {
                this.syncOrderRelationOperationCompleted= new System.Threading.SendOrPostCallback(this.OnsyncOrderRelationOperationCompleted);
            }
            this.InvokeAsync("syncOrderRelation", new object[] {
                        syncOrderRelation1}, this.syncOrderRelationOperationCompleted, userState);
        }
    }
    ///<remarks/>    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1055.0")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csapi.org/schema/parlayx/data/sync/v1_0/local")]
    public partial class syncOrderRelationResponse {
        private int resultField;
        private string resultDescriptionField;
        //private item[] extensionInfoField;
        ///<remarks/>        public int result {
            get {
                return this.resultField;
            }
            set {
                this.resultField= value;
            }
        }
        ///<remarks/>        public string resultDescription {
            get {
                return this.resultDescriptionField;
            }
            set {
                this.resultDescriptionField= value;
            }
        }
        ///<remarks/>        //[System.Xml.Serialization.XmlArrayItemAttribute("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
        //public item[] extensionInfo {
        //get {
        //return this.extensionInfoField;
        //}
        //set {
        //this.extensionInfoField= value;
        //}
        //}
    }
        ///<remarks/>        public syncOrderRelationResponse Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((syncOrderRelationResponse)(this.results[0]));
            }
        }
    }
    }
}

왜 원하지 않습니까? 그것이 당신을 일으키는 어떤 문제

Viru2021-03-06 12:30:26

syncOrderRelationResponse code도 도움이 될 수 있습니다.

Viru2021-03-06 12:30:26

내 의뢰인이 그것을 원하기 때문에 Viru.

Rasool Khalifeh2021-03-06 12:30:26

syncOrderRelationResponse의 포스트 code

Viru2021-03-06 12:30:26

@Viru code를 추가했습니다.

Rasool Khalifeh2021-03-06 12:30:26
  • 이전 vue.js : Nuxt.js 용 SSR 호환 구성 요소 라이브러리
  • 다음 GitHub에서 자신의 저장소를 어떻게 포크합니까?