Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

v1.1 Web Services example help
 
carlbowden
Jr. Member
 
Total Posts:  2
Joined:  2008-06-17
 

Hi I have checked out the v1.1 and It seems very complete given the ‘alpha’ status, we done!

What i’m missing (I have seached the forms until I’m blue) with the Web Services API is how to get a list of resources,, this is what I’m doing (which could be where I’ve gone wrong, so please comment if I have… ;-) ), Magento is under the dir /shop.

- connecting to http://dev.serverurl.com/shop/api/?wsdl response with a nicely formatted WSDL file, great so far.
- login with this:

User-AgentMac OS XWebServicesCore.framework (1.0.0)
Content-Typetext/xml
Soapaction
urn:Mage_Api_Model_Server_HandlerAction
Host
dev.serverurl.com


<?xml version
="1.0" encoding="UTF-8"?>
  
<SOAP-ENV:Envelope
    xmlns
:xsd="http://www.w3.org/2001/XMLSchema"
    
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

      <
SOAP-ENV:Body>
        <
m:login xmlns:m="urn:Magento">
          <
username xsi:type="xsd:string">WS_user1</username>
          <
apiKey xsi:type="xsd:string">passwordkey</apiKey>
        </
m:login>

      </
SOAP-ENV:Body>
    </
SOAP-ENV:Envelope>

responds nicely with:  (headers removed)

<SOAP-ENV:Envelope
    xmlns
:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    
xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

    <
SOAP-ENV:Body>
        <
ns1:loginResponse>
            <
loginReturn xsi:type="xsd:string">kmm406p0r5d3iakg68qg6lrc74</loginReturn>
        </
ns1:loginResponse>
    </
SOAP-ENV:Body>

</
SOAP-ENV:Envelope>

which is also great, but when i request the list of resources for this login via:

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

    <
SOAP-ENV:Body>
        <
m:resources xmlns:m="urn:Magento">
            <
sessionId xsi:type="xsd:string">kmm406p0r5d3iakg68qg6lrc74</sessionId>
        </
m:resources>
    </
SOAP-ENV:Body>
    
</
SOAP-ENV:Envelope>

I get this result, as there are no other properties to use other than sessionid, thats all that is there.

<SOAP-ENV:Envelope
    xmlns
:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    
xmlns:ns1="urn:Magento"
    
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

    <
SOAP-ENV:Body>
        <
ns1:resourcesResponse>
            <
resourcesReturn SOAP-ENC:arrayType="xsd:ur-type[0]"
                
xsi:type="SOAP-ENC:Array" />
        </
ns1:resourcesResponse>
    </
SOAP-ENV:Body>

</
SOAP-ENV:Envelope>

Now it seem that this users role would therefore be locking them out, but this what the WS_user1 user’s got set to allow:

all/directory    
all
/directory/country    
all
/directory/region    
all
/customer    
all
/customer/create    
all
/customer/update    
all
/customer/delete        
all
/customer/address
all
/customer/address/create        
all
/customer/address/update        
all
/customer/address/delete        
all
/catalog        
all
/catalog/category        
all
/catalog/category/create        
all
/catalog/category/update        
all
/catalog/category/move        
all
/catalog/category/delete        
all
/catalog/category/product        
all
/catalog/category/product/assign        
all
/catalog/category/product/update        
all
/catalog/category/product/remove        
all
/catalog/product        
all
/catalog/product/create        
all
/catalog/product/update        
all
/catalog/product/delete        
all
/catalog/product/link        
all
/catalog/product/link/assign        
all
/catalog/product/link/update        
all
/catalog/product/link/remove        
all
/catalog/product/media        
all
/catalog/product/media/create        
all
/catalog/product/media/update        
all
/catalog/product/media/remove        
all
/cataloginventory        
all
/cataloginventory/update

I hope someone has had more luck, and may be able to point the way… ;-)\

I’m looking at this for a job in a few months where we need to join Drupal with magento and the SOAP service would seem to be an ideal way of doing that.

Kind regards
Carl.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matix
Jr. Member
 
Total Posts:  4
Joined:  2008-06-30
 

Have you had any luck on your issue?  We just installed the 1.1 beta and I’m particularly excited to see which web services are available and what we can do to utilize them.  I’m having trouble finding any documentation on the services however.

Thanks
Dennis

 
Magento Community Magento Community
Magento Community
Magento Community
 
carlbowden
Jr. Member
 
Total Posts:  2
Joined:  2008-06-17
 

No, I haven’t.

I simplly used the mage code in a durpal module to hook the users in to the mage user tables. I can see to get Drupal and Magento sessions working together we are going to need to get Drupal to use Magento’s sessions, from then on I’m hoping we can use the webservices to pull category and mini cart info over to Drupal.

I’m assuming everyone is very busi working on the 1.1 realsese, so i can understand, but it would really make a big difference if there was some samples of the webservice usage

Kind regards
Carl.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matix
Jr. Member
 
Total Posts:  4
Joined:  2008-06-30
 

Yeah, I imagine there will be some documentation as things become more mature/stable.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top