select serverproperty('edition')
The result will look something like:
32-bit: Enterprise Edition
64-bit: Developer Edition (64-bit)
dot net tips, DotNet tips, .Net Tips,Dot Net tips and tricks,Dot Net Solutions, OOPS Concept in C#,SQL Server, LinQ, Ajax, Java script, JQuery, Server Error details, daily .net tips and tricks , DotNet Interview Questions.
select serverproperty('edition')
you need to use here is theXLINQ. After adding the reference to System.Xml.Linq
in your program do write the below code.
XElement companyInfo = XElement.Parse( @"<COMPANYINFO> <CORPORATE ID=""C45RT4C"" NAME=""NEW COMPANY LTD.""> <LOCATION ID=""P88972FC"" NAME=""EASIER""> <SUBLOCATION ID=""S89872FE"" NAME=""400462""/> </LOCATION> <LOCATION ID=""PDRD2905"" NAME=""XT-454560-5""> <SUBLOCATION ID=""SFDF22D7"" NAME=""202743""/> <SUBLOCATION ID=""S106B993E"" NAME=""401048""/> <SUBLOCATION ID=""SDEA2907"" NAME=""507152""/> <SUBLOCATION ID=""123C699"" NAME=""507180""/> <SUBLOCATION ID=""HTY4C896"" NAME=""507205""/> <SUBLOCATION ID=""SFD580DD"" NAME=""600281""/> </LOCATION> <LOCATION ID=""PD1104ED"" NAME=""TD-454560-4""> <SUBLOCATION ID=""211704EF"" NAME=""202724""/> <SUBLOCATION ID=""SFD37943"" NAME=""401056""/> <SUBLOCATION ID=""XDEA2A2D"" NAME=""507169""/> </LOCATION> </CORPORATE> </COMPANYINFO>"); foreach (XElement subLocation in companyInfo.Elements("CORPORATE").Elements("LOCATION").Elements("SUBLOCATION")) { Console.WriteLine(subLocation.Attribute("NAME").Value); }
http://localhost/AddNumbers/Service1.asmx
WSDL URL: http://localhost/AddNumbers/Service1.asmx ?wsdl
Namespace of web service: http://localhost/wwwroot/addnumbers/Service1
Method:int AddTwoNumbers (int, int)
Class:Service1
ID = lablel1). objXMLHttp of type MSXML2.ServerXMLHTTP40.
Protected MSXML2.ServerXMLHTTP40 objXMLHttp
string strSoapEnvelope which contains soap request.
string strSoapEnvelope= “”;
strSoapEnvelope like this:
strSoapEnvelope = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
strSoapEnvelope += "<soap:Envelope ";
strSoapEnvelope += "xmlns:xsi = \"http://www.w3.org/2001/XMLSchema-instance\" ";
strSoapEnvelope += "xmlns:xsd= \"http://www.w3.org/2001/XMLSchema\" ";
strSoapEnvelope += "xmlns:soap= \"http://schemas.xmlsoap.org/soap/envelope/\">";
strSoapEnvelope += "<soap:Body>";
strSoapEnvelope += "<AddTwoNumbers
xmlns=\"http://localhost/wwwroot/addnumbers/Service1\">";
strSoapEnvelope +="<a>10</a>";
strSoapEnvelope += "<b>12</b>"
strSoapEnvelope += "</AddTwoNumbers >";
strSoapEnvelope += "</soap:Body>";
strSoapEnvelope += "</soap:Envelope>";
ServerXMLHTTP40.
objXMLHttp = new ServerXMLHTTP40();
objXMLHttp.open("POST", http://192.168.84.90/AddNumbers/Service1.asmx,false,"","")
objXMLHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
objXMLHttp.setRequestHeader("SOAPAction",
"http://localhost/wwwroot/addnumbers/Service1/AddTwoNumbers");
objXMLHttp.send(strSoapEnvelope.ToString());
objXMLHttp.waitForResponse(500);
string outXML = objXMLHttp.responseText.ToString();
label(ID= label1):
Label1.Text = outXML.ToString();