This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Can Web Service give different responses to the same request?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm facing a strange problem. For the same request, my webservices is giving me different responses . Can anyone tell me the reason behind this strange behavior of web services? I have cleared the cache also but still the problem persists .
Please help me.

Thanks in advance,
Srinivas
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on the service in question. If the answer depends on parameters that are not always the same (time of request, client IP address, random numbers, etc.) then obviously the response can be different.

Did you write this service? If so, have you debugged it to see where the response handling starts deviating from what you think it should be?
 
Srinivas Yellapantula
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is that it's giving 2 responses for the same request (same paramaters). For example, when i give paramters: category: cricket, it's giving me tennis category output sometimes !! We never faced this problem for the last 2 years. All of a sudden, it's behavior changed . We havent written the services, some 3rd party has written it for us.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt that the code mutated on its own.

Probably changes in the way it is being used has revealed a coding error.

I would bet on improper use of instance variables to hold data related to a single client request mixing up results from multiple requests.

Bill
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could be a host of things

1. Instance variables like Bill suggested
2. Some sort of incorrect caching
3. Wrong mapping of categories to their category IDs
4. May be the service never received / recognized the category and defaults to tennis
5. Your servers are behind a cluster and one of the nodes behaves badly

I could go on. You need to provide us with more information. What does the RAW request look like ? Debug the service or introduce log statements to print out the category that it receives. What does the category look like ?
 
Srinivas Yellapantula
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Bill: Could you kindly please explain a bit more?
@ Deepak: Could you please what incorrect caching is and what leads to it? Also throw some light on the 5th point you mentioned.

Web services worked fine for the past 2 years. This problem started recently . For same request, we are getting good, bad and zero response at times!

Category doesn't default to tennis, i just quoted an example. Not only tennis, sometimes some other sports items are returned by webservice for cricket or other sport. The problem is found for only one request method and when it's parameters are given as category and cricket or football as of now.

The request looks like:

<sch: getItemList>
<sch:filterName>category</sch:filterName>
<sch:filterValue>cricket(or football)</sch:filterValue>
.
.
.
.
</sch: getItemList>

The entries in the logs gives us the query formed for the request. When i tried accessing that link, it's showing good response all the time.

What could be the reason?

Thanks,
Srinivas
 
Evildoers! Eat my justice! And this tiny ad's justice too!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic