Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Send SOAP Request to Presence Server

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
Silver

Re: Send SOAP Request to Presence Server

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

--

regards,

PK

New Member

Re: Send SOAP Request to Presence Server

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

Silver

Re: Send SOAP Request to Presence Server

New Member

Re: Send SOAP Request to Presence Server

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.

Silver

Re: Send SOAP Request to Presence Server

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

New Member

Re: Send SOAP Request to Presence Server

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

473
Views
0
Helpful
6
Replies