.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

Soap Response mising Signature Security element + BasicHttp Binding

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :WCF

Hi All,

I am facing one issue with WCF service.

Issue : Response message not contains Signature Value.

if i use

TransportWithMessageCredential , the response message not contains Signature Value.But if i use only

security mode="Message" this time Response contains signature element.Why it is missing in TransportWithMessageCredential?

My configuration settings are :

Https+Messagelevel Security

Binding :TransportWithMessageCredential

    <binding name="basicHttpEndpointBinding">
     <security mode="TransportWithMessageCredential" >
      <message clientCredentialType="Certificate" />
      <transport clientCredentialType="Certificate" proxyCredentialType ="None" realm =&qu

View Complete Post

More Related Resource Links

BasicHttp binding service failing when receiving a message with a To soap header


My WCF service is exposed through a basicHttp binding.


When I receive the following message

 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://biztalk01:81/StuffServices.svc</To> </s:Header> <s:Body> <ns0:GetMyStuff xmlns:ns0="http://example.com/stuff" xmlns:ns1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <ns0:inputArray> <ns1:string>80220</ns1:string> </ns0:inputArray> </ns0:GetMyStuff > </s:Body> </s:Envelope>

it gives a fault back, but if I try in soapUI to send the exact same request without the To header (deleting the "<To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none" >http://biztalk01:81/StuffServices.svc "), then it works fine and returns the correct response.

Do I have any way to make my service handle that request including a To header correctly?

I tried changing my binding to a CustomBinding as described here : http://blog.irm.se/blogs/eric/archive/2008/07/04/WS_2D00_Addressing-and-WCF.aspx

but that only resulted in the IIS worker proc

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

WSE 3.0 - Security , How do you set the mustUnderstand="0"?

Hi,I have some client code that uses wse 3.0.  The XML generated  <wsse:Security soap:mustUnderstand="1">     <wsu:Timestamp wsu:Id="Timestamp-e5dc384a-9e79-46e7-9e4d-0caf339bd7a6">       <wsu:Created>2008-09-29T20:31:18Z</wsu:Created>       <wsu:Expires>2008-09-29T20:36:18Z</wsu:Expires>     </wsu:Timestamp>     <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-f3807851-2042-442c-be07-99e36bdc337d">         <wsse:Username>andrew</wsse:Username>         <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">andrew</wsse:Password>         <wsse:Nonce>szwJdqOs2RsUGP32KT49+A==</wsse:Nonce>         <wsu:Created>2008-09-29T20:31:18Z</wsu:Created>     </wsse:UsernameToken> </wsse:Security>How do you change the header so that it reads soap:mustUnderstand="0" ?I read you have to implement a soap filter and manually change the attribute, is this true?  Is there an easier way?Thanks in Advance,Andrew

How to Add Custom SOAP Headers Into The Server Response Message in WSE3.0?

Hi Dear All, Assuming I am the service provider, may i know how many ways are there to insert a custom header into the server response message? So far I tried several ways, and it can be done in custom SoapFilters (by playing with SOAPEnvelope object), and SoapExtension (SOAPMessage object). Just wondering if this could be done at web service class by specifying a SOAPHeader attribute, just like adding a SOAPHeader into the SOAP request message at consumer side? If can, it might be much smarter than SoapFilter and SoapExtension.   Thanks in advance!   Best Regards, Charles

XML Signature xsd and Validation Error: Wildcard '##any' allows element causes the content model t

Hello,I'm trying to generate WCF client from Customer's WCF Service which has XML Signature options enabled.When trying to generate client proxy using svcutil I get following errors: Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation. All rights reserved. Attempting to download metadata from 'http://donex:51343/WebServices /Service.svc' using WS-Metadata Exchange or DISCO. Error: There was a validation error on a schema generated during export: Source: Line: 1 Column: 13464 Validation Error: Wildcard '##any' allows element 'http://www.w3.org/2000/09/ xmldsig#:HMACOutputLength', and causes the content model to become ambiguous. A content model must be formed such that during validation of an element informati on item sequence, the particle contained directly, indirectly or implicitly ther ein with which to attempt to validate each item in the sequence in turn can be u niquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence. Error: There was a validation error on a schema generated during export: Source: Line: 1 Column: 14410 Validation Error: Wildcard '##any' allows element 'http://www.w3.org/2000/09/ xmldsig#:XPath', and cau

Why does WCF add two Signature elements in the SOAP header when using a TransportSecurityBindingEle

I try to call a web service that implements the following standards from a WCF client:   WS-I Basic Security Profile Version 1.0 Web Services Security X.509 Certificate Token Profile, OASIS Standard X.509 used for digitally signing digests of uploaded files and web service requests SOAP 1.1/1.2. HTTPS 1.1 I use the a CustomBinding created in the following maner: HttpsTransportBindingElement httpsTransport = new HttpsTransportBindingElement(); httpsTransport.ProxyAddress = new Uri("http://myproxy:8080"); httpsTransport.UseDefaultWebProxy = false; // the message security binding element will be configured to require // a client certificate used to sign the message TransportSecurityBindingElement messageSecurity = SecurityBindingElement.CreateCertificateOverTransportBindingElement(); // Create supporting token parameters for the client X509 certificate. X509SecurityTokenParameters clientX509SupportingTokenParameters = new X509SecurityTokenParameters(); // Specify that the supporting token is passed in message send by the client to the service clientX509SupportingTokenParameters.InclusionMode = SecurityTokenInclusionMode.AlwaysToRecipient; // Turn off derived keys clientX509SupportingTokenParameters.RequireDerivedKeys = false; // Augment the binding element to require the client's X509 certificate as an endorsing token i

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

WSE 3.0 - Modifying the Security element

Hi everyone, I'm hoping someone can help.  I'm building a SOAP client application that passed messages to a sever outside of my control.  Using WSE 3.0 and VS 2005 I'm able to generate the SOAP envelope correctly except for 1 of the server's requirements.  The specification requires that I place a specific element inside the wsse:Security element of the SOAP header.  The end result should look something like this: <wsse:Security><customnode></customnode>[other security info]</Security>. I've tried to do this with custom policies / appending a XML element to the Security node. Any help would be greatly appreciated. Thanks, John.  

Element Binding - ComboBox

  <ComboBox Height="23" HorizontalAlignment="Left" Margin="139,59,0,0" Name="comboBox1" VerticalAlignment="Top" Width="120" > <ComboBoxItem Content="Spain"/> <ComboBoxItem Content="England"/> </ComboBox> <ComboBox Height="23" HorizontalAlignment="Left" Margin="139,154,0,0" Name="comboBox2" VerticalAlignment="Top" Width="120" > <ComboBoxItem Content="Madrid"/> <ComboBoxItem Content="Barcelona"/> <ComboBoxItem Content="London"/> <ComboBoxItem Content="Birmingem"/> </ComboBox> I've problem... I want to use element binding, in this source to filter Cities by selected Countries how do it?  

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

How to pass response or fault soap message to other end point using WCF?


I have changed the ReplyTo and FaultTo of SOAP Message Headers in WCF ,

and I d like  the response message can be sent to other service endpoint,

I tested it,But Response Message could not be sent to other service.

How can I make it?

Thanks in advance.


Frank Xu Lei--????,????
Focus on Distributed Applications Development and EAI based on .NET




SOAP Security Header: EncryptedData



I am configuring WCF to talk to non-.NET SOAP Framework.

The SOAP message will be encrypted with public-key, with Timestamp and UsernameToken in the Security Header.

I am starting off with CreateAnonymousForCertificateBindingElement(), and adding UserNameSecurityTokenParameters() to EndpointSupportingTokenParameters.Signed collection.

Difficulty is: In the SOAP Security Header I get ONE EncryptedData element that is giving the 3rd party service trouble... If I use a tool to submit altered SOAP Envelope without EncryptedData element (which seems to be not needed) the 3rd party service takes the request successfuly.

1) What may be generating this EncryptedData element?
2) How could EncryptedData be turned off OR removed from the Security Header?


Thank you


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!

MTOM-enabled WCF service sends document inline in SOAP response


I'm running a WCF service that has messageEncoding="Mtom" in the config file. The WCF service however, in its SOAP response sends the document as a Base 64 encoded document inline and not as a <xop:include.....> reference outside the SOAP. I'm not sure what I'm doing wrong. Please guide me.


Desired Format:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_F862C3E04D9E35266C1256303956115; type="application/xop+xml"; start="0.urn:uuid:F862C3E04D9E35266C1256303956116@apache.org"; start-info="application/soap+xml"; action="urn:ihe:iti:2007:RetrieveDocumentSetResponse"
Date: Fri, 23 Oct 2009 13:19:11 GMT

Content-Type: application/xop+xml; charset=UTF-8; type=&

Customize Soap Body Response in WS


Hi all,

I would like to know how i can customize the Soap Message returned by a WebService.

I have searched everywhere and I couldn't find any solution.

I have the following especification of return:

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http

Changing Binding from WsHttp to BasicHttp


I had an sample app woking fine with WsHttpBinding when i changed it to BasicHttpBinding(for Silverlight) it throwing Excptions.

I removed removed(SessionMode=SessionMode.Required) in Session Attribute. that does't work when ever i make a call to service its crating new object and throwing NullReference exception. I think this is something regarding todo with Sessions.


Did any one come across this Problem.


Any help is Appretiated.

SOAP response XML Exception



   I am using C#.Net 3.5 to consume a Web Service (http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/efetch_seq.wsdl) which has been working for me for years. About a week ago I started getting XML errors (see below for exception details) from the XML deserializer before I can even see the response from the Web Service. I used "snoop" (http://msdn2.microsoft.com/en-us/library/ms176041.aspx) to look at the XML being returned and it looks fine to me. I can even load that XML using XmlDocument.Load and I get no errors that way. Could .Net have different validation for SOAP than other xml documents? I am guessing that there is something bad happening before "snoop" can get it hands on the XML. Any idea what or what to do about

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