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

Page 1 of 2
Soap API (Web Services) not working after Upgrade
 
pableu
Jr. Member
 
Total Posts:  29
Joined:  2008-09-19
 

Hi,

I have a couple of custom php-scripts that use the SOAP-API. Since I upgraded to 1.3.0, they do not work anymore. Accessing <shop-url>/api/soap/?wsdl always returns SOAP-ERROR: Parsing WSDL: Couldn’t find <definitions> in ‘<shop-url>/index.php/admin/api/soap/index/wsdl/1/’.

<SOAP-ENV:Envelope>
  <
SOAP-ENV:Body>
    <
SOAP-ENV:Fault>
      <
faultcode>WSDL</faultcode
      
<faultstring>
        
SOAP-ERRORParsing WSDLCouldn't find <definitions> in '<shop-url>/index.php/admin/api/soap/index/wsdl/1/'
      </faultstring>
    </SOAP-ENV:Fault>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Accessing <shop-url>/index.php/admin/api/soap/index/wsdl/1/ direcly just asks me to login to the admin and then redirects to the admin-dashboard.

Does anybody have an idea what’s broken here and how to fix it? Purging /var/cache didn’t change anything.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

I’m getting this error too… Will post here if I find anything…

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

I have found this post where cclohman seems to have solved the issue. It is a workaround, but it seems to be a magento bug which depends on server configurations.

Hope this helps.

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Sorry about this infinite annoying posts in sequence thing, but i have just tried the fix i’ve mentioned above and it didn’t work. I have cleaned the cache, etc, etc… If someone has an answer for this, pls let me know.

Will start digging into the core’s code now.

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
pableu
Jr. Member
 
Total Posts:  29
Joined:  2008-09-19
 

Hi Gabriel grin

Did you see this Blog-Post about SOAP-Issues with PHP 5.2.6?
http://www.magentocommerce.com/blog/comments/soap-webservice-api-wsdl-issue-for-php-version-526/

I have PHP 5.2.0 on my server, but I’ll try if the fix still helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Hi Pableu,

Hadn’t seen that, and yes, my version is 5.2.6. =/

Will try the fix! Thanks! =)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

No luck for me here… still shows up the same error…

 
Magento Community Magento Community
Magento Community
Magento Community
 
pableu
Jr. Member
 
Total Posts:  29
Joined:  2008-09-19
 

Yep, same here, didn’t change a thing, no matter if I use http://your.domain/api/v2_soap?wsdl (as recommended in the blog-post) or http://your.domain/api/soap?wsdl

Too bad, I really need the API. I’m thinking about copying back my backups from before the update..

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Yeah, me too, none of the api versions worked. I’m trying to import my products from an old version, and can’t do it without the API.

I have created a bug report here. It is not assigned yet. Try adding a comment there, maybe it will make it more visible to the devs.

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
pableu
Jr. Member
 
Total Posts:  29
Joined:  2008-09-19
 

I got it working now.

Have you enabled Configuration -> Web -> URL Options -> Add Store Code to URLs ?

I had this set to yes.. as soon as I set it to “No”, all my old soap-stuff started working again (using the “old” soap URL /api/soap?wsdl).

For the moment, I have just disabled “Add Store Code to URLs” and added a RewriteRule to the .htaccess that redirects from the URLs with store-code to those without:

RewriteRule ^(de|fr)/(.*) /$2 [R=302,L] # redirect from <store-url>/de/some-stuff to <store-url>/some-stuff
 
Magento Community Magento Community
Magento Community
Magento Community
 
jfberroyer
Jr. Member
 
Total Posts:  11
Joined:  2008-10-15
 

Hello !
I have the same problem since an update.
I have let a comment in your bug repport.
I hope a solution will be found…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Yeah, i had the store code enabled, and disabling it made the problem disappear as well. Nice, but i still need the store code, hehehe… my url-keys are not global, so a simple rewrite rule won’t solve it…

Magento devs, can you pls shed some light on this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
pableu
Jr. Member
 
Total Posts:  29
Joined:  2008-09-19
 
Gabriel Queiroz - 01 April 2009 07:00 AM

Yeah, i had the store code enabled, and disabling it made the problem disappear as well. Nice, but i still need the store code, hehehe… my url-keys are not global, so a simple rewrite rule won’t solve it…

Have you tried it? I think if you rewrite it, it should also work with store-view-specific url-keys.

You could also try rewriting each store-code to ?__store=XX, e.g. from
http://www.store.com/en/productname.html to http://www.store.com/productname.html?__store=en

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Yes, that works… i’ve done it with the second rewrite, and it is allright… But i have actually found a better way of importing the products, so I’ll keep on using the store codes. The API is very slow for doing that…

Cheers!

 
Magento Community Magento Community
Magento Community
Magento Community
 
jfberroyer
Jr. Member
 
Total Posts:  11
Joined:  2008-10-15
 

It doesn’t work for me.
When I disable Add Store Code to URLs, I have no Store Code in Urls anymore, but I can’t swich store by adding ?__store=en.
And in your rewriting, how do you know which store code to add as get parameter if there is no store code in Urls anymore ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
pableu
Jr. Member
 
Total Posts:  29
Joined:  2008-09-19
 
jfberroyer - 05 April 2009 11:41 PM

When I disable Add Store Code to URLs, I have no Store Code in Urls anymore, but I can’t swich store by adding ?__store=en.

Oh, my bad, there should’ve been three underscores, so you should add ?___store=en

jfberroyer - 05 April 2009 11:41 PM

And in your rewriting, how do you know which store code to add as get parameter if there is no store code in Urls anymore ?

You don’t. You only need to rewrite from the /en/ to ?___store=en when a user enters your page via an external link. After that, the language is stored in the session and doesn’t need to be set for each page.

I only fixed this temporarily on our site, because I hope that this issue will be resolved soon.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2