cancel
Showing results for 
Search instead for 
Did you mean: 

I am unable to load web services=customerCustomerRepositoryV1

I am unable to load web services=customerCustomerRepositoryV1

Hello Techies,

 

I am unable to load soap Customer Repository services 

soap/default?wsdl&services=customerCustomerRepositoryV1

at magento 2.1 version, 

 

Giving,

<env:Reason>
<env:Text xml:lang="en">Consumer is not authorized to access %resources</env:Text>
</env:Reason>
<envSmiley Very Happyetail>
<m:GenericFault>
<m:Trace>
<![CDATA[#0 /var/www/html/dev3_sokolin/vendor/magento/module-webapi/Model/AbstractSchemaGenerator.php(104): Magento\Webapi\Model\Soap\Wsdl\Generator->getAllowedServicesMetadata(Array) #1 /var/www/html/dev3_sokolin/vendor/magento/module-webapi/Controller/Soap.php(131): Magento\Webapi\Model\AbstractSchemaGenerator->generate(Array, 'http', '00.00.', 'http://000.00.) #2 /var/www/html/dev3_sokolin/var/generation/Magento/Webapi/Controller/Soap/Interceptor.php(24): Magento\Webapi\Controller\Soap->dispatch(Object(Magento\Framework\App\Request\Http)) #3 /var/www/html/dev3_sokolin/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Soap\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #4 /var/www/html/dev3_sokolin/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch() #5 /var/www/html/dev3_sokolin/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #6 {main}]]>
</m:Trace>
 
May any one resolved this,
 
Thank you,
Ravi Sankar
5 REPLIES

Re: I am unable to load web services=customerCustomerRepositoryV1

Hello,

after upgrade to 2.1 version, I can see same error "Consumer is not authorized to access %resources" when I trying load http://127.0.0.1/soap/default?wsdl=1&services=catalogProductRepositoryV1 or customerCustomerRepositoryV1 or another services. It worked fine, before upgrade to 2.1. Only customerAccountManagementV1 works fine.

Any ideas how to solve this issue?

 

thanks,

Ivan

 

Re: I am unable to load web services=customerCustomerRepositoryV1

Hi Ivan,

try the following process to consume.

 

$url = ' http://127.0.0.1/soap/default?wsdl=1&services=catalogProductRepositoryV1';
$opts = array(
'http'=>array(
'header' => 'Authorization: Bearer <Instance Magento Token>'
)
);
$context = stream_context_create($opts);
$client = new SoapClient($url, array('soap_version'=>SOAP_1_2, 'stream_context'=>$context));
// $soapResponse = $client->catalogProductRepositoryV1GetList(array('searchCriteria'=>''));

 

Thanks,

RaviSankar

 

Re: I am unable to load web services=customerCustomerRepositoryV1

Hi Ravi,

 

thanks, URL http://127.0.0.1/soap/default?wsdl=1&services=catalogProductRepositoryV1 works, when I allowed Anonymous Guest Access in menu Stores > Configuration > Services > Magento Web API > Web API Security. But some API URLs e.g.  http://127.0.0.1/soap/default?wsdl&services=salesOrderRepositoryV1 doesn't works (I can see error 'Consumer is not authorized to access %resources') in the M2.1, but works fine in the M2.0 http://magento2.demo.ubertheme.com/soap/default?wsdl&services=salesOrderRepositoryV1 . I need to access this URL directly (before authentication), to be able add Service Reference in C#, in the Visual Studio 2016.

 

thanks,

Ivan

Re: I am unable to load web services=customerCustomerRepositoryV1

Hi Ivan,

 

To consume third party systems like C# applications. Try to download wsdl by passing token keys then you will be utilize respective methods of wsdl.

 

Thanks

Ravi 

Re: I am unable to load web services=customerCustomerRepositoryV1


RaviSankar wrote:

Hi Ivan,

 

To consume third party systems like C# applications. Try to download wsdl by passing token keys then you will be utilize respective methods of wsdl.

 

Thanks

Ravi 


Unfortunately it doesn't work like that, or at all, on Mage 2.1. The devs hid the WSDL behind an oAuth, which breaks the standard I think, so C# and I assume Java cannot create the intermediate objects to even start programming. The devs refuse to see it as a problem:

 

https://github.com/magento/magento2/issues/5330