2010-11-29 3 views
0

웹 서비스를 호출하는 메서드가 있습니다. 이 웹 서비스를 호출 할 때, 다음과 같은 메소드가 호출됩니다 :C# + XML Serialization

<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> 
    <!-- XML --!> 
    </soap:Body> 
</soap:Envelope> 

어떻게이 <soap:>를 제거합니까 :이 메소드가 호출 될 때

[System.Web.Services.Protocols.SoapDocumentMethodAttribute(
    "http://mydomain.com/services/DoSomething", 
    RequestNamespace = "http://mydomain.com/services", 
    ResponseNamespace = "http://mydomain.com/services", 
    Use = System.Web.Services.Description.SoapBindingUse.Literal, 
    ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] 
[return: System.Xml.Serialization.XmlElementAttribute("MyResponse")] 

public MyResponse DoSomethingr(MyRequest myRequest) 
{ 
    object[] results = this.Invoke("DoSomething", new object[] { myRequest}); 
    return ((MyResponse)(results[0])); 
} 

, 나는 XML은 다음이 포함되어 것으로 나타났습니다 내 XML 래퍼?

+2

왜 XML 네임 스페이스 접두사를 제거 하시겠습니까 ?? 이들은 웹 서비스를 호출하는 데 사용되는 SOAP 표준의 일부입니다. 그렇지 않으면 SOAP 호출이 더 이상 작동하지 않을 수 있습니다. –

+0

래퍼를 원하지 않으면 SoapDocumentMethodAttribute를 사용하지 마십시오. –

+0

''을 제거하면 SOAP가 사용되지 않습니다. 비누 웹 서비스를 원하지 않는다면 다른 .NET 프로그래밍 모델 인 WCF를 사용하는 것이 더 좋습니다. – Cheeso

답변

3

나는 그렇지 않습니다. 비누는 서비스를 게시하고 원격 데이터에 액세스하기위한 표준 프로토콜입니다. 원격 서버가 없으면 사용자의 요청을 이해할 수 없습니다.