Hi Forum,
We have been using Magento version 1.7. The API catalogInventoryStockItemList worked just fine.
In version 1.7 we used:
$url = MY_SITE_URL."/index.php/api/v2_soap?wsdl=1";
$client = new soapclient( $url, $options );
$sessionId = $client->login( MY_USER, MY_KEY );
$list = $client->catalogInventoryStockItemList( $sessionId, MY_SKU_LIST );
This gave us a list of inventory for all SKUs, specified in last function.
NOTE:
-- MY_SITE_URL - real path to site.
-- MY_SKU_LIST - list of SKUs, registered in Magento, we want to get inventory. eg. array( 'SKU1', 'SKU2' )
-- MY_USER and MY_KEY - Magento user name and password, required for login
-------------------
We installed version 2.0 and want to use the web-service to get inventory.
First we tried to use web-service: catalogProductRepositoryV1
Used url:
$url = MY_SITE_URL."/soap?wsdl&services=catalogProductRepositoryV1";
See wsdl file and list of available functions:
[0] => CatalogProductRepositoryV1SaveResponse catalogProductRepositoryV1Save(CatalogProductRepositoryV1SaveRequest $messageParameters)
[1] => CatalogProductRepositoryV1DeleteByIdResponse catalogProductRepositoryV1DeleteById(CatalogProductRepositoryV1DeleteByIdRequest $messageParameters)
[2] => CatalogProductRepositoryV1GetListResponse catalogProductRepositoryV1GetList(CatalogProductRepositoryV1GetListRequest $messageParameters)
[3] => CatalogProductRepositoryV1GetResponse catalogProductRepositoryV1Get(CatalogProductRepositoryV1GetRequest $messageParameters)
However; We CAN NOT use any of these functions
( Tried to do same with catalogInventoryStockRegistryV1
- as far as we understand, it is used to get inventory )
We CAN NOT even login via SOAP:
function "login" is not in list of available functions.
If we try just to call , error is:
Fatal Error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from MY_SITE_URL.'/soap/default?services=catalogProductRepositoryV1&wsdl=1' : failed to load external entity MY_SITE_URL."/soap/default?services=catalogProductRepositoryV1&wsdl=1" in MY_PATH.magento20.php:36 Stack trace: #0 MY_PATH.magento20.php(36): SoapClient->__call('catalogProductR...', Array) #1 MY_PATH.magento20.php(36): SoapClient->catalogProductRepositoryV1GetList()
Note.
-- magento20.php - is standalone PHP file. We use to connect to Magento, installed on our server.
-------------------------
-- What can the problem be?
-- Why can we not login via SOAP ?
-- Can someone provide a working example script using version 2.0 web-services?
Thank you in advance.
Solved! Go to Solution.
issue was. server was closed by htaccess.
We are looking for help with the above issue.
Any recommendations will be appreciated.
Additionally;
We are looking for part time developer who are experiences in all MAGENTO aspects... the Magento API and php, soap, etc.
(4-5 hours per week)
Thank you
What can we do to get by this?
any suggestions would be greatly appreciated
Hi,
Can you please post your M2 code so we can take a look at it?
There is no login() operation in M2 when using web-services. You must provide the Authorization Header with the Access Token.
Regards
Responce is:
SoapFault Object
(
[message: protected] => SOAP-ERROR: Parsing WSDL: Couldn't load from 'OUR SERVER/magento/soap/default?services=catalogInventoryStockRegistryV1&wsdl=1' : failed to load external entity "OUR SERVER/magento/soap/default?services=catalogInventoryStockRegistryV1&wsdl=1"
[string: Exception: private] =>
[code: protected] => 0
[file: protected] => OUR FILE PATH
[line: protected] => 19
[trace: Exception: private] => Array
(
[0] => Array
(
[file] => OUR FILE PATH
[line] => 19
[function] => __call
[class] => SoapClient
[type] => ->
[args] => Array
(
[0] => catalogInventoryStockRegistryV1GetStockItemBySku
[1] => Array
(
[0] => Array
(
[productSku] => JSP1
)
)
)
)
)
Hi, I am having the same issue. Can you please expand on what you meant by "issue was. server was closed by htaccess."
Thanks
Hi
We are having same issue what is the answer please?
Thanks
Rob
Same issue here.
Is there anybody out there nock nock.
I fixed the same issue by uncommenting this in the .htaccess
########################################### ## uncomment next line to enable light API calls processing #RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L] ############################################
so above becomes
########################################### ## uncomment next line to enable light API calls processing RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L] ############################################