Send SOAP Request to Presence Server

Unanswered Question
Nov 3rd, 2008

i Want to send SOAP Request to Presence Server to get the users availability status.Please help me to get the SOAP Request.i'm working in c#.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
pklos Mon, 11/03/2008 - 07:07

If you want to get presence status from CUPS you should use SIP protocol. SOAP is just for configuration.

--

regards,

PK

sanoopdamodaran Mon, 11/03/2008 - 21:00

Please help me to get some samples to use SIP protocol for getting the presence status.

sanoopdamodaran Tue, 11/04/2008 - 22:19

i've gone through the document and i'm able to send SOAP request to CUPS using C#. But i'm not sure how to use SIMPLE in C#. following is the code i've used to send SOAP request to CUPS

using System;

using System.Xml;

using System.Text;

using System.IO;

using System.Net;

using System.Security.Cryptography.X509Certificates;

public class WebServiceAccess

{

public WebServiceAccess()

{

string xmlfile;

xmlfile="<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +

"http://www.w3.org/2003/05/soap-envelope\" xmlns:SOAP-ENC=\"http://www.w3.org/2003/05/soap-encoding\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:pr=\"urn:cisco:epas:presence:rules\" xmlns:epas=\"urn:cisco:epas:soap\">" +

" " +

" " +

" cdickens " +

" 123456 " +

" " +

" " +

" ";

HttpSOAPRequest(xmlfile,null);

}

public void HttpSOAPRequest(String xmlfile, string proxy)

{

byte[] bytes = null;

System.Net.ServicePointManager.ServerCertificateValidationCallback +=

delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,

System.Security.Cryptography.X509Certificates.X509Chain chain,

System.Net.Security.SslPolicyErrors sslPolicyErrors)

{

return true;

};

HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://10.75.1.60:8443/EPASSoap/service");

req.Headers.Add("SOAPAction","\"\"");

req.ContentType = "text/xml;charset=\"utf-8\"";

req.Accept = "text/xml";

req.Method = "find_business";

// Add the network credentials to the request.

Console.WriteLine("Step 1");

// Encode the body using UTF-8.

bytes = Encoding.UTF8.GetBytes((string)xmlfile);

// Set the content header length. This must be

// done before writing data to the request stream.

req.ContentLength = bytes.Length;

Stream stm = req.GetRequestStream();

// Write the SQL query to the request stream.

stm.Write(bytes, 0, bytes.Length);

Console.WriteLine("Step 2");

stm.Close();

WebResponse resp= (HttpWebResponse)req.GetResponse();

Console.WriteLine("Step 3");

stm = resp.GetResponseStream();

StreamReader r = new StreamReader(stm);

// process SOAP return doc here. For now, we'll just send the XML out to the browser ...

Console.WriteLine(r.ReadToEnd());

Console.WriteLine("Step 4");

}

public static void Main(string[] args)

{

new WebServiceAccess();

}

}

This code is working fine. Sameway how do we send request for getting the user availability? Please help me to get some samples on this.

pklos Wed, 11/05/2008 - 06:52

SOAP is just for configuration.

You need to use SIP (SIMPLE) and subscribe contact:

http://www.cisco.com/en/US/docs/voice_ip_comm/cups/6_0_1/interoperability/developer/guide/cpsinter.html#wp36696

During subscription CUPS server will send you information about yours contact presence on every change.

If you have no idea about SIP+c# look here:

http://www.codeproject.com/KB/cs/SIP_stack_with_SIP_proxy.aspx

regards,

PK

sanoopdamodaran Thu, 11/13/2008 - 05:12

Hi again..i could not get what to enter in the application.. like settings/Registrations/gateway etc.. Please help me out to find some simple examples..

From CUAD, i need to access the CUPS and find out the status..there is an example in cisco wiki call presenceMonitor..but its not working for me..

Actions

This Discussion