Geeks With Blogs
Amusingly MOSS ...It's funny how difficult some stuff is when it really shouldn't be

When trying to generate an ASP.NET proxy class from a physical wsdl on your local file system, you're probably doing something like this:

wsdl.exe MySevice.wsdl /o:Proxy.cs /l:CS

You'd expect a file named Proxy.cs to get created in C# for you.  You'd be right, except if you're attempting to generate proxy for a service that uses complex types.  If that is the case, you'll get an error that looks a lot like this:

Error: Unable to import binding 'MyBinding' from namespace 'http://www.example.org/MyNameSpace/'.
  - Unable to import operation 'MyOperation'.
  - The element 'http://mydomain.com:MyComplexType' is missing.

If you would like more help, please type "wsdl /?".

This error is basically saying that you your service is expecting one or more XSD file containing the definitions for those complex types.  Here's what your command line should look like:

wsdl.exe MySevice.wsdl MyServiceDefinitions.xsd /o:Proxy.cs /l:CS

If you need to add additional XSD files for other complex type definitions, just add them to the command line like you did for the first one, separated by a space (order doesn't matter).

Posted on Friday, October 16, 2009 5:53 AM Systems Architecture and Design | Back to top


Comments on this post: wsdl.exe - Unable to import binding from namespace

# re: wsdl.exe - Unable to import binding from namespace
Requesting Gravatar...
this may help
http://support.microsoft.com/kb/820122
Left by vani on Feb 07, 2010 7:16 PM

# re: wsdl.exe - Unable to import binding from namespace
Requesting Gravatar...
This should be SPECIFICALLY stated in the documentation for the command so we don't have to waste time Binging for it.

Same issue for XSD.exe.
Left by Glenn Beck on Aug 19, 2010 2:47 AM

# re: wsdl.exe - Unable to import binding from namespace
Requesting Gravatar...
finally an answer to my problem. THANKS
Left by Ben on Jan 06, 2011 5:38 PM

# re: wsdl.exe - Unable to import binding from namespace
Requesting Gravatar...
Fantastic. I've been looking for this for a good few hours.
Left by Edward on Mar 09, 2011 1:33 AM

# re: wsdl.exe - Unable to import binding from namespace
Requesting Gravatar...
doesnt work, same error
Left by dw on Nov 20, 2011 10:00 PM

# re: wsdl.exe - Unable to import binding from namespace
Requesting Gravatar...
This svaed my time.. thanks a lot
Left by Joseph on Jun 13, 2013 8:14 AM

Your comment:
 (will show your gravatar)


Copyright © Adam McKee | Powered by: GeeksWithBlogs.net