使用Java&;MagentoRESTAPI。404错误
我正在尝试使用scribe使用Java到MagentoRESTAPI。我遵循了这里概述的教程。我对Magento是个新手,一般来说我会休息。我在Tomcat6.0服务器上使用Java1.5。Magento是1.8.0.0 所以我现在已经有了oAuth令牌和验证使用Java&;MagentoRESTAPI。404错误,java,php,.htaccess,magento,rest,Java,Php,.htaccess,Magento,Rest,我正在尝试使用scribe使用Java到MagentoRESTAPI。我遵循了这里概述的教程。我对Magento是个新手,一般来说我会休息。我在Tomcat6.0服务器上使用Java1.5。Magento是1.8.0.0 所以我现在已经有了oAuth令牌和验证 final String MAGENTO_API_KEY = "My Key"; final String MAGENTO_API_SECRET = "My Secret"; final String MAGEN
final String MAGENTO_API_KEY = "My Key";
final String MAGENTO_API_SECRET = "My Secret";
final String MAGENTO_REST_API_URL = "http://127.0.0.1/magento/api/rest";
我可以授权应用程序并获得验证程序代码,但是当尝试从RESTURL检索XML(我想?)时,我会得到以下结果
404
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /magento/api/rest/products was not found on this server.</p>
</body></html>
这方面的任何帮助都将是非常棒的。我不确定是htaccess文件还是其他文件,但我已经尝试了大约一周的不同方法,但都没有效果。您可以访问Magento网站
/Magento/
URL上的主页以外的任何页面吗?基于通用(非Magento)404页面
404
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /magento/api/rest/products was not found on this server.</p>
</body></html>
我尝试了magento/install.php,它通知已经安装了magento,所以我假设其他页面正在工作。我检查了Magento htaccess文件中的RewriteBase,它已经被注释掉了。我现在来测试一下,看看。我可能还会尝试PHP中的示例代码,看看它是否是Java问题。好的,在取消注释、重新启动和测试之后,我仍然会得到相同的错误。我也尝试过在浏览器中访问127.0.0.1/magento/api/rest/products,但只得到了相同的页面。它不应该显示某种XML以这种方式访问它吗?只是以某种方式显示REST正在工作?好吧,在仔细查看之后,我发现了这个问题,我的127.0.0.1/api.php也遇到了同样的问题,它解决了这个问题。它仍然会给出404消息,但这应该是因为api.php没有调用任何东西?如果我将java程序中的字符串MAGENTO_REST_api_URL更改为“”,则会更改输出。现在它给了我一个错误oauth\u problem=signature\u invalid。这必须表明重写不起作用,但如果我已经授权oAuth,为什么我的签名无效?我有同样的问题,你们中的任何人可以帮助我解决这个问题吗?你们是如何绕过这个@Murt88的?
404
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /magento/api/rest/products was not found on this server.</p>
</body></html>
############################################
## you can put here your magento root folder
## path relative to web root
RewriteBase /magento/