What you are trying to do seems painful to do now and it hurts to keep moving forward if something changes on the server. He really invents the wheel.
If you have not thought about this, I would:
(a) Examine whether you can use the metadata that you have for this service and use the proxy generator for the target destination form. There are not many platforms that do not have at least some tools that can help you in part, if not all. Perhaps repeat the question aimed at the Ruby user asking what structures exist for using the HTTPS service given its WSDL?
(b) Otherwise, if your script allows this, I would consider using a proxy server written in C #, which acts as a facade for a service that translates it into something simpler (for example, you can use something- something like ASP.NET MVC WebAPI, which is flexible and can easily serve answers that are compliant with standards by which you can maintain full control).
I suspect that one of them may be simpler and more valuable than the one you are currently on.
source share