Firefox를 사용하고 http://svcs.ebay.com/services에 액세스하면/search/FindingService/v1 respose에서 일종의 XML을 얻습니다. PHP를 통해이를 수행하면 내부 서버 오류 500이 발생합니다
$php -r 'print_r (simplexml_load_file ( "http://svcs.ebay.com/services/search/FindingService/v1"));' PHP 경고 : simplexml_load_file (http://svcs.ebay.com/services/search/FindingService/v1) : 스트림을 열지 못했습니다 : HTTP 요청이 실패했습니다! HTTP/1.1 500 내부 서버 오류 1 행의 명령 행 코드 PHP 스택 추적 : PHP 1. {main} () 명령 줄 코드 : 0 PHP 2. simplexml_load_file () 명령 줄 코드 : PHP 경고 : simplexml_load_file () : I/O 경고 : 1 행의 명령 행 코드에서 외부 엔티티 "http://svcs.ebay.com/services/search/FindingService/v1"을로드하지 못했습니다. PHP 스택 추적 : PHP 1. {main} () 명령 줄 코드 : 0 PHP 2. simplexml_load_file () 명령 줄 코드 : $
- 답변 # 1
- 답변 # 2
500 개의 요청 데이터를 읽으려면 curl을 사용하십시오
<?php // create a new cURL resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://svcs.ebay.com/services/search/FindingService/v1"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // grab URL and pass it to the browser $xml = curl_exec($ch); $simpleXml = simplexml_load_string($xml); // close cURL resource, and free up system resources curl_close($ch); ?>
- 답변 # 3
해당 사이트를 방문하면 다음과 같은 결과가 나타납니다.
<ms:errorMessage> − <error> <errorId>2038</errorId> <domain>SOA</domain> <severity>Error</severity> <category>System</category> <message>Missing SOA operation name header</message> </error> </ms:errorMessage>
따라서 URL은 웹 서비스에 대한 것으로 보이며 아마도 요청 헤더에 일종의 인증이나 최소한 입력 데이터가 필요할 것입니다. Wikipedia에 따르면 HTTP 응답 500은 서버가 문제를 지정할 수 없지만 문제가 있음을 알고 있다는 일반적인 오류입니다. 이 기사의 가장 좋은 부분은 다음과 같습니다.
와이즈 비즈모두 합쳐서, 귀하의 문제는 귀하가 해당 파일에 대한 디렉토리 수준 액세스 권한이 있다고 가정하고 서버가 응답하는 방법을 사용하여 원격 서버에서 파일을 가져 오려고한다는 것입니다 "음, 무엇?"
Firefox에있는 것처럼 실제 XML 오류를 얻으려면 cURL을 사용하십시오 :
Response status codes beginning with the digit "5" indicate cases in which the server is aware that it has encountered an error or is otherwise incapable of performing the request. Except when responding to a HEAD request, the server should include an entity containing an explanation of the error situation, and indicate whether it is a temporary or permanent condition.
실제로 더 의미있는 것을 얻으려면 PHP의 SoapClient 메소드와 실제 ebay 웹 서비스 문서를 살펴보십시오.
- 답변 # 4
실행할 작업을 지정하여 http 헤더를 설정해야합니다. . 찾기 API를 사용하여 전화를 거는 방법을 읽으면 설정해야 할 다음 http 헤더가 언급됩니다.
$ebay_url = "http://svcs.ebay.com/services/search/FindingService/v1"; $ebay_page = curl_init(); curl_setopt($ebay_page, CURLOPT_RETURNTRANSFER, true); //output to string. curl_setopt($ebay_page, CURLOPT_URL, $ebay_url); //set the url for the request. $ebay_response = curl_exec($ebay_page); print_r(simplexml_load_string($ebay_response));
그러면 통화가 제대로 작동하도록 설정됩니다.
- 답변 # 5
다음 URL을 사용해보십시오. 내가 할 때 XML과 200 응답을 돌려받습니다.
X-EBAY-SOA-SERVICE-NAME: FindingService X-EBAY-SOA-OPERATION-NAME: findItemsAdvanced <-- whatever call you are making X-EBAY-SOA-SERVICE-VERSION: 1.0.0 X-EBAY-SOA-GLOBAL-ID: EBAY-US X-EBAY-SOA-SECURITY-APPNAME: MyAppID X-EBAY-SOA-REQUEST-DATA-FORMAT: XML X-EBAY-SOA-MESSAGE-PROTOCOL: XML
http://svcs.ebay.com/services/search/FindingService/v1?wsdl
관련 자료
- ruby on rails - open-uri가있는 openuri - : httperror (500 내부 서버 오류)
- python - 플라스크 앱에서 버튼 클릭시 내부 서버 오류
- .htaccess - 내부 서버 오류를 일으키는 모드 다시 쓰기, 오류 500
- Django Rest Framework - django rest 프레임 워크 - "unique_together"내부 서버 오류입니다 오류로 대응하는 방법
- flask - Python 데이터를 반환하는 동안 내부 오류
- wsl 2 - "sbt 서버가 이미 부팅 중입니다" wsl2 우분투에서 sbt를 시작할 때 오류
- sql server odbc"tcp 공급자 - 오류 코드 0x274c"
- php - 이메일을 보내는 동안 서버 인증서 오류와 비밀번호가 실패한 이유는 무엇입니까?
- cpanel에서 Python을 설정할 때 503 서버 사용 중 오류 코드 수신
- c++ - 동일한 데이터베이스에 두 개의 연결을 만들 때 "mysql server has gone away"오류가 발생합니다
- google cloud platform - gcloud apps logs tail은 내부 오류를 반환합니다 로그 GUI가 알 수없는 오류를 반환 함
- javascript - Windows 2012 R2 서버에서 405 이후 오류를 극복하는 방법
- kubernetes - 서버에서 kubectl 오류를 수정하는 방법 (notfound) - 서버가 요청 된 리소스를 찾을 수 없습니다
- 500 내부 서버 오류 NGINX + PHP7 대신 PHP가 오류를 표시하도록하려면 어떻게해야합니까?
- phpmyadmin - 요청 처리 중 오류 오류 코드 - 200 오류 텍스트 : ok (거부 됨) :wamp 서버
- intellij idea mapstruct java - 매핑 프로세서의 내부 오류 : javalangnullpointerexception
- sql server로 powershell 가져 오기 - 견적 오류
- database - 올바른 자격 증명에도 불구하고 azure sql server 연결 오류 - 오류 번호 : 18456, 상태 : 1, 클래스 : 14
- spring - Vault 오류, 서버가 HTTPS 클라이언트에 HTTP 응답을 제공했습니다
- python - fxcm 연결 오류 - 서버에 연결할 수 없습니다
firefox에서 http://svcs.ebay.com/services/search/FindingService/v1을 방문하면 Firebug는 HTTP 응답 코드가 실제로 500이라고보고합니다 (요청 본문에 XML을 보내더라도)
웹 서비스를 잘못 호출하고 있습니다.
예, XML을 다시 얻었지만 응답 코드는 500이므로 URL이 잘못되었습니다.
URL 래퍼를 통해 ximlexml_load_file을 호출하면 성공 코드가 필요합니다.
어쨌든 데이터를 얻을 수 있다고 말했다. 아마도.하지만 서비스가 어떻게 쿼리를 원하는지 알아 내야합니다.