473,466 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Weird Soap Extension Problem

Hi,

I'm writing a simple soap extension for a webservice I developed (without
the use of an extension the webservice works perfect).
The extension is registered through the web.config files of my webservice
and my application.
In my extension I override the Chainstream method and implement the abstract
methods (GetInitializer, Initialize and ProcessMessage)

my chainstream method:
Stream _Original;
Stream _Chainned;

public override Stream ChainStream( Stream stream )
{
_Original = stream;
_Chainned = new MemoryStream();
return _Chainned;
}

my GetInitializer methods return null.
The processMessage (simplified) function:

public override void ProcessMessage(SoapMessage message)
{
switch (message.Stage)
{
case SoapMessageStage.BeforeSerialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
BeforeSerialize");
else
System.Diagnostics.Debug.WriteLine("Server
BeforeSerialize");
break;
case SoapMessageStage.AfterSerialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
AfterSerialize");
else
System.Diagnostics.Debug.WriteLine("Server
AfterSerialize");
break;
case SoapMessageStage.BeforeDeserialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
BeforeDeserialize");
else
System.Diagnostics.Debug.WriteLine("Server
BeforeDeserialize");
break;
case SoapMessageStage.AfterDeserialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
AfterDeserialize");
else
System.Diagnostics.Debug.WriteLine("Server
AfterDeserialize");
break;
}
}

So far the introduction, my problem is the following:
When I register the extension on both the client and the server and set a
breakpoint on the line "Server BeforeDeserialize",
the _Original and _Chainned variables are null =no soap message is
available.
When I register the extension on only the server then the two variables are
also null but when I then change the ChainStream method to
public override Stream ChainStream( Stream stream )
{
if(stream.GetType().FullName="System.Web.HttpInput Stream")
return stream;
_Original = stream;
_Chainned = new MemoryStream();
return _Chainned;
}

everything works perfect for the server side.

I've tried a lot of different things but nothing seems to resolve my
problem.
It looks like I'm unable to send the soap request from my client to my
server, in "Client AfterSerialize" everything is perfect but in "Server
BeforeDeserialize" no message has been received.

Is there anyone who knows what I'm doing wrong?

Thx in advance

Frederik
Oct 19 '06 #1
2 4016
Hi,

I'm writing a simple soap extension for a webservice I developed (without
the use of an extension the webservice works perfect).
The extension is registered through the web.config files of my webservice
and my application.
In my extension I override the Chainstream method and implement the abstract
methods (GetInitializer, Initialize and ProcessMessage)

my chainstream method:
Stream _Original;
Stream _Chainned;

public override Stream ChainStream( Stream stream )
{
_Original = stream;
_Chainned = new MemoryStream();
return _Chainned;
}

my GetInitializer methods return null.
The processMessage (simplified) function:

public override void ProcessMessage(SoapMessage message)
{
switch (message.Stage)
{
case SoapMessageStage.BeforeSerialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
BeforeSerialize");
else
System.Diagnostics.Debug.WriteLine("Server
BeforeSerialize");
break;
case SoapMessageStage.AfterSerialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
AfterSerialize");
else
System.Diagnostics.Debug.WriteLine("Server
AfterSerialize");
break;
case SoapMessageStage.BeforeDeserialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
BeforeDeserialize");
else
System.Diagnostics.Debug.WriteLine("Server
BeforeDeserialize");
break;
case SoapMessageStage.AfterDeserialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
AfterDeserialize");
else
System.Diagnostics.Debug.WriteLine("Server
AfterDeserialize");
break;
}
}

So far the introduction, my problem is the following:
When I register the extension on both the client and the server and set a
breakpoint on the line "Server BeforeDeserialize",
the _Original and _Chainned variables are null =no soap message is
available.
When I register the extension on only the server then the two variables are
also null but when I then change the ChainStream method to
public override Stream ChainStream( Stream stream )
{
if(stream.GetType().FullName="System.Web.HttpInput Stream")
return stream;
_Original = stream;
_Chainned = new MemoryStream();
return _Chainned;
}

everything works perfect for the server side.

I've tried a lot of different things but nothing seems to resolve my
problem.
It looks like I'm unable to send the soap request from my client to my
server, in "Client AfterSerialize" everything is perfect but in "Server
BeforeDeserialize" no message has been received.

Is there anyone who knows what I'm doing wrong?

Thx in advance

Frederik
Probably you dont need to override the chainstream,

void Copy(Stream from, Stream to)
{
TextReader reader = new StreamReader(from);
TextWriter writer = new StreamWriter(to);
writer.WriteLine(reader.ReadToEnd());
writer.Flush();
}

try this..

Posted from http://www.topxml.com/renntp using reNNTP: the website based NNTP reader.
Nov 3 '06 #2
Hi,

I'm writing a simple soap extension for a webservice I developed (without
the use of an extension the webservice works perfect).
The extension is registered through the web.config files of my webservice
and my application.
In my extension I override the Chainstream method and implement the abstract
methods (GetInitializer, Initialize and ProcessMessage)

my chainstream method:
Stream _Original;
Stream _Chainned;

public override Stream ChainStream( Stream stream )
{
_Original = stream;
_Chainned = new MemoryStream();
return _Chainned;
}

my GetInitializer methods return null.
The processMessage (simplified) function:

public override void ProcessMessage(SoapMessage message)
{
switch (message.Stage)
{
case SoapMessageStage.BeforeSerialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
BeforeSerialize");
else
System.Diagnostics.Debug.WriteLine("Server
BeforeSerialize");
break;
case SoapMessageStage.AfterSerialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
AfterSerialize");
else
System.Diagnostics.Debug.WriteLine("Server
AfterSerialize");
break;
case SoapMessageStage.BeforeDeserialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
BeforeDeserialize");
else
System.Diagnostics.Debug.WriteLine("Server
BeforeDeserialize");
break;
case SoapMessageStage.AfterDeserialize:
if(message is System.Web.SoapClientMessage)
System.Diagnostics.Debug.WriteLine("Client
AfterDeserialize");
else
System.Diagnostics.Debug.WriteLine("Server
AfterDeserialize");
break;
}
}

So far the introduction, my problem is the following:
When I register the extension on both the client and the server and set a
breakpoint on the line "Server BeforeDeserialize",
the _Original and _Chainned variables are null =no soap message is
available.
When I register the extension on only the server then the two variables are
also null but when I then change the ChainStream method to
public override Stream ChainStream( Stream stream )
{
if(stream.GetType().FullName="System.Web.HttpInput Stream")
return stream;
_Original = stream;
_Chainned = new MemoryStream();
return _Chainned;
}

everything works perfect for the server side.

I've tried a lot of different things but nothing seems to resolve my
problem.
It looks like I'm unable to send the soap request from my client to my
server, in "Client AfterSerialize" everything is perfect but in "Server
BeforeDeserialize" no message has been received.

Is there anyone who knows what I'm doing wrong?

Thx in advance

Frederik
Hi

I have windows application in vb.net. I am trying to access the webservice in the remote computer. The remote server is not configured to use with WSDL.

I have been provided with VB6 application it works fine.
As I am using windows form Could you please tell me how can I implement soap extention in the client application(windows form- vb or Vs 2000)?

I will be greatful for you. Please help

Many Thanks
Vaish

Posted from http://www.topxml.com/renntp using reNNTP: the website based NNTP reader.
Nov 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David C. allen | last post by:
I have created a simple Client-side SOAP Extension for a webclass that I have. When I apply the extension attribute to the the calling function in the proxy class I get an error 'Value cannot be...
4
by: pepcag | last post by:
I used http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconalteringsoapmessageusingsoapextensions.asp as a template to create a very simple web method with soap...
3
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
0
by: Amar | last post by:
I am recieving the "The root element is missing" error from my soap extension while attempting to validate an incoming SOAP message request. I suspect the problem resides in the ChainStream method...
4
by: Ramon de Klein | last post by:
I have created a SOAP extension that can be enabled using a SoapExtensionAttribute. This attibute holds two additional properties that are used to configure the SOAP extension. This works fine, but...
0
by: Matt Wood | last post by:
Hi, I have written a Web Service for a customer which expects a SOAP message with Document/Literal encoding, and uses RoutingStyle=SoapServiceRoutingStyle.RequestElement to route the SOAP body...
0
by: zac# | last post by:
i interesting to try using soap extension, and i using sample on msdn. but when i debug my soap extension, i have error message... i invoke soap extension using client desktop application, i want...
1
by: khoy | last post by:
Hello. I am writing a web service and I need to use a Soap Extension to add a custom header that is expected at the destination. I can use the Soap Extension successfully for adding the header...
1
by: klerik123456 | last post by:
I try set soap extension attributes on client side. For example: Implementation in web service: public class EncryptMessageAttribute : SoapExtensionAttribute { private string...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.