How to call a web service with no wsdl in .net

后端 未结 5 574
旧巷少年郎
旧巷少年郎 2020-12-08 04:53

I have to connect to a third party web service that provides no wsdl nor asmx. The url of the service is just http://server/service.soap

I have read this article ab

5条回答
  •  难免孤独
    2020-12-08 05:29

    Hmm, tricky one here but not impossible but I'll do my best to explian it.

    What you'll need to do is

    1. Create serializable classes that match the object schemas you're dealing with on the third party service.
    2. Find out if they use any SOAPAction in their service calls
    3. See if you can create an asmx which mimics their service in terms of being able to handle requests and responses (this will be good for testing your client app if their service is down)
    4. You can then create a service proxy from your dummy service and change the service url when calling the third party service.
    5. If something doesnt work in your client, then you can tweak your dummy service, re-generate the proxy and try again.

    I will try to add more as and when I think of it but that should be enough to get you started.

提交回复
热议问题