<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Cannot get XACML to parse using PHP</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=12602812" />
  <subtitle>Cannot get XACML to parse using PHP</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=12602812</id>
  <updated>2013-06-19T05:56:54Z</updated>
  <dc:date>2013-06-19T05:56:54Z</dc:date>
  <entry>
    <title>RE: Cannot get XACML to parse using PHP</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=12620486" />
    <author>
      <name>Mark Stover</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=12620486</id>
    <updated>2013-03-04T22:37:16Z</updated>
    <published>2013-03-04T22:37:16Z</published>
    <summary type="html">The only difference I see in the responses is this "HEAD /speeddial/ecp.php HTTP/1.1". Guessing that this might just be remanent of your pasting.
Are you running Version 8.6 of CUCM? There is a defect (fixed in 9.0 and later) that impacts the changing of the application URL in the ECP profile. It will work when you first configure it, but when you change the URL of the profile, it doesn't get reloaded properly and your application will fail. You can work around it by restarting the CUCM service. You can also try having two profiles (one for the Python and another for the PHP) and switching between them. 
There shouldn't be anything inherent in PHP that stops you.

Mark</summary>
    <dc:creator>Mark Stover</dc:creator>
    <dc:date>2013-03-04T22:37:16Z</dc:date>
  </entry>
  <entry>
    <title>Cannot get XACML to parse using PHP</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=12602811" />
    <author>
      <name>Marcus Mitchell</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=12602811</id>
    <updated>2013-03-04T18:54:21Z</updated>
    <published>2013-03-04T18:30:26Z</published>
    <summary type="html">I am unable to get PHP to work with XAXML/ECP profiles. I read a previous post from Stefan and tried to correct my issues using the info in that post but was not successful. I am able to get the python app to work. Would strongly prefer to use PHP.  
 
I simply copied the python message and substitude some hard coded values.
 
//********************
 
$response = '&lt;?xml encoding="UTF-8" version="1.0"?&gt;&lt;Response&gt;&lt;Result&gt;&lt;Decision&gt;Permit&lt;/Decision&gt;&lt;Status&gt;&lt;/Status&gt;&lt;Obligations&gt;&lt;Obligation FulfillOn="Permit" ObligationId="urn:cisco:xacml:policy-attribute"&gt;&lt;AttributeAssignment AttributeId="Policy:simplecontinue"&gt;&lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&amp;lt;cixml ver="1.0"&amp;gt;&amp;lt;continue&amp;gt;&amp;lt;modify callingnumber="3688" callednumber="3689"/&amp;gt;&amp;lt;/continue&amp;gt; &amp;lt;/cixml&amp;gt;&lt;/AttributeValue&gt;&lt;/AttributeAssignment&gt;&lt;/Obligation&gt;&lt;/Obligations&gt;&lt;/Result&gt;&lt;/Response&gt;';
echo $response;
 
//*************************  
 
 
Here is the wireshark capture of the request/response between my Apache server and the CUCM POST 
 
POST /speeddial/ecp.php HTTP/1.1

Host: *****:8090

Accept: */*

Content-type: text/xml; charset=ISO-8859-1

methodName: isRoleAccessAllowed

User-Agent: CiscoUCM-HttpClient/1.0

Connection:Keep-Alive

Content-Length: 1682



&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"&gt;
&lt;Subject SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"&gt;
&lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:role-id"
DataType="http://www.w3.org/2001/XMLSchema#string" Issuer="requestor"&gt;
&lt;AttributeValue&gt;CISCO:UC:UCMPolicy&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:callingnumber"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;3654&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:callednumber"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;**63654&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:transformedcgpn"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;3654&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:transformedcdpn"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;6000&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;/Subject&gt;
&lt;Resource&gt;
&lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"&gt;
&lt;AttributeValue&gt;CISCO:UC:VoiceOrVideoCall&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;/Resource&gt;
&lt;Action&gt;
&lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"&gt;
&lt;AttributeValue&gt;any&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;/Action&gt;
&lt;Environment&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:triggerpointtype"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;translationpattern&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;/Environment&gt;
&lt;/Request&gt;
HTTP/1.1 200 OK

Date: Mon, 04 Mar 2013 18:50:56 GMT

Server: Apache

Content-Length: 525

Content-type: text/xml; charset="utf-8"

Keep-Alive: timeout=15, max=100

Connection: Keep-Alive

&lt;?xml encoding="UTF-8" version="1.0"?&gt;&lt;Response&gt;&lt;Result&gt;&lt;Decision&gt;Permit&lt;/Decision&gt;&lt;Status&gt;&lt;/Status&gt;&lt;Obligations&gt;&lt;Obligation FulfillOn="Permit" ObligationId="urn:cisco:xacml:policy-attribute"&gt;&lt;AttributeAssignment AttributeId="Policy:simplecontinue"&gt;&lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&amp;lt;cixml ver="1.0"&amp;gt;&amp;lt;continue&amp;gt;&amp;lt;modify callingnumber="3688" callednumber="3689"/&amp;gt;&amp;lt;/continue&amp;gt; &amp;lt;/cixml&amp;gt;&lt;/AttributeValue&gt;&lt;/AttributeAssignment&gt;&lt;/Obligation&gt;&lt;/Obligations&gt;&lt;/Result&gt;&lt;/Response&gt;HEAD /speeddial/ecp.php HTTP/1.1


//*********
Here is a wireshark for my Python server
 
POST /ecp.py HTTP/1.1

Host: *******:8080

Accept: */*

Content-type: text/xml; charset=ISO-8859-1

methodName: isRoleAccessAllowed

User-Agent: CiscoUCM-HttpClient/1.0

Connection:Keep-Alive

Content-Length: 1682



&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"&gt;
&lt;Subject SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"&gt;
&lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:role-id"
DataType="http://www.w3.org/2001/XMLSchema#string" Issuer="requestor"&gt;
&lt;AttributeValue&gt;CISCO:UC:UCMPolicy&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:callingnumber"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;3654&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:callednumber"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;**53654&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:transformedcgpn"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;3654&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:transformedcdpn"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;6000&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;/Subject&gt;
&lt;Resource&gt;
&lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"&gt;
&lt;AttributeValue&gt;CISCO:UC:VoiceOrVideoCall&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;/Resource&gt;
&lt;Action&gt;
&lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"&gt;
&lt;AttributeValue&gt;any&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;/Action&gt;
&lt;Environment&gt;
&lt;Attribute AttributeId="urn:Cisco:uc:1.0:triggerpointtype"
DataType="http://www.w3.org/2001/XMLSchema#string"&gt;
&lt;AttributeValue&gt;translationpattern&lt;/AttributeValue&gt;
&lt;/Attribute&gt;
&lt;/Environment&gt;
&lt;/Request&gt;
HTTP/1.0 200 OK

Server: BaseHTTP/0.3 Python/2.7.3

Date: Mon, 04 Mar 2013 18:52:17 GMT

Content-type: text/xml; charset="utf-8"

Content-Length: 529

Connection: Keep-Alive

Keep-Alive: timeout = 20000   max = 100



&lt;?xml encoding="UTF-8" version="1.0"?&gt;&lt;Response&gt;&lt;Result&gt;&lt;Decision&gt;Permit&lt;/Decision&gt;&lt;Status&gt;&lt;/Status&gt;&lt;Obligations&gt;&lt;Obligation FulfillOn="Permit" ObligationId="urn:cisco:xacml:policy-attribute"&gt;&lt;AttributeAssignment AttributeId="Policy:simplecontinue"&gt;&lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&amp;lt;cixml ver="1.0"&amp;gt;&amp;lt;continue&amp;gt;&amp;lt;modify callingnumber="3688" callednumber="3689"/&amp;gt;&amp;lt;/continue&amp;gt; &amp;lt;/cixml&amp;gt;&lt;/AttributeValue&gt;&lt;/AttributeAssignment&gt;&lt;/Obligation&gt;&lt;/Obligations&gt;&lt;/Result&gt;&lt;/Response&gt;</summary>
    <dc:creator>Marcus Mitchell</dc:creator>
    <dc:date>2013-03-04T18:30:26Z</dc:date>
  </entry>
</feed>

