cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1232
Views
0
Helpful
6
Replies

Send SOAP Request to Presence Server

sanoopdamodaran
Level 1
Level 1

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#.

6 Replies 6

pklos
Level 4
Level 4

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

--

regards,

PK

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

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="" +

"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.

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

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..

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: