Client side Soap extension

G

Guest

Hi,
I am calling Java Web Services from my Pocket PC application using .NET CF
2.0 SP 2, VS.NET 2005.
How can I write a soap extension at the client side and manipulate the
deserialization process?
Thanks,
Naresh
 
G

Guest

Firstly you will need to create a class and derive it from the SoapExtension
class. In this class (depending on what you are trying to achieve) you will
need to implement the following members:

GetInitializer()
Initialize()
ProcessMessage()

The ProcessMessage() method is most probebly the most important method and
that you will want to implement as this gets called for messages inbound,
outbound before and after serialization events take place.

After you have done this you will need to create a class that derives from
SoapExtensionAttribute as this class will tell .NET the priority and the
SoapExtension to use when it serializes and deserializes the XML message. In
addition this class will be used to edit your web service proxy class.

You'll need to edit the web service proxy class that is generated from the
result of running WSDL.exe against your Java Web Service. My advice here
would be to create the proxy class using WSDL rather than right clicking Web
References then add this class as a library which your CF code references.
The benefit to this is you will not lose your changes when regenering your
web reference as you will need to specify your SoapExtensionAttribute class
you created and tag each web method as defined in the proxy class that you
are interested in applying your SoapExtension to.

Note: SoapExtensionAttribute.TypeId property is not supported in CF.
 

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

Top