Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Web Service design with gSOAP

Posted on 2006-03-31
5
Medium Priority
?
1,203 Views
Last Modified: 2008-07-16
I am developing a Web Service application using gSOAP. The application is transaction based - I know, not recommended for Web Services, just following orders. The client supports an RF network of PDAs. Typically, a handful (6?) PDAs running a query to a host DB, each PDA transmitting a request evey 3 seconds. Traffic could be considerably higher, depending on customer - out of our control.

Question I have is this, should I treat each WS query as an independent query (open gSOAP, send/receive query, close gSOAP) or should I open a session and not close gSOAP until the user logs out. ie open gSOAP, run several queries, close gSOAP. Not sure what the SOA says about this. How much overhead is involved in opening and closing a SOAP transaction?
0
Comment
Question by:softechnics
3 Comments
 
LVL 61

Accepted Solution

by:
Julian Hansen earned 100 total points
ID: 16348766
I don't consider myself an expert on this but from a common sense point of view I would say is close the connection after each call.

What you could do is have 3 service calls.

The first when a user logs on - this returns a sessionID to the PDA. In subsequent calls this session ID is used for each transaction (the second). In this way you give the semblance of being permantly connected without having to be permanently connected.

When the user logs off the third service is called with the sessionID which invalidates the ID (closes it). Additionally you can have a timeout on the server where a sessionID is valid for a given time period unless it is refresshed with call number 2.

You could combine these into a single webservice and control the types (logon, refersh and logoff) with parameters.

Just my thoughts on the matter - can'ts say the thought of keeping the session open for that long appeals to me.
0
 
LVL 12

Assisted Solution

by:OnegaZhang
OnegaZhang earned 100 total points
ID: 16349056
I think a global gsoap connection is more efficient than creating connection each time. The overhead of opening SOAP transaction is the same as TCP socket connection.
Another problem is about CLOSE_WAIT state of socket, ie, even if a socket is closed, but the socket is not released immediately by OS, it is in CLOSE_WAIT state for a few minutes (you can observe this by "netstat" command). If there are too many sockets in "CLOSE_WAIT" state, you may not able to create new socket.
You may use keep alive mode : SOAP_IO_KEEPALIVE
0
 

Author Comment

by:softechnics
ID: 16698831
I agree with splitting the points, even though the answers were totally opposite. It appears there is no hard and fast answer - just opinions. I went with the open/close for each query. Makes for a simpler design.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question