473,785 Members | 2,275 Online
Bytes | Software Development & Data Engineering Community
+ 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 SoapMessageStag e.BeforeSeriali ze:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
BeforeSerialize ");
else
System.Diagnost ics.Debug.Write Line("Server
BeforeSerialize ");
break;
case SoapMessageStag e.AfterSerializ e:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
AfterSerialize" );
else
System.Diagnost ics.Debug.Write Line("Server
AfterSerialize" );
break;
case SoapMessageStag e.BeforeDeseria lize:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
BeforeDeseriali ze");
else
System.Diagnost ics.Debug.Write Line("Server
BeforeDeseriali ze");
break;
case SoapMessageStag e.AfterDeserial ize:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
AfterDeserializ e");
else
System.Diagnost ics.Debug.Write Line("Server
AfterDeserializ e");
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 BeforeDeseriali ze",
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.GetTy pe().FullName=" System.Web.Http InputStream")
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
BeforeDeseriali ze" no message has been received.

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

Thx in advance

Frederik
Oct 19 '06 #1
2 4037
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 SoapMessageStag e.BeforeSeriali ze:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
BeforeSerialize ");
else
System.Diagnost ics.Debug.Write Line("Server
BeforeSerialize ");
break;
case SoapMessageStag e.AfterSerializ e:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
AfterSerialize" );
else
System.Diagnost ics.Debug.Write Line("Server
AfterSerialize" );
break;
case SoapMessageStag e.BeforeDeseria lize:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
BeforeDeseriali ze");
else
System.Diagnost ics.Debug.Write Line("Server
BeforeDeseriali ze");
break;
case SoapMessageStag e.AfterDeserial ize:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
AfterDeserializ e");
else
System.Diagnost ics.Debug.Write Line("Server
AfterDeserializ e");
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 BeforeDeseriali ze",
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.GetTy pe().FullName=" System.Web.Http InputStream")
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
BeforeDeseriali ze" 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(fr om);
TextWriter writer = new StreamWriter(to );
writer.WriteLin e(reader.ReadTo End());
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 SoapMessageStag e.BeforeSeriali ze:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
BeforeSerialize ");
else
System.Diagnost ics.Debug.Write Line("Server
BeforeSerialize ");
break;
case SoapMessageStag e.AfterSerializ e:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
AfterSerialize" );
else
System.Diagnost ics.Debug.Write Line("Server
AfterSerialize" );
break;
case SoapMessageStag e.BeforeDeseria lize:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
BeforeDeseriali ze");
else
System.Diagnost ics.Debug.Write Line("Server
BeforeDeseriali ze");
break;
case SoapMessageStag e.AfterDeserial ize:
if(message is System.Web.Soap ClientMessage)
System.Diagnost ics.Debug.Write Line("Client
AfterDeserializ e");
else
System.Diagnost ics.Debug.Write Line("Server
AfterDeserializ e");
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 BeforeDeseriali ze",
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.GetTy pe().FullName=" System.Web.Http InputStream")
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
BeforeDeseriali ze" 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(win dows 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
5728
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 null'. When the extension attribute is not applied it runs fine. The wierd thing is that it does not appear to be an error within the SOAP extension because I break-pointed it and when the proxy function gets called the SOAP extension runs fine....
4
6030
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 extension. The code like this: public string HelloWorld() { return "Hello World.";
3
9795
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 response. As a result of seraching news groups I guessed that the SOAP response defines an array element in a way that causes the dotnet deserialization routines to put the content in a generic object array (object) BUT the content is supposed to...
0
2938
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 but I'm not sure. Below is a water-downed version of the code that I'm working on. While debugging, I noticed that if I pass an invalid SOAP request, the schema validation catches it and throws the error appropriately. However, when I pass in a...
4
6518
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 I often want to use the SOAP extension from my web.config file and I have no idea how to configure it. The SOAP extension's GetInitializer method only receives the type of the webservice, but that isn't very useful for me. Adding the attribute...
0
4369
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 message to my Web Method. The Web Method expects a string as its parameter and then feeds that string to an XML deserializer which maps the XML elements contained within the string to my custom objects, then performs an insert/update on an SQL...
0
1152
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 to ask some question : 1. am i must installing WSE 1.0 on my server to resolve my problem?? 2. do you have simple soap extension (c#) for example, perhaps with step by step building soap extension.. i need your help..
1
1905
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 in the AfterSerialize section and the destination accepts my request and sends back the appropriate data, but my problem comes when I try to return the data. Depending on what I do I either get an exception that "the root element is missing" or...
1
4836
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 strKey="null";
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10357
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.