.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

ASMX to WCF Soap request

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :.NET Framework
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?

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 ?

Work with SOAP requests via Raw request

I will handle SOAP requests via IHttpRequest. What best way to work with raw SOAP requests (mean how desearialize etc)?

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

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.

ASMX web service soap fault

Hi,I have a ASMX web service, and as I understand the ASMX services does not include soap fault details in the WSDL.Thus, I have changed the generated WSDL to include soap fault.Will this cause any error in the endpoint systems?Regards, 

soap error while using web service (DspSts.asmx)

Hi, I am using SP webservice. I think something is not right with my soap. Using Fiddler, I can see my soap request and response where I got HTTP 500 error when making a call to SP WS. Here is the Response: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client.Dsp.Syntax</faultcode><faultstring>Request is empty.</faultstring></soap:Fault></soap:Body></soap:Envelope> And here is my soap request: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <dsp:versions xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp"> <dsp:version>1.0</dsp:version> </dsp:versions> <dsp:request xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" service="DspSts" document="content" method="query"> </dsp

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?




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"

soap:ServerServer was unable to process request. ---> A Web Part with this ID has already been added


We have a custom WebPart that we have added to a WebPart Zone in the page layout.  We can't get several of the pages to open in SPD due to this error and the ones we can get to open will duplicate the WebPart tag.

We have tried navigating to the layout through a browser by adding the ?contents=1 to the url and we get the page cannot be found or loaded error.

We also get the duplicate webpart error when we try to create a page based on that layout.We have tried everything including, downloading a copy of the layout, removing the webpart, and reuploading it, our next move is to programmatically removing the webpart from the layout.

I just want to know if there is an easier less aggressive way to remedy this problem, and if anyone else has had it.  There have been no changes to the site or the layouts for over 2 weeks and this just started happening out of the blue.


below is the tag from the page layout that we can get open.

<WebPartPages:WebPartZone id="Zone20" runat="server" title="Zone 20" frametype="None"><ZoneTemplate>
<WebParts:PageMetaTags runat="server" ID="PageMetaTags1" Title="PageMetaTags" WebPart="true" __designer:IsClosed="false" partorder="1" __WebPartId="{4B5DCA63-0BBA-4F13-A13C-17A

IIS memory increasing for each client request in asmx web service


A customer reported that our asmx web service is continually increasing in memory (mem usage as well as private bytes).  We are able to reproduce the problem in our lab with Windows 2003 Server SP2 (fully patched) on some of the machines.  The customer is using Windows 2008.

We created a Hello World web service targeting the 2.0 framework built under VS2005 SP1 and a test client that continues to call it.  The memory increases steadily - approximately 40K per client request.  If the test app is paused, the memory remains the same.  When it is closed, the memory drops.  Explicit calling of GC.Collect does not drop the memory.

We have run the memory profiler on the service and the leak is all native memory.  We have uninstalled/re-installed the Framework on one of the machines but no difference.  To our knowledge all of the security and IIS settings are not modified.  We have compared app pool, default web site and virtual directory properties to  machines that have no problem and they are identical.

Has anyone else experienced this?  Any suggestions?

How do I add the client certificate to a soap request?


hello all,

I want to add the client certificate to the web request, but i'm unable to do it because it's not visible. here are the examples:

I have a web test project. if i add an asmx webservice to the web protect, i am able to do this


void buttonclick()
   WebService1 ws = new WebService1();
   ws.URL = ... someURL;
   ws.ClientCertificates.Add(new certificate in here); 


here's the problem,
if i add a webserivce project to the current solution (web test solution). And I reference the webservice. and when i do this:


void buttonclick()
  InstantName.Service1 ws = new InstantName.Service1();
  ws.URL ...??? Don't see it
  ws.ClientCertificates.Add( ... not here ... ) 


both web services class inherits the System.Web.Services.Protocols.SoapHttpClientProtocol

i don't get it ... anyone has experience with this, please give some input .. thank you.

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