Sears 마켓 플레이스에서 인벤토리를 API로 업데이트하고 싶습니다.PHP : cURL PUT을 사용하여 XML 데이터 보내기
"재고 관리 : 이 API 호출은 항목의 재고 수준을 관리 할 수 PUT 메소드를 사용, 재고 업데이트 만 성공적으로 처리 한 항목에해야 오류를 방지하려면 참고 :.. 재고가 아닙니다 자동 감소되므로 주문을 받고 처리 할 때 재고를 업데이트하는 것이 중요합니다. "
PUT의 URL : https://seller.marketplace.sears.com/SellerPortal/api/inventory/fbm-lmp/v6?email={emailaddress}&password={password}
나는 스크립트를 folowing하지만 제대로 작동하지 만든 :
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<store-inventory
xmlns="http://seller.marketplace.sears.com/catalog/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://seller.marketplace.sears.com/SellerPortal/s/schema/rest/inventory/import/v2/store-inventory.xsd">
<item item-id="10">
<locations>
<location location-id="21">
<quantity>20</quantity>
<pick-up-now-eligible>false</pick-up-now-eligible>
</location>
</locations>
</item>
</store-inventory>';
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_URL, "https://seller.marketplace.sears.com/SellerPortal/api/inventory/fbm-lmp/v6?email={email}&password={pass}");
curl_setopt($ch, CURLOPT_PORT, 443);
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,array($xml));
$http_result = curl_exec($ch);
if($http_result){
echo $http_result;
}else{
echo curl_error($ch);
}
curl_close($ch);
curl_error : 내가 틀렸다
Unknown SSL protocol error in connection to seller.marketplace.sears.com:443
?
http://stackoverflow.com/questions/3958226/using-put-method-with-php-curl-library –
을하고 질문은? 오류는 무엇을 의미합니까? 그렇다면이 정보는 다음과 같이 사용될 수 있습니다. [cURL로 알려지지 않은 SSL 프로토콜 오류의 일반적인 원인은 (2010 년 3 월 18 일, Chris Mahns)] (http://blog.techstacks.com/2010/03/3-common -causes-of-unknown-ssl-protocol-errors-with-curl.html) – hakre
또한'CURLOPT_POSTFIELDS'는 PUT와 관련이 없습니다 – hakre