Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : Receiving events from SOAP web services. (Another not-DROD development question.)
New Topic New Poll Post Reply
Poster Message
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Receiving events from SOAP web services. (0)  
Anyone know something about SOAP and web services?

I have a project (not DROD or Caravel-related, in case it matters to you) where I need to serve an API with some SOAP objects from an intranet server using HTTP as the transport. The project is somewhat complicated by the fact that I'm only allowed to use SOAP for the API. The whole point of making the API with SOAP is so that it's easily usable in other companies that have different platforms and programming languages around.

I want to write a SOAP service that will notify the SOAP client when certain events occur. I think my options go like this:

* Write a polling method to check for and receive events. To improve on the poor efficiency of this approach, write the method to wait a long period of time, i.e. several minutes, without receiving an event before returning.

* Require the client-side developer to open a host socket that will receive events or at least notification of events from the SOAP server. In this case, the protocol used has nothing to do with SOAP.

Both approaches are pretty bad. Polling is inefficient and leads to poor performance. And tacking on an extra communication protocol will make my API harder to understand and use.

Any other options? I'm hoping there's some aspect of SOAP or some widely-used extension that solves the event-notification problem.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
11-16-2006 at 06:23 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
RoboBob3000
Level: Smitemaster
Avatar
Rank Points: 1978
Registered: 10-23-2003
IP: Logged
icon Re: Receiving events from SOAP web services. (+3)  
I say you should pass on it. Nothing complicates things more than snakes on a plane.

____________________________
http://beepsandbloops.wordpress.com/
11-17-2006 at 03:29 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: Receiving events from SOAP web services. (+1)  
You know, this is probably the dumbest thing you've ever heard (except, by now "Where's the November Illumination?", which you've probably heard way to much that it's dumb), but I've found that sometimes things that look dumb can trigger a much better idea, so here goes:

Why not have it so that service gives your program a reference to an address in memory so that the program can look at that variable, and if it's changed then it knows to ask for an event from the service. It's probably dumb to deal with two different programs attempting to deal with the same area in memory, but in theory it would allow for a very quick and effective way to exchange data - just check one variable each time the system loops or something similar, and then only if it changed do you modify it.

Now that's probably dumb, and hard to implement, impossible in some languages. But it's one of those things that might get you spurred in the right direction.
11-17-2006 at 11:45 PM
View Profile Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Receiving events from SOAP web services. (0)  
coppro wrote:
Why not have it so that service gives your program a reference to an address in memory so that the program can look at that variable, and if it's changed then it knows to ask for an event from the service.
Coppro, the trouble with this is that the web service can't write to a memory address given to it by a client. The client runs in a completely different address space to which the web service has no access. In fact, the client is often on a different computer than the web service.

Update on my problem...

In my research, I've found there is one extension that might address my problem (WS-Address) in the future.

I've shifted my approach to trying to explain the limitations of SOAP to my boss so that he will either accept them or choose a different way to implement the API. SOAP is very popular now, but I think it's popularity makes some people choose it as a solution when they should be doing something else.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
11-18-2006 at 01:31 AM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: Receiving events from SOAP web services. (0)  
ErikH2000 wrote:
coppro wrote:
Why not have it so that service gives your program a reference to an address in memory so that the program can look at that variable, and if it's changed then it knows to ask for an event from the service.
Coppro, the trouble with this is that the web service can't write to a memory address given to it by a client. The client runs in a completely different address space to which the web service has no access. In fact, the client is often on a different computer than the web service.

Update on my problem...

In my research, I've found there is one extension that might address my problem (WS-Address) in the future.

I've shifted my approach to trying to explain the limitations of SOAP to my boss so that he will either accept them or choose a different way to implement the API. SOAP is very popular now, but I think it's popularity makes some people choose it as a solution when they should be doing something else.

-Erik
I guess it was a dumb idea after all. ;)

Ah. I guess I misread. I assumed you meant a local service, but then again thereīs probably oodles of ways to deal with that. But an efficient way to do this over a network? Man, thatīs tough. I can think of a number of ways you could do this, but none of which are really doable. I agree with your decision to attempt to explain the limits to your boss - itīs probably a very good idea. But even if you didnīt use SOAP, how would you handle event notification? I canīt think of an efficient way, other than oodles of HTTP requests, or a poller as you already mentioned. The only other thing I can think of is multithreading - run a function that can then communicate easily with the client and check it whenever needed. But then, since youīve been asked to use HTTP, I donīt really see what can be done. It would be easy if you could open another port, but that seems unlikely. Any more and I canīt help you, because I really donīt know enough about SOAP.
11-18-2006 at 02:51 AM
View Profile Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Receiving events from SOAP web services. (0)  
coppro wrote:
But even if you didnīt use SOAP, how would you handle event notification?
I'd set up a host on the client that receives incoming socket (TCP/IP) connections from the service. To get past polling inefficiency this is really the only thing you can do, because anything that is connecting to the service to find out about events is just another type of polling.

So then the question becomes, what protocol does the client host use when it hears from the SOAP service? It's not a hard problem to solve if you can just write whatever you want from scratch, but I can't do that. My limitation is that customers on different operating systems/languages must be able to receive the events. So if I implement some really nice client event collection in C or Java or PHP or NiftyLanguageX, then my customer must be using that same language or have some kind of glue between his language and my executables.

If, on the other hand, my services are purely accessible by SOAP, then I'm making a reasonable request of the customer to use a popular, well-supported interface. Ideally, there'd be a bunch of popular SOAP client-side toolkits out there supporting some event notification or "callback" standard. But that hasn't happened yet.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
11-18-2006 at 03:45 AM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : Receiving events from SOAP web services. (Another not-DROD development question.)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.