使用soap java连接到magento api

问题描述 投票:0回答:1

由于缺少magento-api.properties 文件,使用soap 的magento api 无法工作,有人可以帮忙吗?

public class testConnection {
    public static void main(String[] args) throws AxisFault {
        String user = "rajeshvishnani";
        String pass = "123456";
        String host = "http://cypherincorporated.co.in/magento/index.php/api/soap?wsdl";

        SoapConfig soapConfig = new SoapConfig(user, pass, host);
        MagentoSoapClient magentoSoapClient = MagentoSoapClient.getInstance(soapConfig);        
        magentoSoapClient.setConfig(soapConfig);

    }
}

Exception in thread "main" java.lang.IllegalArgumentException: could not load [magento-api.properties] as a classloader resource
    at com.google.code.magja.utils.PropertyLoader.loadProperties(PropertyLoader.java:106)
    at com.google.code.magja.utils.PropertyLoader.loadProperties(PropertyLoader.java:123)
    at com.google.code.magja.soap.MagentoSoapClient.getInstance(MagentoSoapClient.java:69)
    at magentomanager.testConnection.main(testConnection.java:15)
java magento soap magento-soap-api
1个回答
0
投票

尝试将网址更改为

'http://yoursite.com/api/v2_soap/index?wsdl=1'.

请提供更多详细信息。 不确定 java 异常,但您可以尝试以下链接。 链接

© www.soinside.com 2019 - 2024. All rights reserved.