开发者

Why would an XML-RPC API endpoint randomly throw a ProtocolError -1?

开发者 https://www.devze.com 2023-02-07 03:10 出处:网络
We have built an extensive middleware system around Magento\'s XML-RPC API. We\'ve wrapped the endpoint with Python and are doing a lot of multicalls.

We have built an extensive middleware system around Magento's XML-RPC API. We've wrapped the endpoint with Python and are doing a lot of multicalls.

At a seemingly random interval, the API responds with

ProtocolError for www.mydomain.com/api/xmlrpc/: -1

Is this Apache's funny way of saying开发者_如何转开发 "503 Service Unavailable" and if so, why might that be?

What's the ideal way of handling this exception? A retry on exception seems like it'd make the problem worse.

The web server is Ubuntu 10.04.1 PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch & Zend Engine v2.3.0 The API is being called with Python's xmlrpclib.


In general you should ALWAYS try/catch errors with XMLRPC/SOAP (to Magento) as you cannot guarantee the internet connection between A and B is working.

I think your error may be Python's way of saying '50x blah' or '404 blah' IF you have not fully looked at the error object:

http://docs.python.org/library/xmlrpclib.html#protocolerror-objects

0

精彩评论

暂无评论...
验证码 换一张
取 消