NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Puzzled by responses *resolved*


Joined: 08 May 2006
Posts: 2
Reply with quote
Hello all

I am a newbie as far as NuSoap is concerned. I have implemented a few interfaces to the Amazon API and all seems to work well for most of the interfaces.

I am having a problem however when performing a recursive call to the Amazon "BrowseNodes" service. The call seems to work finr and I get a valid response message. Yet when I get the values of the response message the returned values are incorrect.

The response ( dumped in PHP ) looks like :

Code:
Array ( [OperationRequest] => Array ( [HTTPHeaders] => Array ( [Header] => Array ( [!Name] => UserAgent [!Value] => NuSOAP/0.7.2 (1.94) ) ) [RequestId] => 0BNCF2P0RGS2YWSRMBYQ [Arguments] => Array ( [Argument] => Array ( [!Name] => Service [!Value] => AWSECommerceService ) ) [RequestProcessingTime] => 0.00836706161499023 ) [BrowseNodes] => Array ( [Request] => Array ( [IsValid] => True [BrowseNodeLookupRequest] => Array ( [BrowseNodeId] => 712544 [ResponseGroup] => BrowseNodeInfo ) ) [BrowseNode] => Array ( [BrowseNodeId] => 712544 [Name] => Compaq [Children] => Array ( [BrowseNode] => Array ( [BrowseNodeId] => 13630101 [Name] => Processor Speed ) ) ) ) )


As can be seen at the end of the XML string are two elements called "BrowseNodeIs" and "Name".

The problem I have is that I can reliably retrieve this information for most of the calls to the API service, but after about 20 calls the values returned seem to get corrupted.

Instead of "13630101" and "Processor Speed" - I get "1" and "1" returned

Any ideasa ?.

Thanks
Richard[/code]
View user's profileFind all posts by benbunSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7901
Reply with quote
hmm, what was the raw xml response?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 08 May 2006
Posts: 2
Reply with quote
Looks like I have solved the problem. The cause was due to my PHP code used to parse the XML returned.

When the API returns a BrowseNode response that has many "nodes" then the nodes are returned in an array, however when only one "node" is returned it is not in an array. As I was blindly expecting an array to be returned then my code was etting incrrect responses.

Lots of lessons learnt from this one !.

Richard
View user's profileFind all posts by benbunSend private message
Puzzled by responses *resolved*
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic