그래요. 기본적으로 activecollab 프레임 워크에서 xero에 연결할 응용 프로그램을 빌드하고 있습니다. 그리고 David Pitman이 만든 xeroapi PHP 스크립트를 테스트하고 있습니다. 그리고 난 그냥 여기 XERO-API가 실제 서버에서 작동하지만 테스트 서버에서 작동하지 않습니다.
thumb http://iforce.co.nz/i/iq5bxw0r.5gz.png
코드의 조각입니다 ... 브라우저가The connection to the server was reset while the page was loading.
로 응답 (그러나 어떤
liveheaders
도
firebug
아무것도 최대를 선택 않습니다 생성하지 않는) 이유를 찾기 위해 노력하고있어 사용 중입니다. 의 error_log (PHP)이 경고에서 오류를 일부를 표시하지 않습니다 ...
define('XERO_KEY','my-key-here'); //hidden for privacy reasons
define('XERO_SECRET','my-key-here'); //hidden for privacy reasons
define('XERO_PUBLIC_KEY_PATH', 'path/to/public.key');
define('XERO_PRIVATE_KEY_PATH', 'path/to/privatekey.pem');
$xero = new Xero(XERO_KEY, XERO_SECRET, XERO_PUBLIC_KEY_PATH, XERO_PRIVATE_KEY_PATH, 'xml');
$organisation = $xero->organisation;
//echo the results back
if (is_object($organisation)) {
//use this to see the source code if the $format option is "xml"
echo htmlentities($organisation->asXML()) . "<hr />";
} else {
//use this to see the source code if the $format option is "json" or not specified
echo json_encode($organisation) . "<hr />";
}
(. 모든 XERO의 API 뷰어 및하려면 openssl을 사용하여 이전하고 설정을 가지고) 그리고 내 문제는 다음과 같습니다
2012-07-23 21:59:42 Notice : Undefined index: port (at C:\xampp\htdocs\ac3\activecollab\3.1.10\modules\xero_invoice_manager\lib\xero\xero.class.php on 644 line)
내가 print_r
의 결과에 발견 한 조사에서 xero.class.php 라인 (644)
/**
* parses the url and rebuilds it to be
* scheme://host/path
*/
public function get_normalized_http_url() {
$parts = parse_url($this->http_url);
$port = @$parts['port']; //this line says its undefined
$scheme = $parts['scheme'];
$host = $parts['host'];
$path = @$parts['path'];
$port or $port = ($scheme == 'https') ? '443' : '80';
if (($scheme == 'https' && $port != '443')
|| ($scheme == 'http' && $port != '80')) {
$host = "$host:$port";
}
return "$scheme://$host$path";
}
의 코드 preformatted tag
에서입니다 ..
Array
(
[scheme] => https
[host] => api.xero.com
[path] => /api.xro/2.0/Organisation
)
같은 정보는 (지난 두 달간 용) 라이브 서버에 사용됩니다. xeroapi 클래스는 테스트 서버에서 작동하지 않습니다. 연결되지 않은 이유에 대한 조언이있는 사람이 있습니까? 나는 port 80
과 PHP Version 5.3.8
에 아파치가있는 XAMPP Control Panel
을 실행 중입니다.
'127.0.0.1 test.mydomain.com'이 아니라 웹 서버의 가상 서버를 사용하여 여러 프로젝트를 관리하는데도 사용합니다. – Aatch
고마워, 많이 .. 나는 대학에서 돌아올 때 이것을 시험해보고 작동한다면 : P 나는 당신의 답을 선택한 것으로 표시 할 것이다 :) (그러나 지금은 +1 담당자) – Killrawr
감사합니다! 당신의 대답에 대한 더 많은 정보를 제공하기 위해 :) – Killrawr