Soap Extension ChainSream method
Hello,
I use the soap extension to log the request and response soap messages in my web service like documented in the MSDN:
http://msdn2.microsoft.com/en-us/library/7w06t139.aspx
it works fine with no problem but i want to understand: why we should finally copy the stream from the memory stream to the oldstream.
First at the beforedeserialize stage we copied the stream to the memory stream and in the chain stream we returned the memorystream, in the afterserialaization stage i got the serialized message from the memory stream, this means that the .Net framework worked on the memory stream so the serialized message was written on it, so why the response to the client wasn't sent from memory stream, why should i copy it from the memory stream to the old stream.
What i understood that the .Net works on the memory stream but send the soap response from the stream object that sent to the chainstream method?
Any one have explanation on how the .net use the these object in the stages of the soap message process?
Thanks
[1210 byte] By [
TheMaj0r] at [2007-12-26]
Hi
I am using a code to send xml file and received the acknowledgement with ID generated from the remote server-working fine. But how do I alter the receved message to poll the server untill I get the full result from the remote server.
I have followed the hyperlink in your posting but no idea where to paste or how to call them in the windows forms when I click the button.
Can you help me in the right direction?
Advance Thanks
The Maj0r,
Your have to write in the "oldstream" in order to give access to the previous extension in the chain to the output message.
Suppose you have your TraceExtension in position 1, and you have another SomeExtension in position 2 that works similarly to TraceExtension.
For SomeExtension, the "oldStream" is going to be the TraceExtension's "newStream"..... and TraceExtension takes the output directly from "newStream".... so if SomeExtension doesn't copy his "newStream" to his "oldStream"..... TraceExtension's "newStream" won't never contain the real output message as it equals SomeExtension's "oldStream"....
Can you see it now?... you have to think of it as you were having many extensions and that one is passing data to another using their "streams"..... and remembering that one's "newStream" corresponds to the next "oldStream" and one's "oldStream" corresponds to the previous "newStream".
Hope it helps
Rgds
Rodrigo
1st Sorry to be late for reply, i was a bit busy.
2nd I would like to thanks you a lot for your concise example. Thinking ine one extension will impossibly make me understand, but think of more than one extension make it understandable..
Thanks again
Hi
Can you please tell me how do I use soapeatension in windows form?
Many thanks
Why you need to use soapextension in windows forms? SoapExtension is only for web services!!
I am sending xml file and alter the received response from the server to poll the server untill the server proceed the xml file and send the success result to the client.
Please give me some idea
many many thanks. I am looking for any article for past 2 weeks and lost all my sleep. Please help
Click the below link to know about my need
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=894188&SiteID=1
Vaish,
The "server" is actually a web service or not?
Regards
Rodrigo
Vaish,
you want to send xml file not xml soap message.. so why you need to use soap extension?
You should write a web app or windows app that listen to some port and this would be your server. then write your client app that connect to the server sends the xml file and recieve the response from the server.
Hi guys
Server is not webservice,Because I tried WSDL for proxy and FAILED.But they configured the server to accept and send xml communications.
I am developing ONLY CLIENT application on behalf of another company
The xml file I am sending will be processed (NOT only to receive as Document)by the remote server and the results will be issued to the client. I need to send data as xml and poll the server every 10 seconds(the server will take time to process the document or data) untill the remote server give the SUCCESS RESPONSE or error results. Also I have been told to use "HTTP post" to send data.
The below link is my code to send request and received the HTTPresponse with ID (correlationID in my xml file). What I don't know is how to capture the ID (correlationID) returned by the server and insert that ID to new xml file or stream and send that stream as request to the remote server.?
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=875600&SiteID=1
So, I beleive SOAP Extention will be used to alter the HTTP response (grab the ID returned by the remote server) insert that ID in the 2nd request to Poll the server. So the remote server will recogonise the request and client application by the ID (correlationID - in my xml file - please see thelink above)
I have a VB6 program and it does the following process to get the result (poll the server untill get the results)
Client - Server
Request --> -
<(Acknowledgement with ID 01234566667888)
Poll with ID 01234566667888-> -
<( Acknowledgement with ID 01234566667888)
Poll wih ID 01234566667888--> -
Keep on poll the server untill I get the result.
Also I have to log on the following events while processing
Event ID , Time, Http Request, HttpResponse, ID
Awaits your reply
many thanks
vais
Vais,
Which kind of applications are your client and server?
Hi
I have a windows form developed in VB 2005 (VS 2005) with 14 tabs. It is like normal form to colect the user input and save the information as xml file.
The user will fill the textbox, combo box with data and click the button to save. Then the data will be saved as xml file. Then this xml file will be sent to remote server using HTTP for process in one click (this is where I am struggling).
I am sending xml file OK. Receiving OK. But the Responeded message has an ID (correlation ID). I need a code to grab this ID and insert in to another string or file or stream and then send the altered message as a request again to the remote server.
Thanks
Your server is not a web service, so you should be informed with how the server works and how response message is sent to you!!
If your server is listening to some port... so you have to use .net remoting.. working with sockets sending to the server then read the response stream
Try this , maybe helpful
http://www.devarticles.com/c/a/C-Sharp/Socket-Programming-in-C-Part-I/1/
Hi
The server was built before the DotNet was introduced and it NOT using socket. It is using HTTP post and HTTP response.
I have VB 6 program it is doing all the talks. It is using the below code
Dim objHTTP As MSXML2.XMLHTTP30 (equivalent of HTTP request and HTTP Response)
Set objHTTP = New MSXML2.XMLHTTP30
I have converted the VB6 code to Vb.Net but it throw me a lot of error.
As in my previous posting I am using the code to sucessfully send xml over HTTPand RECEIVED Message(xml format with ID) form the Server.
What I am trying to do is to Capture the incomming message , read the ID , insert into another stream, string or alter the Message and sending that message as a request again to the server. Here I beleive soap extenstion can do the job (like before serialize, after serialise, then store them in the memory before sending them to remote server.......blabla.....)
Or How do I read the Incoming message in the xml node to grab the ID (please look at my hyperlink in the previous posting)?
No matter what language ue server built with!! It uses http and it seems to work on port 80.
so u can use httpchannel sending to ur server thru port 80.
Note that when u use socket.Send() you can send a buffer array to the server then you can read the response to this request by calling socket.Receive(), this will receive the respose stream.