.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Printing whole SOAP envelope - how?

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :WCF
Hi all, Is there a way to print a full SOAP request ? It's very nice that in WCF I can only define service interface and do the implementation straight away, without caring much for processing soap envelopes etc. But for debug reasons, sometimes I'd like to get the content of the raw SOAP request that I'm processing and store it somewhere in a file. Is there an easy way to get the soap message recieved by the service (from within the operation implementation code)?

View Complete Post

More Related Resource Links

Full SOAP envelope in WCF service log

Hello, I've enabled all the wcf tracing features but I cannot see the SOAP generated for my incoming/outgoing message (on net.tcp protocol binding). This is my configuration:   <system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="All" propagateActivity="true"> <listeners> <add name="wcf" /> </listeners> </source> <source name="System.IdentityModel"> <listeners> <add name="wcf" /> </listeners> </source> <source name="System.MessageLogging"> <listeners> <add name="wcf" /> </listeners> </source> <source name="System.Runtime.Serialization"> <listeners> <add name="wcf" /> </listeners> </source> </sources> <sharedListeners> <add name="wcf" type="System.Diagnostics.XmlWriterTraceListener" initializeData="wcf.svclog" /> </sharedListeners> </system.diagnostics>   .... and ....   <diagnostics> <messageLogging logEntireMessage = "true" logMalformedMessages = "true" logMessagesAtS

Post SOAP Envelope to WCF service

Hi, I have the following SOAP message that i want to post it to my WCF Service and get response. "<s:Envelope xmlns:a=\"http://www.w3.org/2005/08/addressing\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\">\r\n  <s:Header>\r\n    <a:Action s:mustUnderstand=\"1\">http://schemas.devleap.com/OrderService/IOrderService/InsertOrder</a:Action>\r\n    <a:MessageID>urn:uuid:4cb619b7-365b-4108-880f-b302029d03c2</a:MessageID>\r\n    <a:ReplyTo>\r\n      <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>\r\n    </a:ReplyTo>\r\n  </s:Header>\r\n  <s:Body>\r\n    <InsertOrder xmlns=\"http://schemas.devleap.com/OrderService\">\r\n      <order xmlns:d4p1=\"http://schemas.devleap.com/OrderService/Order\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n        <d4p1:IdCustomer>2</d4p1:IdCustomer>\r\n        <d4p1:IdOrder>46</d4p1:IdOrder>\r\n        <d4p1:OrderItems xmlns:d5p1=\"http://schemas.devleap.com/OrderService/OrderItems\" x

set Response to client from SOAP Envelope



I have a WCF client with a custom behavior that intercepts the SOAP request. In BeforeSendRequest in the client I get the SOAP request and pass it to another WS as parameter. The other WS posts the SOAP envelope to the real service that client wants to invoke and returns the SOAP Response back to client. So in BeforeSendRequest the intermediary service returns the real SOAP response as a string back to client.

public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, IClientChannel channel)
      string soapResponse = myotherProxy.CallService(request.ToString());
      return null;

How can i set the returned SOAP response (soapResponse) as the real response in the client?

Hope someone can help :)

Thank you, Adrya

Deserialization and SOAP envelope

I've created a web service that handles a fairly complex xml request. The service uses classes that I auto-generated from the xsd to deserialize the xml. I now need handle xml requests that have SOAP envelopes. I've tried SoapReflectionImporter but it is throwing an exception 'type System.Xml.XmlElement may not be serialized with SOAP message' which is referring to collections in my auto-generated classes. Is there any way to add this functionality without having to rewrite the auto-generated classes?

Parsing out result from SOAP Response envelope


Hi guys,

I built the following SOAP Request method and am trying to find out the best way to parse out just the relevant result data from the response below.

    protected void Test_Click(object sender, EventArgs e)
        string oRequest = "";
        oRequest = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:com=\"http://com.remp.web.sas.tubeorder.type\">";
        oRequest = oRequest + "<soapenv:Header/>";
        oRequest = oRequest + "<soapenv:Body>";
        oRequest = oRequest + "<com:beginTransaction>";
        oRequest = oRequest + "<Long_1>10</Long_1>";
        oRequest = oRequest + "<String_2>BARCODE</String_2>";
        oRequest = oRequest + "<String_3>TUBEFIXRACKVAR</String_3>";
        oRequest = oRequest + "</com:beginTransaction>";
        oRequest = oRequest + "</soapenv:Body>";
        oRequest = oRequest + "</soapenv:Envelope>";

        //Builds the connection to the WebService.
        HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://xxx.xxx.xxx.xxx:8080/tubeorder-service/jse?wsdl");
        req.Headers.Add("SOAPAction", "\"http://tempuri.org/Register\"");
        req.ContentType = "text/xml; charset=\"utf-8\"";
        req.Accept = "text/xml";
        req.Method = "POST";


Bluetooth Printing Guide using Windows Mobile Pocket Pc

FieldSoftware Products printing products use the Bluetooth "Serial Port Profile" (SPP). Unfortunately, there is no standard method to find your Bluetooth printer and begin printing... each device contains a Bluetooth stack/driver that determines the steps. There are two main stacks currently available... one from Microsoft and one from WIDCOMM/Broadcom. Below are step-by-step instructions for printing with the Microsoft and WIDCOMM stacks. Note that these may change for different versions of the Bluetooth stacks or for different manufacturers. Consult the documentation for your device for specific details on your device.

Identifying your device''s Bluetooth stack: There is no sure steps to identify a Bluetooth stack on a device. Below are steps for identifying current WIDCOMM and Microsoft stacks at the time this page is published. Note that these may not identify earlier or later versions of the same BT stacks.

ASP.net Ajax TabContainer -- Printing All tabs



Can  anyone help me with this?. I want to print all the tabs in ajax tab container. The tab container has around 10 tabs. I dont want to goto each tab and print the page. Instead is there any way by which I can tweek the print.css file to print all the tabs at a single stretch?.  So that I will get all the contents of the tab in single print.  Is there any other way in which I can print all the tabs all together?.

Thanks in Advance...


Printing resource files



I have some resource files for localization and would like to print them. When I try to print them in Visual Studio (with File -> Print...) the button is disabled. Does anyone know how to print them? (Without copying each into word or excel)

Thanks and regards,

.Net Frameword 4 SOAP Web Service



We want to upgrade from VS2005 to VS2010. Before we do that, I would like some clarity about some things.


Can we build typical SOAP webservices with the 4 Framework as I could with 2.0?


Would a WCF Service allow me to have both REST/SOAP services in one application?


Is Framework 4 ONLY for REST services and I need to stick to 3.5 for SOAP?


I downloaded the free Web Developer 2010, but I cannot seem to get anywhere trying to figure this out.


Thanks for any input.





Automatic Batch Printing in ReportViewer Remote Mode


Please help me, i have a properly working codes that is capable of the following:

1. Printing of Reports from ReportViewer without using the build-in print ICON in the actual ReportViewer. to view the working for the printing alone please click here.

2. Batch Printing by making a loop and placing a checkbox on the gridview where the needed paramerter (DataKeyNames ID) is retrieved then pass to the ReportViewer

This is my Code

foreach (GridViewRow row in GridView1.Rows)
            CheckBox chk = (CheckBox)row.FindControl("CheckBox2");
            if (chk.Checked)
                ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://TestServer/ReportServer");
                ReportViewer1.ServerReport.ReportPath = @"/Tavern/StudPaymentReport";
                ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                ReportParameter[] rptParams = new ReportParameter[1];

                rptParams[0] = new ReportParameter("ClientID", GridView1.DataKeys[row.RowIndex].Value.ToString());


Printing crystal report from webservice



I am trying to print crystal repot directly from a C# application, which is calling webservice. I am able to display report in crystalreportviewer by passing the webservice call to datasource. However, is there anyway, I can print directly without showing the report?

Alternatively, I was trying return ReportDocument object from webservice, which would solve my problem, but I was unable to return the ReportDocument because of serialization issue. Is it even possible? Thank you


Editor's Note: Healthy Printing


Why we use the paper we do.

Joshua Trupin

MSDN Magazine November 2006

Service Station: WSE 3.0, SOAP Transports, and More


It's that time again. Time to answer some of the questions I get on a regular basis. This month I'll look at service orientation and policy-based compatibility, SOAP's transport-neutral design, and Web Services Enhancements (WSE) 3.0.

Aaron Skonnard

MSDN Magazine June 2006

MSMQ and .NET: Send MSMQ Messages Securely Across the Internet with HTTP and SOAP


When creating a distributed system you frequently need to provide for communication between two entities that are not in sync. Microsoft Message Queue Server (MSMQ) provides the kind of store-and-forward messaging in a pre-built infrastructure that can help you address these kinds of messaging needs. In the past, MSMQ was accessed using a COM wrapper. Now there's a .NET wrapper that lets you accomplish your messaging goals easily from your Framework-based code. To illustrate the use of the wrapper, the author builds a messaging application, sends MSMQ messages over the Web, and discusses messaging security.

David S. Platt

MSDN Magazine December 2003

Secure It: WS-Security and Remoting Channel Sinks Give Message-Level Security to Your SOAP Packets


As more organizations adopt XML-based Web Services, the need for message-level security has become evident. WS-Security, now supported in the Microsoft .NET Framework, addresses this need. Using the WS-Security framework, developers can implement channel sinks to intercept Remoting messages as they pass through the .NET Remoting infrastructure. The sink can read the message, change it, and pass it along. During this process, the message can be signed for added security. This article explains how to implement a Remoting channel sink that will modify the Remoting message by including a UserName token in the header, then sign the body using the token.

Neeraj Srivastava

MSDN Magazine November 2003

House of Web Services: Accessing Raw SOAP Messages in ASP.NET Web Services


Web Services exchange XML messages. Most of today's Web Service toolkits do their best to hide this fact from developers, by exposing a Web Service's behavior as method invocations against objects instead.

Tim Ewald

MSDN Magazine March 2003

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend