Avoiding De-Serialization

M

Mark Oueis

I've got what i think is a tough question. I hope someone can help me.

We have data entering our software through a Web Service. It is then
directly (without any processing whatsoever) forwarded to a Windows
Service through remoting. The problem is this: when lots of data is
coming in, its being de-serialized by the Web Service, then serialized
again to be sent to the windows Service, then de-serialized by the
Windows Service to be used.

Is there any way i can just avoid the de-serialization process of the
Web Service? Can i just keep the data serialized and pass it through
remoting to the Windows Service?

Thanks

Mark
 
D

Dan Rogers

Hi Mark,

Yes, there is a way. You can process the incoming request directly, either
by building a port listener that does a passthrough, or by hosting your
first service end-point on a Biztalk Server 2004 port. The data will still
get copied as it moves thru any interim, but you can avoid deserializing
twice by keeping the data as XML. An advantage of using a Biztalk Server
2004 is that you can add in validation, signature verification,
transformation, etc.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 
M

Mark Oueis

Thanks, we might need to use one of those methods.

I was thinking though, is there any need to have a Windows Service at
all? Can we not simply use the ASP .NET service for all our needs?

Basically the question boils down to this. What can we do in the
windows service that cannot be done in the ASP .NET service.

Thanks again

Mark
 
D

Dan Rogers

If you choose to use the ASP.net infrastructure, you won't be able to avoid
the repeated serialization/deserialization since this is a part of the
ASP.net stack. For more information on this, look at how web service
extensions work - the full deserialization stack is discussed in the
articles on web service extensions.

If you write your own port reader or HTTP handler (and thus use IIS as a
service facade), you have full control. The WSE 2.0 toolkit also comes
with the infrastructure you need to do this kind of work, so that is an
option as well.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 
M

markoueis

What do you think of avoiding the windows service all together and
moving everything to the web application.

I have seen techniques to keep the application alive (by making the
application make requests to itself before the session ends)

Mark
 
D

Dan Rogers

Hi Mark,

I'm not sure what it is that you are trying to gain. Of course, you could
develop a number of means (including an interactive application that just
opens a port and listens). But the purpose of creating tools and standards
based infrastructure is to get you out of the game of implemeting the
infrastructure pieces (very error prone) and into the application business.

Does this make sense?

Dan
--------------------
 
M

markoueis

I'm trying to avoid double serialization.

One way of doing that is to avoiding having to send the information to
my windows service and just processing the infromation at the web
application directly. What limitations does this have?

Mark
 
D

Dan Rogers

Hi Mark,

None on the surface of things. In essence what you are doing right now
sounds like you've built a web service wrapper on a remoting application.
I'd consider refactoring both so that the logic you want to share is in a
DLL that both the web servce and the windows service (your remoting host
for your application) can directly use the shared code.

Dan
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top