1

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.

4
  • WSDL.exe is a .NET assembly, have you tried taking it into Reflector or ILSpy to figure out how it does its magic? Commented Dec 19, 2011 at 18:50
  • 1
    @M.Babcock Maybe .NET Framework have own class for this purpose and diassembly wsdl.exe is not needed. Commented Dec 19, 2011 at 19:31
  • Maybe, but if google hasn't told you yet and you can't figure it out then wsdl.exe would be a good place to start... Commented Dec 19, 2011 at 20:07
  • 1
    wsdl.exe would not be a good place to start. It is based on the legacy ASMX technology and should not be used for new development. WCF and svcutil.exe should be used instead. Commented Dec 23, 2011 at 14:51

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

-1: this will generate proxy code based on a legacy technology which should not be used for new development.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.