Hi,
I have added web reference using Visual Studio tool i-e Website > add web reference but it add only .disco and .wsdl file. My question is, are these the only 2 files to add? i mean i was expecting .asmx file so that i can see its methods properly. and i wrote code in C# in .aspx.cs(code behind file) which is given below but the error comes saying that invalid web service method name. Check out my code and guide me where i m doing mistake and is that possible to view code of that web service while i can see only .wsdl and .disco file. or tell me that am i going in the right direction or this is not correct way to access Soap web service method. please guide me, i really need help and reply me soon. Below is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Diagnostics;
using System.Xml.Serialization;
using System.Web.Services.Protocols;
public partial class Testing : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
static Example1 obj = new Example1();
static string s = obj.printDetails("EX76550");
[WebMethod()]
//[ScriptMethod()]
public static string SendMessage()
{
return "Hello World";
//send message
}
[System.Web.Services.WebServiceBindingAttribute(
Name = "ldapSoap",
Namespace = "http://al2c00/ldap")]
public class Example1 :
System.Web.Services.Protocols.SoapHttpClientProtocol
{
public Example1()
{
this.Url = "http://al2c00:45/LDAP/ldap.asmx";
}
[System.Web.Services.Protocols.SoapDocumentMethodAttribute(
"http://al2c00/ldap/GetEmployeeDetailsBy_NTID",
RequestNamespace = "http://al2c00/ldap",
ResponseNamespace = "http://al2c00/ldap",
Use = System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string printDetails(string NTID)
{
object[] results = this.Invoke("GetEmployeeDetailsBy_NTID",
new object[] { NTID });
return ((string)(results[0]));
}
}
}