cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 SOAP - .Net Integration xmlns issue

Magento 2 SOAP - .Net Integration xmlns issue

Hi guys,

 

I'm trying to write a wrapper for magento 2,

at the moment im encountering an issue with the soap request,

i have setup 2 different sites for testing purposes (magento2 & magento2_data)

 

after i generated the service reference when pointing to 1 of the sites, i could successfully login and get a token

but when i change the endpoint in my app.config/web.config file, i run into an error

 

Message = "Server returned an invalid SOAP Fault.  Please see InnerException for more details."

the message in InnerException is

Unbound prefix used in qualified name 'rpcSmiley TonguerocedureNotPresent'.

 

i narrowed it down to the soap envelope namespace which contains the endpoint,

 

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<integrationAdminTokenServiceV1CreateAdminAccessTokenRequest xmlns="http://mylocal:8085/magento2/soap/default?services=integrationAdminTokenServiceV1%2CcustomerCustomerRepositoryV1">
<username xmlns="">some-username</username>
<password xmlns="">some-password</password>
</integrationAdminTokenServiceV1CreateAdminAccessTokenRequest>
</s:Body>
</s:Envelope>

 

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<integrationAdminTokenServiceV1CreateAdminAccessTokenRequest xmlns="http://mylocal:8085/magento2_data/soap/default?services=integrationAdminTokenServiceV1%2CcustomerCustomerRepositoryV1">
<username xmlns="">some-username</username>
<password xmlns="">some-password</password>
</integrationAdminTokenServiceV1CreateAdminAccessTokenRequest>
</s:Body>
</s:Envelope>

 

my code for calling the service is as follows into my function to get the token

            using (Magento2WS.integrationAdminTokenServiceV1PortTypeClient svc = new Magento2WS.integrationAdminTokenServiceV1PortTypeClient())
            {
                var result = svc.integrationAdminTokenServiceV1CreateAdminAccessToken(new Magento2WS.IntegrationAdminTokenServiceV1CreateAdminAccessTokenRequest()
                {                    username = userName,
password = passWord });
retVal
= result.result; }

would anyone know if there is an option in magento2 which we could turn off/on to ignore the xmlns="url" ????