Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 24-05-08
Registered User
 
Join Date: Jan 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
mjp3000 is an unknown quantity at this point
  SOAP - PHP5 native and nuSOAP

Righto, I'm having a bit of soap trouble here.

I've got a site calling a merchant's web service. It's all set up using nusoap and works... ish.

The main problem I've got is performance, and the odd rogue response. Performance-wise, it's incredibly slow. Shockingly slow. I'm sure a fair chunk of this is down to the merchant's server, but I am pretty sure that nusoap isn't helping. Rogue response-wise, maybe every 1 in 10 calls I'm making are returning really odd results. Looking at the resquest and response, the response coming back is duff - it's not a processing problem at my end. Refreshing the page loads results perfectly (probably due to query and response being cached at merchant end). I'm assuming that the server is taking so long that it's crapping out and sending me duff responses, but by the time I've refreshed it's had enough time to properly complete the initial query.

So, after beta testing my site and not being happy with the results, I thought I'd pick apart the nusoap stuff and replace with php's native soap client.

I'm a bit confused by this - the data I'm getting back if one humongous string, containing the entire xml soap response, within an object. Is that normal? I've never used PHP5's soap client before, and tutorials show the data nicedly parsed and formatted. I'm not supposed to be getting a string of raw xml am I?

Anyone got any ideas about PHP5's soap? Or has anyone got any idea performance tips for nusoap?

Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 24-05-08
tbp tbp is offline
Registered User
 
Join Date: Dec 2006
Posts: 1,894
Thanks: 0
Thanked 6 Times in 6 Posts
tbp is an unknown quantity at this point
  Re: SOAP - PHP5 native and nuSOAP

I`ve had problems in the past with nuSoap and never used it again, it was corrupting data which was causing problems interacting with the webservice.

It does sound right coming through in one string though. Webservices are nothing fancy, they just transfer data in the XML format. You send over the data you want to query, then send back and XML doc containg the data. It's down to you at your end to process the XML document and parse it into a manageable format.

Just use the inbuilt XML functions in PHP, which make this really easy:

PHP: SimpleXML - Manual
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 25-05-08
Registered User
 
Join Date: Jan 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
mjp3000 is an unknown quantity at this point
  Re: SOAP - PHP5 native and nuSOAP

Cheers for that. Reason why I was confused was that nuSoap returned everything as a multi-dimensional associative array, PHP soap just returned a string of xml. I was hoping PHP soap would handle it for me.

As regards the other problem I had - the dodgy responses. I've discovered that the page is rendering before the soap response has been fully received. The visible output on the screen is messed up, but if I leave it a few more seconds and view source, I see what is perfectly formatted HTML as it should be...

Any ideas on how I can get all php scripts to wait until the soap response has been fully received and processed? (short of putting "sleep(45);" in!) It seems my foreach loops to present the data are kicking in before the data is ready to be presented.

I've tried disabling, enabling and incrasing the size of the output_buffer, but no difference. That's about as far as my investigation has takem me thus far.

Cheers!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 25-05-08
Registered User
 
Join Date: Jan 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
mjp3000 is an unknown quantity at this point
  Re: SOAP - PHP5 native and nuSOAP

Ah, for flip's sake!

After troubleshooting the performance and duff responses for hours, I've made a discovery. It's not me, it's Affiliate Future's system! Trying the xml queries directly on their site takes just as long and returns just as many duff responses. Entered the parameters for a flight to Paris next week - returned no results after about 10 seconds. Refreshed the screen, got 30 results after about 20 seconds. Refreshed again, got about 50 results after about 5 seconds.

If it's that bad running on their own server, at least it means that my code was good and nusoap was working correctly! ha! What a waste of an evening.

I'm tempted to ask AF to look at it, but I'm more tempted to shift my business elsewhere. I've been less than impressed with them since I signed up with them, and this is the straw that broke the Matt's back. Literally. My back kills after hunching over my PC all evening.

sigh...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7