Please note: These WebEx forums have replaced the earlier site forums. All the previous threads and posts have been replicated here, and if you subscribed to the previous forums, please re-subscribe. Thank you.
« Back to Scheduling Meetings

PHP Webex - Bad URI?

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hello,
 
I've downloaded the PHP Webex class found here: http://joshuamcginnis.com/webex/
 
I'm attempting to do a GetjoinurlMeeting call, but when I dump the result, I've got a 302 redirect page, so I'm assuming I must have the wrong URL.  Do I have the completely wrong URL to tramsit to?
 
I started off using just '/' as the URI, then modified to '/WBXService/XMLService', which isn't correct either.
 
 
$webex = new Webex('myUser', 'myPass', '55555', '66666', 'mysite.webex.com/');   

$result = $webex->meeting_GetjoinurlMeeting("123456789");
var_dump($result);
exit;

 
 
    public function __construct($webExID, $password, $siteID, $partnerID, $siteURL) {
        $this->webExID = $webExID;
        $this->password = $password;
        $this->siteID = $siteID;
        $this->partnerID = $partnerID;
        $this->siteURL = ereg_replace("(https?)://", "", $siteURL);
    }
 
 
        private function transmit($payload) {
            // Generate XML Payload
            $xml = '<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
                $xml .= '<header>';
                    $xml .= '<securityContext>';
                        $xml .= '<webExID>'. $this->webExID .'</webExID>';
                        $xml .= '<password>'. $this->password .'</password>';
                        $xml .= '<siteID>'. $this->siteID .'</siteID>';
                        $xml .= '<partnerID>'. $this->partnerID .'</partnerID>';
                    $xml .= '</securityContext>';
                $xml .= '</header>';
                $xml .= '<body>';
                    $xml .= '<bodyContent xsi:type="java:com.webex.service.binding.' . $payload['service']  . '">';    
                        $xml .= $payload['xml'];
                    $xml .= '</bodyContent>';              
                $xml .= '</body>';
            $xml .= '</serv:message>';
           
            // Separate $siteURL into Host and URI for Headers
            $host = substr($this->siteURL, 0, strpos($this->siteURL, "/"));
            $uri = strstr($this->siteURL, "/") . "WBXService/XMLService";
           
            // Generate Request Headers
            $content_length = strlen($xml);
            $headers = array(
                "POST $uri HTTP/1.0",
                "Host: $host",
                "User-Agent: PostIt",
                "Content-Type: application/x-www-form-urlencoded",
                "Content-Length: ".$content_length,
                );

            // Post the Request
            $ch = curl_init('https://' . $this->siteURL);
            curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);           
           
            $response = curl_exec($ch);
            return $response;
        }
 
    public function meeting_GetjoinurlMeeting($sessionKey, $attendeeName = '') {
        $xml = '<sessionKey>'. $sessionKey .'</sessionKey>';
        if($attendeeName) $xml = '<attendeeName>'. $attendeeName .'</attendeeName>';

        $payload['xml'] = $xml;
        $payload['service'] =  str_replace("_", ".", __FUNCTION__);
       
        return $this->transmit($payload);                  
    }
 
 

Create a Cisco account today and gain access across all Cisco Collaboration Developer sites.

 

Follow the WebEx Developer program on Twitter for the latest industry and WebEx Meetings related information.