Consuming Web Service from C++/CLI
is it poss开发者_开发问答ible to consume web service (written in c#, ... I don't have control over it, just URL to it's .asmx) from C++/CLI? There is no 'add web reference' in C++/CLI project :(
Yes. if you want to do it simply just create a proxy dll in C# (add web reference) and then consume those assemblies, or you can hand code the proxy in C++/CLI.
Edit to reflect comment.
You can use ILMerge to merge multiple assemblies into one if need be.
ILMerge takes a set of input assemblies and merges them into one target assembly.
M$ removes "add web references.." and similars older useful features for c++ projects (nice!!! very nice Mr. Bill ;) ) You still can to use wsdl /language:cpp that generate a .h file with all the proxy contract services, next, you should add the . generated .h file to project. See the .h file, find the desired web method to use and get an instance from the desired class using gcnew
精彩评论