Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

LoginFromId method sample code

The following is sample code for the LoginFromId method. Additional code samples will be added soon.

C#

Add a Web reference by entering the URL to the WebService MailupSend (http://services.mailupnet.it/MailupSend.asmx) and specifying a name for it. See how to Add a Web reference in Visual Studio

Code Block
languagecsharp
linenumberstrue
...
it.mailupnet.services.MailupSend myService = new it.mailupnet.services.MailupSend();
string s = myService.LoginFromId(user, password, myconsoleID); // executing return message parsing
System.Xml.XmlDataDocument docXML = new System.Xml.XmlDataDocument();
docXML.LoadXml(s); 
// retrieving error code
System.Xml.XmlNodeList error = docXML.GetElementsByTagName("errorCode");
errorCode = Convert.ToInt32(error[0].InnerText);
...
// retrieving access key
if (errorCode == 0)
{
  System.Xml.XmlNodeList key = docXML.GetElementsByTagName("accessKey");
  accessKey = key[0].InnerText;
} 
// calling other webservice methods
...
Info
Note: the accessKey returned by the LoginFromId method in the MailUpSend Web Service can also be used for the MailUpReport and MailUpManage Web Services.