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

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

Work with SOAP requests via Raw request

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :.NET Framework
I will handle SOAP requests via IHttpRequest. What best way to work with raw SOAP requests (mean how desearialize etc)?

View Complete Post

More Related Resource Links

sending xml inside a soap request with HttpWebRequest

Im trying to send some xml inside a soap request to a webservice using the HttpWebRequest class.  I know this isnt the best way, but my hands are tied by company policy so i have to do it this way.  My webmethod has an input parameter  "SourceXML"  so my soap request has this node<SourceXML></SourceXML>I need to insert the xml in this node but whenver I insert it and try to send it to my web method I get an error "400 bad request"Is this even possible ?  I need to insert the xml as a string literal and read it in the web methodStringBuilder sb = new StringBuilder(_soapEnv); -- soap enevlope template containing the SourceXML node sb.Insert(sb.ToString().IndexOf("</SourceXML>"), the xml I want to insert in the node); sendmessage(url, webmethod, sb.ToString()) -- send the message to the webserviceIf I put plain text in the string builderegsb.Insert(sb.ToString().IndexOf("</SourceXML>"), "this is a test");everything works ok, but as soon as i put some xml in it fails. Am I going about this in the right way ?basically my webmethod will have 2 input parameters, some xml and an object, but I just cant get it to work. Can anyone help ?

WCF Method that receive GET AND SOAP Requests

i created a WCf service with a method that can receive GET requests using WebGET attribute, i want the same method to receive Soap calls too (that when the programmer does a Service reference to the WCF, he will be able to call the method). my interface is:   [ServiceContract] public interface IService1 { [OperationContract] [WebGet(UriTemplate = "GetData?value={value}")] string GetData(int value); }   My configuration is: <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="MyServiceBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="WebBehavior"> <webHttp /> </behavior> </endpointBehaviors> </behaviors> <services> <service name="WCFTestingGetService.Service1" behaviorConfiguration="MyServiceBehavior" > <endpoint address="" binding="webHttpBinding" contract="WCFTestingGetService.IService1" behaviorConfiguration="Web

Need help in reading Soap request and response on invoking WCF client assembly

Hi All,   I'm new to WCF and i'm using .Net 3.5. I have created a library from the proxy class generated through svcutil. I'm able to succesfully invoke service methods. I was wondering how to capture the request and response soap xmls so that i could render it on browser. If you have any code piece for this kind of problem please share it with me. Regards, Rahul

Seeing the SOAP request sent from a Web Service Client/Consumer

Hello, I am building a web service consumer in C# in VS2010.  Using the provided WSDL, I need to build appropriate headers and use certificates, SSL (user name & pass), & WS security.  I am getting an error from the webservice side, specifically processing the <wsse:Security> header. Is it possible for me to see the exact request I am sending to the Webservice? I'd like to see the values of the pieces of the header that get put in and such. Is it possible to have human readable serialization of what's being passed in right before the error? Thank You

Request.UrlReferrer does not work in Internet Explorer

Hi , i have a problem in my asp application . Im trying to protect the path for my application using this code : Uri t = Request.UrlReferrer;             bool op = false;             if (t.ToString().StartsWith("https://rim-sistem.com") || (t.ToString().StartsWith("http://www.rim-sistem.com")))             {                 op = true;             }Uri t = Request.UrlReferrer;            bool op = false;            if (t.ToString().StartsWith("My web site"))            {                op = true;            }This code work with Firefox , Chrome , etc . But it doesnt work in Internet explorer , when ill delete this piece of code it work in Internet explorer but the application is not secure and can be viewed by anyone who will type the path in them broswer . Can someone tell me what it is the problem ? Thanks Martin

Any way to re-route soap request to different method using soap extensions?

Not sure if this is possible, but is there any way (using soap extensions) to intercept a soap message and re-route it to a different method on the web service host?  I am able to intercept and replace the method name in the xml, but it still goes to the original method.

IsAjaxRequest method doesn't work with some IE requests

Hey, I've just discovered that the X-Requested-With header in IE is always "XMLHttpRequest, XMLHttpRequest" instead of just "XMLHttpRequest". I found the reason in MicrosoftMvcAjax.debug.js at line 280 (MVC 2.0). Seems there is no need to add this header again as it is already done in Microsoft AJAX Library. And because of this IsAjaxRequest extension method doesn't work anymore if there is no X-Requested-With param in the request body. And this make X-Requested-With header useless in IE. In Firefox there is no problem as it doesn't append but replace the existing header value. Not tested in other browsers. Can someone from the MVC team comment on this? Thanks in advance.

ASMX to WCF Soap request

I have a .asmx service that I need to convert to WCF. The service receives xml requests via the request input stream,  parses xml and sends clients back a response also in xml. The clients are sending SOAP requests. I have to make this change transparent to the clients. I'm somewhat new to WCF so i'm wondering what would be the best solution. REST looks good but I need to support SOAP. Is it possible to use basicHTTPBinding for my needs?

Sign outgoing client request SOAP body with WSE 3.0



We currently have the code in WCF to sign the outgoing client requests' SOAP Body, however we need the same code for use with WSE 3.0.  I can't find any examples of this.  

Is it possible?  If so, does anyone have an example?

Thank you,

view soap request message


I am consuming a .net 2.0 webservice from a class library and calling this class from a web page form . When a user inputs and saves the data in the form it will call the class and inturn send the user inputted data over webservice. I want to view the Soap messages like request and response going from my dll to the webservice. I tried fiddler but with no luck. So I created a class mentioned here: http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapextension(v=VS.90).aspx

and added the in the dll.config file like this and it was also of no help. By the way the end webservice is https not http.




        <add type="SoapTrace.TraceExtension" priority="2" group="High" />





Any pointers are greatly appreciated, thanks in advance

Simple ASP.NET SOAP request to return string



I have a requirement to build a simple ASP.NET web page which sends some parameters to a web service, and then displays the string which was returned.

I'm a complete .NET newby and the only examples I can find seem really really complex.  I just need something mega simple, but which an handle parameters being sent to the web service.  Can anyone point me in the direction of a simple bit of C# which will do this with no frills or fuss?

Any help much appreciated, thanks!

soap:ServerServer was unable to process request.


I had a collaboration site that for several reasons I decided to delete and then create a new one with the same name. In the original version I had created a duplicate DefaultLayout file and renamed the original to DefaultLayouxxxt.aspx.

Now with the completely new version of the site when I try to edit the Default.aspx file using SharePointdesigner I get this error:

soap:ServerServer was unable to process request. ---> The file https://mytestsite/_catalogs/masterpage/DefaultLayouxxxt.aspx does not exist.

How does it know that in a completely non-existent site there once was file that it now wants. But more importantly how do you change the setting so that it wouldn't seek it?




Hotfix request links to Cumulative Updates 9 and 10 for SP1 do not work


Last week I was able to obtain CU9 for SQL Server 2008 SP1.  This week, I cannot even make a request for CU10 or CU9.  Since Saturday, I have received the following reply whenver I click on a hotfix link:  Hotfix Request
The system is currently unavailable. Please try back later, or contact support if you want immediate assistance.http://support.microsoft.com/contactus/?ws=support

If I attempt to contact support in any way, they want to charge me.  What is going on?

Fetch raw XML for SOAP request and response inside WCF client


I've got a basis WinForms test harness that's implementing a WCF client (.NET 3.5) which calls a SOAP web service.  I need to be able to write the HTTP request and response and output the two XML documents so I can load them back into WebBrowser controls on the form.

It looks like the way to accomplish this is to implement a custom IClientMessageInspector and an IEndpointBehavior, apply the behavior to the binding and then do the work of capturing the XML inside AfterReceiveReply and BeforeSendRequest (inside IClientMessageInspector implementation).

So my questions are:

1. This seems like a rather exhaustive process, is there a more straightforward approach to doing this? 

2.  If I am on the right path, does anyone have links to related articles/code samples related to this?

3. In what I have coded so far, I am held up trying to get the behaviorExtension to register properly (inside app.config), it looks as if I must register my classes that implement behavior Extenshions in the GAC in order to make use of them, is this true? 

Thanks in advance for taking time away to help a fellow developer!

Soap request fails


I get the following error when I send a soap request to my service. Any clues what needs to be fixed?

The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
HTTP Error 405 - The HTTP verb used to access this page is not allowed.<br>Internet Information Services (IIS)



How to properly create SOAP Request that has x509 signed message body and unsigned usernameToken




I'm trying to  create a .NET client that will consume AXIS WS.

Request should be signed (using x509 Signature) and after this usernametoken profile 1.0 should be attached.

Using SOAP-UI I can create Outgoing Security Policy with few steps described below:

1) Define keystore

2) Add WSS Signature entry and mark key identifier type as X509 Certificate or Binary Security Token

3) Add WSS Username entry

The order is important.

I cannot recreate SOAP request that would generate valid response.

I got "The signature or decryption was invalid" most of the time.

Here is valid SOAP Request from SOAP-UI:


 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:user="http://users.api.swd.zbp.pl"

Request time out while using WebClient .Net frame work 2.0


In our application developed in .Net framework 2.0, we have a requirement to download multiple files from WebServer (IIS 6.0) simultaneously, the file count is not defined it can exceed 40 or 50 or more and the file size is less then 1 kb. We are using WebClient to download file one by one and “dispose” it as soon as the file is downloaded.


The issue here is sometime we get “Time out error” for some files and some files are downloaded successfully.


We have already tried setting ServicePointManager.DefaultConnectionLimit property but still the issue persists.

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