Bo.
Bo.

Reputation: 675

Magento REST API fault: invalid xml

looks like my question is the same as this one: Magento Rest Api Invalid XML but it is not still answered..

I just installed magento 1.9 with sample data on my localhost and trying to test REST API. I setted REST roles and REST attributes to ALL in admin panel. But when I trying to enter in browser the following URL: http://magentohost/api/rest/products?limit=2

I receive the response:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <script/>
  <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
      <faultcode>Sender</faultcode>
      <faultstring>Invalid XML</faultstring>
    </SOAP-ENV:Fault>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

error_log is empty,

access_log:

GET /magentohost/api/rest/products?limit=2 HTTP/1.1" 500

Looks like I missed something in settings.. Thanks for any help!

Upvotes: 3

Views: 3109

Answers (3)

voxoid
voxoid

Reputation: 1289

In the case of a Magento soap client I generated for .Net Core C# (using this), I just had to create the client using the default constructor rather than providing the endpoint and binding myself. The default constructor sets up many parameters of the client, including the endpoint URL, security mode, allow cookies, etc.

Upvotes: 0

CarComp
CarComp

Reputation: 2016

In case you are having a problem with getting the wsdl, make sure you have ?wsdl at the end of your url. For example:

https://dev2.mydomain.org/index.php/api/v2_soap/index/

Will say "Invalid XML" but

https://dev2.mydomain.org/index.php/api/v2_soap/index/?wsdl

will work.

Upvotes: 0

Brian Kimball
Brian Kimball

Reputation: 382

You will need to edit your .htaccess file. On line 12 of .htaccess uncomment the line "Options -Multiviews".

Upvotes: 5

Related Questions