Admin.GetLanguages Method
Returns information about the languages used in the deployment of SharePoint Foundation.
Namespace: [Admin Web service]
Web service reference: http://Site/_vti_adm/Admin.asmx
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetLanguages", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetLanguages As XmlNode
'Usage
Dim instance As Admin
Dim returnValue As XmlNode
returnValue = instance.GetLanguages()
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetLanguages", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetLanguages()
Return Value
Type: System.Xml.XmlNode
An XML fragment that contains the locale identifiers (LCIDs) of languages used in the deployment and that can be assigned to a System.Xml.XmlNode object.
Remarks
The account that accesses this Web service must be a member of the Farm Administrators group in the Central Administration site. By default, the server's local Administrators group is in the Farm Administrators group.
To access the Admin service and its methods, set a Web reference to https://Server_Name:Port_Number/.
Note
This service is only available on the Central Administration Web application, and not on any of the content Web applications.
Examples
The following example displays the languages used in the deployment. This example requires that a using (Visual C#) or Imports (Visual Basic) directive be included for the System.Xml namespace.
Dim admService As New Web_Reference_Folder_Name.Admin()
admService.Credentials = System.Net.CredentialCache.DefaultCredentials
Try
Dim langNode As XmlNode = admService.GetLanguages()
MessageBox.Show(langNode.InnerText)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Web_Reference_Folder_Name.Admin admService =
new Web_Reference_Folder_Name.Admin();
admService.Credentials= System.Net.CredentialCache.DefaultCredentials;
try
{
XmlNode langNode = admService.GetLanguages();
MessageBox.Show(langNode.InnerText);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}