0

I have to use WSDL file to create proxy class. For this purpose, I have created one simple service and got the WSDL for the same, and saved into my disk by using Save as... in Internet Explorer. (I hope I'm doing right here).

With the above procedure, I got WSDL file.

If I use the following command:

D:\Ashok>wsdl CalculatorService.wsdl

I am getting some error like shown below:

Error: Unable to import binding 'BasicHttpBinding_ICalculatorService' from names pace 'http://tempuri.org/'. - Unable to import operation 'Add'. - The element 'http://tempuri.org/:Add' is missing.

I have googled for the same and understood that I need to do some configuration settings, but I couldn't understand what exactly I need to do.

Can anybody please suggest me!

Ashok kumar
  • 1,593
  • 4
  • 33
  • 68
  • possible duplicate of [wsdl.exe Error: Unable to import binding '...' from namespace '...'](http://stackoverflow.com/questions/77534/wsdl-exe-error-unable-to-import-binding-from-namespace) – CodeCaster Aug 06 '13 at 07:47

2 Answers2

1

Add a Service Reference and point it at the WSDL

edit As you cant use add Service Reference... http://support.microsoft.com/kb/820122 end edit

Chris
  • 2,471
  • 25
  • 36
  • Hi Chirs, thanks for your reply. I want to use the "wsdl" command to generate proxy class. Due to some constraints I should not use "Add Service Reference" – Ashok kumar Aug 06 '13 at 05:50
  • If you have constraints, then you should tell us what they are. In general, `wsdl.exe` is a bad idea. – John Saunders Aug 08 '13 at 18:52
1

If you look closely at the WSDL see how it has something like this inside it:

<s:import schemaLocation="http://..." />

This means that this WSDL is not a standalone file but it depends on some other files (this is how WCF decided to expose the WSDL). So either save all other files on disk (and change the schemaLocation to reflect their current location) which is hard since you need to do it many times. Or get a flat version of the wsdl. Or use "add service reference" in VS.

Community
  • 1
  • 1
Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158