rgatiganti
asked on
Visual Studio 2008 not able to generate code for WSDL Web Reference
Hi,
I am using WSDL file to create the web reference URL. I could add the web reference URL to my project in visual studio. But I am not able to use the web service as the automatic code is not generated.
I am getting the following warning message:
Custom tool warning: DiscoCodeGenerator unable to initialize code generator. No code generated.
It would be great if someone can help me to solve this issue.
Thank you,
Divya.
I am using WSDL file to create the web reference URL. I could add the web reference URL to my project in visual studio. But I am not able to use the web service as the automatic code is not generated.
I am getting the following warning message:
Custom tool warning: DiscoCodeGenerator unable to initialize code generator. No code generated.
It would be great if someone can help me to solve this issue.
Thank you,
Divya.
ASKER
Yes, I have tried to generate the code using wsdl.exe. I could generate C# code and I have added the .cs file to my project. But I am getting many build errors like
The type or namespace name 'HttpGetClientProtocol' does not exist in the namespace 'System.Web.Services.Proto cols' (are you missing an assembly reference?)
I have added System.Web.Services reference also. I am guessing that the basic is problem is because I am using Http Get protocol while creating my WSDL file instead of SOAP protocol.
Can you help me how to use Http Get protocol with WSDL.
Thank you,
Divya.
The type or namespace name 'HttpGetClientProtocol' does not exist in the namespace 'System.Web.Services.Proto
I have added System.Web.Services reference also. I am guessing that the basic is problem is because I am using Http Get protocol while creating my WSDL file instead of SOAP protocol.
Can you help me how to use Http Get protocol with WSDL.
Thank you,
Divya.
Have you (or can you) tried using the /namespace option with WSDL.exe? This will put all the generated classes into whatever namespace you designate. This will help to prevent naming collisions. The command line would be something like:
Once you do that, add a "using" directive to the file that will be attempting to call the service:
Then let's see where your code stands.
wsdl.exe /namespace:MyWSNamespace C:\path\to\wsdl.xsd
Once you do that, add a "using" directive to the file that will be attempting to call the service:
using MyWSNamespace;
Then let's see where your code stands.
ASKER
I have used /namespace and tried again. Before even I try to use the generated code I just built it and got so many errors. I have added the two .cs files that were generated to my project and compiled it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window