2016-11-02 1 views
1

공식 PlatformNotificationsCodeSample-PHP 템플릿을 사용하여 eBay 플랫폼 알림을 설정하려고합니다.eBay 플랫폼 알림 SOAP Listener 문제

내 키와 토큰으로 ebay.ini을 성공적으로 구성했습니다. SetNotificationPreferences.phpGetNotificationPreferences.php 두 가지 모두 성공한 통화로 문제없이 전달됩니다. GetNotificationPreferences

나는 성공적으로 내 변경된 것을 볼 수 있습니다 ApplicationURLhttp://localhost/notifications/listener.php

내가

C:\development\xampp\htdocs\notifications>php generator.php 
    <?xml version="1.0" encoding="UTF-8"?> 
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:ns1="urn:ebay:apis:eBLBaseComponents" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
    <SOAP-ENV:Body><ns1:GetMemberMessagesResponseResponse><return xsi:type="xsd:string"> 
    trachtenberga</return></ns1:GetMemberMessagesResponseResponse> 
    </SOAP-ENV:Body></SOAP-ENV:Envelope> 

는 이쪽 $argc$notifications array에서 오는 호출이 성공을 반환 명령 줄을 통해 generator.php에 액세스하려고하는 경우에 및 AskSellerQuestion.xml

나는 단지 방법에 관해서 혼란 스럽다. listener.php wor ks. 내가 직접 브라우저 (http://localhost/notifications/listener.php)에 액세스하거나 명령 줄에서, 난 항상 다음과 같은 오류 메시지가 있는지 여부

:

Notice: Undefined index: HTTP_RAW_POST_DATA in C:\development\xampp\htdocs\notifications\listener.php on line 107 

이 선 것 :

$stdin = $GLOBALS['HTTP_RAW_POST_DATA']; 

만 지금까지 Undefined index: HTTP_RAW_POST_DATA 문제로 발견 된 가능한 해결책은 내 php.ini 구성을 always_populate_raw_post_data = On으로 변경하는 것이지만 영향은 없으며 여전히 동일한 오류가 발생합니다.

나는 $HTTP_RAW_POST_DATA는 PHP 5.6.0에서 감가 상각 및 PHP 7.0.0에서 제거하지만, $ GLOBALS를 사용하십시오 eBay Knowledge base

에 따라 이후 대신 php://input를 사용하는 것이 좋습니다 된 것을 알고 [ "HTTP_RAW_POST_DATA"] file_get_contents (php : // input) 대신 페이로드 ( )를 캡처합니다. 클라이언트가 PHP 입력 스트림 을 캡처 할 때 컷오프 및 불완전 페이로드를 검색하는 것과 같은 문제가 있습니다.

플랫폼 알림 구성을 시작할 수 있도록이 SOAP 수신기를 작동 시키려면 어떻게해야합니까?

+0

누군가가 내게 구독자 및 수신자 구현 방법을 설명해 주실 수 있습니까? 나는 통지를받을 API를 작성하는 방법을 찾고 있지만 구독자를 어떻게 따라 잡을 수 있습니까? 나는 일하고있어 .net mvc C# localhost에서 알림을 테스트하는 방법. – coder771

+0

이 스레드는 PHP에 대한 이베이 (eBay) API에 대한 것입니다. .net mvc C#에 대해서는 잘 모릅니다.내 경험상 eBay API를 통해 수신 할 플랫폼 알림을 '사용'하면됩니다. 그러면 수신 한 것을 구독 할 때마다 eBay가 지정한 곳으로 응답을 보냅니다. 'SetNotificationPreferences'와'GetNotificationPreferences'는 여러분이 더 자세히 살펴보고 싶다고 생각합니다. – bbruman

+0

setnotifcationpreference를 매번 호출하여 구독이 여전히 사용 가능한지 확인해야하는지 혼란 스럽습니다. 그것은 단지 한 번의 과정일까요? – coder771

답변

1

이 스레드를 잊어 버렸습니다. 내 솔루션은 작업이이

if (!isset($HTTP_RAW_POST_DATA)) { 
$HTTP_RAW_POST_DATA = file_get_contents("php://input"); 
} 

// then do what you want, for example I was doing something like this 
// to save the xml response to my web server 

$file_name= "order_shipped_".time().".xml"; 
$stdin = $GLOBALS['HTTP_RAW_POST_DATA']; 
file_put_contents($file_name, $stdin); 

을 사용하는 간단했다 얻기 위해 그리고 내 모든 알림 벌금을 받고했습니다.

그러나 원래 스레드에 따라이 작업이 eBay 지식 기반과 함수 감가 상각을 고려하여 최선의 방법인지는 잘 모르겠습니다. 누구든지이 더 이상 입력에 대한 의견이 있으면