The feasible and easy way to consume the third party API call - is to - generate the cs class files from the XSD/WSDL and use some kind of mapping logic at your server side to map the generated objects back to your domain model objects.
You have the XSD, WSDL - if you are using webservices/basicHttpBinding of WCF. You also have svcUtil tool for other WCF bindings.
As you are using XML attributes - probably XSD and WSDL tools are more useful.
If you have other reasons to go with custom mappings instead of using these tools, that is fine. Otherwise, I would suggest to go with the in-built tools to make it more easier.
The following command creates a client proxy class in the C# language for an XML Web service located at the specified URL. The tool saves the client proxy class in the file
myProxyClass.cs.
Star
9052 Points
2255 Posts
Re: Multiple Element Name
Sep 23, 2015 03:57 PM|Siva Krishna Macha|LINK
Hi Eric,
The feasible and easy way to consume the third party API call - is to - generate the cs class files from the XSD/WSDL and use some kind of mapping logic at your server side to map the generated objects back to your domain model objects.
You have the XSD, WSDL - if you are using webservices/basicHttpBinding of WCF. You also have svcUtil tool for other WCF bindings.
As you are using XML attributes - probably XSD and WSDL tools are more useful.
If you have other reasons to go with custom mappings instead of using these tools, that is fine. Otherwise, I would suggest to go with the in-built tools to make it more easier.
See this example for XSD.exe tool usage:
If you just want classes:
Reference: http://www.overpie.com/aspnet/articles/generate-class-file-from-xsd-using-visual-studio-command-prompt - A good step by step article!
MSDN Reference of the tool usage: https://msdn.microsoft.com/en-us/library/x6c1kb0s%28v=vs.110%29.aspx
The following command creates a client proxy class in the C# language for an XML Web service located at the specified URL. The tool saves the client proxy class in the file myProxyClass.cs.
Reference: https://msdn.microsoft.com/en-us/library/7h3ystb6%28VS.80%29.aspx
Thanks & Regards,
Siva