2013-09-26 1 views
0

Openmeetings의 SOAP API로 모험을하고 있습니다. 이것은 SOAP를 사용하는 첫 번째 로데오이므로 솔루션이 분명해 보인다면 걱정하지 마십시오.SOAP를 사용하여 값을 가져 오는 동안 정의되지 않은 속성입니다.

어쨌든 다음 스크립트로 세션 ID를 검색하려고합니다.

주의 사항 :

<?php 
    $wsdl = "http://localhost:5080/openmeetings/services/UserService?wsdl"; 
    $session = new SoapClient($wsdl, array("trace" =>1, "exceptions"=>0)); 
    $value = $session->getSession(); 
    $xml = $value->getSessionResponse; 
    $ssid = $xml->session_id; 
    print "<br/>\n SSID: $ssid"; 
?> 

그러나 나는 다음과 같은 오류가 받고 있어요 정의되지 않은 속성을 : stdClass : $ getSessionResponse 라인 5 /home/sam/www/soap.php에서
공지 사항 : soapUI를 사용하여 라인 6

에 /home/sam/www/soap.php에 비 객체의 속성을 얻으려고, 나는 다음과 같은 전송되는 것을 볼 수 있습니다

,451,515,
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.axis.openmeetings.apache.org"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <ser:getSession/> 
    </soapenv:Body> 
</soapenv:Envelope> 

내가 soapUI에 그것을 수행 할 때, 다음 (내가 원하는 모든 것이 더 포함된다) 반환됩니다 soapUI가 작동하기 때문에

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soapenv:Body> 
     <ns:getSessionResponse xmlns:ns="http://services.axis.openmeetings.apache.org"> 
    <ns:return xsi:type="ax22:Sessiondata" xmlns:ax27="http://asterisk.sip.beans.persistence.openmeetings.apache.org/xsd" xmlns:ax213="http://basic.beans.data.openmeetings.apache.org/xsd" xmlns:ax24="http://domain.beans.persistence.openmeetings.apache.org/xsd" xmlns:ax21="http://user.beans.persistence.openmeetings.apache.org/xsd" xmlns:ax22="http://basic.beans.persistence.openmeetings.apache.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
     <ax22:id>14</ax22:id> 
     <ax22:language_id xsi:nil="true"/> 
     <ax22:organization_id xsi:nil="true"/> 
     <ax22:refresh_time>2013-09-26</ax22:refresh_time> 
     <ax22:sessionXml xsi:nil="true"/> 
     <ax22:session_id>90a4d3dc876460e119d068969def236c</ax22:session_id> 
     <ax22:starttermin_time>2013-09-26</ax22:starttermin_time> 
     <ax22:storePermanent xsi:nil="true"/> 
     <ax22:user_id xsi:nil="true"/> 
    </ns:return> 
     </ns:getSessionResponse> 
    </soapenv:Body> 
</soapenv:Envelope 

, 나는 내가 사용하는 URL 확신을 API가 제대로 작동하는지 확인하십시오. 누구든지 내 PHP에서 어리 석음을 찾을 수 있습니까?

참고로 Openmeetings에 대한 SOAP API 문서는 found here. 일 수 있습니다. 누구든지 유용하거나 흥미로울 수 있습니다.

많은 사람들에게 오류를 미리 감지 해 주셔서 감사합니다.

답변

1

약간의 당혹 스러움. 포스트에서 문법을 편집하면서 "getSessionResponse"대신 "return"을 사용해야한다는 것을 알게되었습니다. 나는 단지

$xml = $value->return; 

$xml = $value->getSessionResponse; 

를 교체하고 그것이 마치 마법처럼 일했다.

서버 공간을 낭비해서 죄송합니다 .-P