1

I'm currently working on a webapp that communicates with a magento 2 server. I tried to use the soap interface for the communication but it quickly turned out, that the soap api changed from Magento 1 to 2. One difference i stumbled across, is that when i create a new category for example, i have to add the attribute isActive to the request. In the past, i used is_active but by using it, i always got an error, saying "is_active" is missing. After changing is_active to isActive it worked. My problems with this are:

  1. I found out about the change by pure luck
  2. The error message from magento was absolutely misleading

In the magento 2 devdocs i only found a solid documentation for the rest-api with all possible requests and what to send in the request body. I guess the soap api uses similar request bodies, but now i can't be sure anymore and don't want to get lost while programming due to lack of documentation.

So does anybody know where i can find a truly solid soap api overview for magento 2? All i can find is: How to get an auth-token and an list of the services and functions, but no documentation of the needed request body etc.

2
  • Any reason why you are going for soap instead of rest API? Commented Mar 20, 2018 at 17:11
  • 1
    Thank you! The previous system was working with magento 1.x and i would have liked it, if i could have reused as much code as possible. Because right now i am just porting old functionalities
    – Karkan
    Commented Mar 20, 2018 at 21:56

1 Answer 1

1

You can get get endpoint properties of a soap call by doing

https://[YOUR_MAGENTO_SITE]/soap/[COUNTRY_CODE]/?wsdl&services=catalogCategoryRepositoryV1

Or

https://[YOUR_MAGENTO_SITE]/soap?wsdl&services=catalogCategoryRepositoryV1

In the above case you will get all of the list of elements. catalogCategoryRepositoryV1 is the a service name.

Have a look at this for more references. Alternatively you can use SoapUI for a better visual representation. You'll get something like this:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:gb="http://api-devmagento.endservices.info/gb/soap/gb?services=catalogCategoryRepositoryV1">
   <soap:Header/>
   <soap:Body>
      <gb:catalogCategoryRepositoryV1SaveRequest>
         <category>
            <!--Optional:-->
            <id>?</id>
            <!--Optional:-->
            <parentId>?</parentId>
            <name>?</name>
            <!--Optional:-->
            <isActive>?</isActive>
            <!--Optional:-->
            <position>?</position>
            <!--Optional:-->
            <level>?</level>
            <!--Optional:-->
            <children>?</children>
            <!--Optional:-->
            <createdAt>?</createdAt>
            <!--Optional:-->
            <updatedAt>?</updatedAt>
            <!--Optional:-->
            <path>?</path>
            <!--Optional:-->
            <availableSortBy>
               <!--Zero or more repetitions:-->
               <item>?</item>
            </availableSortBy>
            <!--Optional:-->
            <includeInMenu>?</includeInMenu>
            <!--Optional:-->
            <extensionAttributes/>
            <!--Optional:-->
            <customAttributes>
               <!--Zero or more repetitions:-->
               <item>
                  <attributeCode>?</attributeCode>
                  <value>?</value>
               </item>
            </customAttributes>
         </category>
         </gb:catalogCategoryRepositoryV1SaveRequest>
         </soap:Body>
        </soap:Envelope>
2
  • It didn't worked for me I am using SoapUi, and the Initial WSDL Url is not working there, given by you.
    – temper
    Commented Oct 18, 2019 at 4:50
  • @Himani probably because it depends per site configuration. Your one will most likely be yoursite.com/soap?wsdl&services=catalogCategoryRepositoryV1 Commented Oct 22, 2019 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.