SOAP Client in C# without access to a WSDL-file

前端 未结 4 1783
北荒
北荒 2021-02-02 17:17

I\'m working with a third party to integrate some of our systems with theirs and they provide us with a SOAP interface to make certain requests and changes in their connected sy

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-02 17:49

    If you write a class that derives from System.Web.Services.Protocols.SoapHttpClientProtocol (and has the correct attributes, e.g., WebServiceBinding, SoapDocumentMethod, etc. applied to it and its methods), you can fairly easily call SOAP methods without needing the WSDL file.

    The easiest way to do this would probably be to write your own ASP.NET web service that replicates the third party's SOAP API, generate a proxy class from it, then manually edit the file to ensure that the URL, namespaces, method names, parameter types, etc. are correct for the third-party API you want to call.

提交回复
热议问题