简体   繁体   中英

Generate proxy object based on wsdl file dynamically in code

Hi it is possible generate proxy object from wsdl file in code dynamically?

I know that I can use tool wsdl.exe but I would like have a option download wsdl based on URL and in code generate proxy object.

Client is in C#, web service is in Java.

Wsdl.exe uses the framework classes from System.Xml and System.Web.Services to does its magic. However, those classes are obscure and quite difficult to find using a Google search, unless you specifically know the class names themselves.

A good idea is to look at Mono's wsdl.exe source code: http://c-cpp.r3dcode.com/files/mono/2/10.2/mcs/tools/wsdl/MonoWSDL2.cs

This will get you as far as generating the stub code.

Edit: John thinks that asmx is legacy, and svcutil is the way to go. If you ask me, SOAP itself is legacy and REST is the way to go. But since the question is about SOAP and svcutil is supposedly a better technology, here's how svcutil works:

http://c-cpp.r3dcode.com/files/mono/2/10.2/mcs/tools/svcutil/Driver.cs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM