저는 .NET 세계에 익숙하지 않지만 SOAP Xml 방식으로 웹 서비스의 데이터를 요청하는 클라이언트를 생성하기 위해 VStudio C# 2010 (.NET 4.0)을 사용해야합니다. 나는 여기에 대한 답변을 검색했지만 더 혼란스러워. MSDN은 "Building XML Web Service Clients"는 .NET 4.0의 유산이며 WSDL은 유산이라고합니다. 대신에 "WCF"를 사용하십시오. WCF에서 나는 너무 많고 너무 모호했습니다. 그때 더 간단해야합니다 ... 그리고 내가 웹에서 찾을 수있는 모든 예제 - 그들은 모두 WSDL, "유산"을 사용합니다.SOAP xml 클라이언트 - Visual Studio 2010 C# 사용 - 어떻게?
여기 내가 웹 서비스에서 데이터를 얻기 위해 사용해야하는 서비스의 정의입니다 :
요청 :
POST /catalog.asmx HTTP/1.1
Host: www.somewebsite.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://www.somewebsite.com/KeywordSearch"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<KeywordSearch xmlns="https://www.somewebsite.com/">
<searchTerm>string</searchTerm>
<resultsReturned>int</resultsReturned>
</KeywordSearch>
</soap:Body>
</soap:Envelope>
응답 :
그래서HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
...some stuff...
</soap:Body>
</soap:Envelope>
, 이 단순한 클라이언트를 구축하는 데 가장 적합한 방법은 무엇입니까? 어떤 도구/라이브러리/방법론을 초보자에게 제안 하시겠습니까? (VS 2010 C#, .NET 4.0 환경을 가정 할 때)?
참고로, 무슨 일이 "유산"만드는 것 ASMX 웹 서비스 "웹 참조 추가"를 사용하십시오. marc_s가 암시 하듯이 "Add Service Reference"를 사용해야합니다. –