Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

Currently I am working on a web site and need to use a web service to make some requests. I dont know the URL so I cant add the service by right click and select add a service reference and add it from there.

On the other hand, I have the files ( including the WSDL file) what I have been trying to do is; manually add the files under my App_webrefences fodler and show the web service as a reference from a file from there but the files arent appearing on the list nor i can browse for the desired file. Anyone who can let me know or tell me step by step to add this service ? Thanks.
Posted

Herez the steps to achieve:

1. WSDL is auto genrated code with the below comments
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.0.2914.16
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------

//
// This source code was auto-generated by wsdl, Version=1.0.2914.16.
//


2. Generate proxy code using WSDL
wsdl.exe utility can also take a WSDL file as input instead of a URL pointing to the location where the WSDL can be obtained.

This C# proxy source file represents the proxy class for the web service that clients can compile against. you will get proxy class that derives from the System.Web.Services.Protocols.SoapHttpClientProtocol class. If you use the /protocol:HttpGet or /protocol:HttpPost parameters, the code derives from either the System.Web.Services.Protocols.HttpGetClientProtocol class or the System.Web.Services.Protocols.HttpPostClientProtocol class.

3. Compile the Proxy class as a DLL Library
From the command prompt, execute the below windows commands:
csc /t:library /r:System.Web.Services.dll /r:System.Xml.dll MyServer.cs

4. Build the client solution (console/web/windows form) using reference of the generated proxy instance.
 
Share this answer
 
Comments
wonder-FOOL 9-Sep-11 16:37pm    
Thank you very much for your answer.
Herez the steps to achieve:

1. WSDL is auto genrated code with the below comments
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.0.2914.16
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------

//
// This source code was auto-generated by wsdl, Version=1.0.2914.16.
//


2. Generate proxy code using WSDL
wsdl.exe utility can also take a WSDL file as input instead of a URL pointing to the location where the WSDL can be obtained.

This C# proxy source file represents the proxy class for the web service that clients can compile against. you will get proxy class that derives from the System.Web.Services.Protocols.SoapHttpClientProtocol class. If you use the /protocol:HttpGet or /protocol:HttpPost parameters, the code derives from either the System.Web.Services.Protocols.HttpGetClientProtocol class or the System.Web.Services.Protocols.HttpPostClientProtocol class.

3. Compile the Proxy class as a DLL Library
From the command prompt, execute the below windows commands:
csc /t:library /r:System.Web.Services.dll /r:System.Xml.dll MyServer.cs

4. Build the client solution (console/web/windows form) using reference of the generated proxy instance.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900