WCF

Windows Communication Foundation (WCF) is a tool used to implement and deploy a service-oriented architecture (SOA) to support distributed computing where services have remote consumers. It features a runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications. Services typically have a WSDL interface (Web Services Description Language) that any WCF client can use to consume the service, regardless of which platform the service is hosted on. WCF implements many advanced Web services (WS) standards such as WS-Addressing, WS-ReliableMessaging, WS-Security, RSS Syndication Services, WS-Discovery, routing and better support for REST services.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello,

I am trying to call a WCF Service from Jquery.
When i run the application as of now, it goes into error.
All i get is :         XHR: [object Object]

Earlier i was getting CORS issues.
I Included "            "Access-Control-Allow-Origin" under Application_Beginrequest of global.asax file.


Just to make sure the service is working good, I tried calling the service from a server side button control click and it works good and returns the data.
However, when i call it form Jquery, it goes into error and does nothing.

Can you point out what is wrong with this code?  Why is it failing.



Service

namespace EnrSvcOut
{
    // NOTE: If you change the interface name "IService1" here, you must also update the reference to "IService1" in Web.config.
    [ServiceContract]
    public interface IServiceEnrollmentOutcome
    {
        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "/GetServicePrograms")]
        List<SvcEnrOutProgram> GetServicePrograms();
    }
    [DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }

Open in new window

0
Exploring SQL Server 2016: Fundamentals
LVL 12
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

I have a silverlight app hosted on windows 7 and IIS, it works fine

I'm trying to move to a different box (windows 10) and its not working
I've run fiddler tool and can see the SVC binary requests are not found (404)
As this is a direct copy of the published code, I assume its setup related
If i run the project through visual studio it works fine, but in IIS does not

Here is an example of the url that isn't found on the new box:
http://localhost/MasterUI/ClientBin/MasterUI-Web-GuiViews.svc/binary/GetV_gui_TempAlarmGraph_by_Site?site=0001&ent=FFFFFFFF
The above gives a 404 in fiddler

The previous request to the XAP file works and does NOT 404
http://localhost/MasterUI/ClientBin/MasterUI.xap

I've tried to duplicate the IIS setup as much as possible, but for some reason it isn't working

My solution consists of 2 projects
MasterUI (silverlight stuff here)
MasterUI.Web (this is the non silverlight app - .aspx files)


The windows 10 box is a fresh install, so perhaps i'm missing some components, but as its working in visual studio on this windows 10 box, I assume it's IIS setup related?
0
I have a .NET WCF service which communicates with a time and attendance clocking terminal.
The WCF service method is as follows:
   
[WebInvoke(UriTemplate = "/Status", Method = "POST")]
public Stream Status(XmlElement status)
{
   
    XmlDocument xml = new XmlDocument();
    xml.LoadXml(status.OuterXml);

    string terminal = xml.SelectSingleNode("/StatusResponse/@terminal").Value;
    string uid = xml.SelectSingleNode("/StatusResponse/@uid").Value;

    StringBuilder builder = new StringBuilder();
    builder.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    builder.Append("<OperationStatus uid=\"" + uid + "\">OK</OperationStatus>");

    return new MemoryStream(Encoding.UTF8.GetBytes(builder.ToString()));
}

The WCF service is choking on ascii characters (ASCII 31) which are contained within the XML being sent from the terminal.
There is an error in XML document (3, 55), this is the ASCII 31 character after SR00 in the XML.

It is not possible to change the firmware on the terminal so I need to modify the WCF service to cope with the ascii characters.
If need be the ascii characters can be removed, however this must be done by the WCF service and not the client.

Details from Wireshark below :

POST /AccutouchService.svc/status HTTP/1.1
Host: 192.168.0.11
Accept: */*
Date: Sun, 26 Aug 2018 15:21:45 GMT
Authorization: ATS 000001714134:PASS
Content-Type: application/xml
Accept-Encoding: gzip
User-Agent: UCS-XML/3.0 …
0
I have a question regarding validation of fields provided from a WCF web service.

Let's say that the web service has 6 fields:

MemberFirstName
MemberLastName
MemberNumber
AptType
City
Referral


Now, I want to check that when a Referral is provided the MemberFirtName *and* MemberLastName are also provided. When a City is provided the AptType *or* a MemberLastName is provided.

What is the best way to achieve something like that?


This is in C# with VS 2015.

Any information would be greatly appreciated.
0
Vehicle mortgae (muroor) ABU DHABI WCF  service integration

anyone who implemented I need to know the web configuration as it’s not cleared from their side and I am unable to process anything
0
Hello all,

Kindly advice how I can send XML data to a Restful URL..  

Please provide me some sample codes.

I have created a WCF service but unfortunately its not sending anything and moreover i am getting following error message
The remote server returned an error: (415) Unsupported Media Type.

Following is the WCF code.
Dim xml As String
xml = "http://send/p1/?xml=<?xml version=""1.0"" encoding=""utf-8""?>" +
"<Emp ID=""1234"">" +
"<EmpDtls>" +
"<Empno>" & Empno & "</empno>" +
"</EmpDtls>" +
"</Emp>"
Dim url As String = "http://send/p1"
Dim req As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
Dim requestBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(xml)
req.Method = "POST"
req.ContentType = "text/xml;charset=utf-8"
req.ContentLength = requestBytes.Length
Dim requestStream As Stream = req.GetRequestStream()
requestStream.Write(requestBytes, 0, requestBytes.Length)
requestStream.Close()
Dim res As HttpWebResponse = DirectCast(req.GetResponse(), HttpWebResponse)
If res.StatusCode = HttpStatusCode.OK Then

End If
Dim sr As New StreamReader(res.GetResponseStream(), System.Text.Encoding.[Default])
Dim backstr As String = sr.ReadToEnd()
sr.Close()
res.Close()


Web.config
<system.net>
<defaultProxy>
<proxy usesystemdefault="False"/>
</defaultProxy>
</system.net>

<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
0
Hi,

i'm newbie in C# and web service but i need to read the soap service (xml format) and save it to a SQL tables (dataset)...

here's my client's data:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:pix="">
      <soapenv:Header/>
      <soapenv:Body>
            <tem:Request>
                  <pix:wsVersion>v1.2.1</pix:wsVersion>
                  <pix:cname>Testaccount</pix:cname>
                  <pix:sclass>sales</pix:sclass>
                  <pix:PO>PO12345</pix:PO>
                  <pix:method>AIR</pix:method>
                  <pix:product>
                        <pix:style>Abc1</pix:style>
                        <pix:qty>1</pix:qty>
                        <pix:price>1.00</pix:price>
                  </pix:product>
                  <pix:product>
                        <pix:style>Cde1</pix:style>
                        <pix:qty>2</pix:qty>
                        <pix:price>1.00</pix:price>
                  </pix:product>
            </tem:Request>
      </soapenv:Body>
</soapenv:Envelope>

I have 2 classes:
class order
            [MessageBodyMember(Order = 0)]
            public string wsVersion { get; set; }
            [MessageBodyMember(Order = 1)]
            public string cname { get; set; }
            [MessageBodyMember(Order = 2)]
            public string PO { get; set; }
            [MessageBodyMember(Order = 3)]
            public string method { get; set; }
            [MessageBodyMember(Order = 4)]
            [XmlArrayItem("oItems", IsNullable = false)]
            public Item[] Items { get; set; }
class Item
            [XmlElement(Order = 0)]
            public string style { get; set; }
            [XmlElement(Order = 1)]
            public int qty { get; set; }
            [XmlElement(Order = 2)]
            public double price { get; set; }

in service.svc.cs

0
When I run my  WCF api I get the below code from WCF Test Client tool and my Test WebSite.  What do I need to do in my MVC VS 2015 webconfig file on the server and the client to get this apito work?

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM,Negotiate'.
I have IIS7.
0
Aside from removing the TransactionScope created on the WCF client (and effectively taking msdtc out of the picture), Is there an alternate way to avoid the excessively long WCF-service-wide hang when a single workstation hosting the WCF client is misconfigured (or experiencing communications issues)?

We have a simple WCF service implemented using C#, and a simple WCF Client which creates TransactionScope before invoking the WCF service proxy.

Both work fine as far as concurrency goes if Windows Firewall allows TCP communication from/to msdtc.exe thru firewall. However if a single workstation is misconfigured (i.e. has firewall enabled, and has an Inbound Rule for TCP for msdtc.exe disabled), its attempt to communicate with the service will block all other WCF clients (which are properly configured) from communicating with the WCF Service for at least 41 seconds (given the currect settings for TCP retransmissions), despite us using much shorter timeout settings for the WCF binding as well as for the TransactionScope timeout.    

 The WCF service is decorated with
    [System.ServiceModel.ServiceBehavior(
        InstanceContextMode = System.ServiceModel.InstanceContextMode.PerCall,
        ReleaseServiceInstanceOnTransactionComplete = false,
        ConcurrencyMode = System.ServiceModel.ConcurrencyMode.Multiple,
        IncludeExceptionDetailInFaults = false,
        TransactionTimeout = "00:00:13"
       )
The WCF service has a single operation contract, …
0
I have the codes below
1. RetrieveData is working fine., but now I want to assign class library value in a loop.
Basically, I have wcf call to get the list of name which is exactly same as class library property name - see newretrievedata
Is it possible to do that?

On another side of class library in c#, i already have all of the property/object in class library.


     
  public JsonResult RetrieveData(string ID)
        {
            Domain.Lead l = new Domain.Lead();
            l.firstname = "John";
            l.lastname = "Smith";
            return Json(l, JsonRequestBehavior.AllowGet);
        }

 
        public JsonResult newRetrieveData(string ID)
        {
            Domain.Lead l = new Domain.Lead();


            foreach (KeyValuePair<string, string> i in Helper.DynamicsCRM.GetAllLeadInfoByMetaData3("a51ec467-7255-e811-81153863bb3c4538"))
            {               
                //Response.Write(i.Key + " >> " + i.Value + "<br>"); Key has firstname, and lastname, etc.
            	l.i.Key = i.Value;
            }
            return Json(l, JsonRequestBehavior.AllowGet);
        }

Open in new window

0
CompTIA Security+
LVL 12
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

I am trying to Integrate Swagger with a WCF service by following the article SwaggerWCF

I skipped ASP.Net part as i dont have ASP.Net in my project

The steps are not clearly stating whether these changes have to made in the service or in the host, mine is a self hosted service.

I have tried making changes in both the places (service and host, i am always getting
failed to parse JSON/YAML response swaggerwcf

Please help if i am missing anything

Adding project code

Service Project (WCFSample)

Service Interface

public interface IService1
{
[SwaggerWcfPath("Get Data", "Gets Data")]
[WebInvoke(UriTemplate = "/data",
BodyStyle = WebMessageBodyStyle.Bare,
Method = "Get",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
string GetData(int value);

    [SwaggerWcfPath("Get Data", "Gets Data using data contract")]
    [WebInvoke(UriTemplate = "/datawithcontract",
        BodyStyle = WebMessageBodyStyle.Bare,
        Method = "Get",
        RequestFormat = WebMessageFormat.Json,
        ResponseFormat = WebMessageFormat.Json)]
    [OperationContract]
    CompositeType GetDataUsingDataContract(CompositeType composite);

    // TODO: Add your service operations here
}

// Use a data contract as illustrated in the sample below to add composite types to service operations.
// You can add XSD files into the project. After building the project, you

Open in new window

0
I am using WCF callback services for Real-Time User availability and text/video chat application and i have included reliable session with a receive timeout of 10 mins.The problem i face is when a message has to be broadcast for all users(say 10 users) i am using a for loop and if a client has disconnected from internet on his side the loop waits for 10 mins to reach the same client without broadcasting the message to other clients.
 Is there any alternative or a better approach for accessing other clients in the meantime or any work around.
0
Hey all I am using the following code on my local machine to give me a temporary WCF service:
    using System;
    using System.Windows.Forms;
    using System.ServiceModel;
    using TestService;
    
    namespace TestClient
    {
        public partial class Form1 : Form
        {
            IService1 patientSvc = null;
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                EndpointAddress address = new EndpointAddress(new Uri("net.tcp://localhost:2202/PatientService"));
                NetTcpBinding binding = new NetTcpBinding();
                ChannelFactory<IService1> factory = new ChannelFactory<IService1>(binding, address);
                patientSvc = factory.CreateChannel();
            }
        }
    }

Open in new window

And the class1:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.ServiceModel;
    using System.Runtime.Serialization;
    
    namespace TestService
    {
        [ServiceContract()]
        public interface IService1
        {
            [OperationContract]
            Patient GetPatient(Int32 index);
    
            [OperationContract]
            void SetPatient(Int32 index, Patient patient);
        }
    
        [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
        public class PatientService : IService1
        {
            Patient[]

Open in new window

0
I'm getting the following error:
The incoming message was signed with a token which was different from what used to encrypt the body.  This was not expected.

I'm thinking it has to do something with my app.config file
<system.serviceModel>
    
    <diagnostics>
      <messageLogging
           logEntireMessage="true"
           logMalformedMessages="false"
           logMessagesAtServiceLevel="true"
           logMessagesAtTransportLevel="false"
           maxMessagesToLog="3000"
           maxSizeOfMessageToLog="2000"/>
    </diagnostics>
    <client>
      <endpoint address="https://xxxxxx/ESARWS/CORETransactionService"
        behaviorConfiguration="endpointCredentialBehavior" binding="customBinding"
        bindingConfiguration="esar" contract="ESAR.CORETransaction"
        name="CoreSoapPort">
        <identity>
          <dns value="xxxxx" />
        </identity>
      </endpoint>
    </client>
   <behaviors>
     <endpointBehaviors>  
        <behavior name="endpointCredentialBehavior">
         
          <clientCredentials>  
            <clientCertificate findValue="xxxxx"
                               storeLocation="CurrentUser"
                               storeName="My"
                               x509FindType="FindBySubjectName"/>
            
           <serviceCertificate>
             <authentication certificateValidationMode="ChainTrust"/>
              <defaultCertificate findValue="xxxxxxxxx"
                               

Open in new window

0
I'm using C# to call a Java Webservice.  Fiddler gives me a status of 200. So my call to the service is good.  But something in the .NET does not like my MTOM message.  Any ideas?  Here are all the details.  

I'm getting this error:
MTOM messages must have type 'application/xop+xml'.

Open in new window


The stack trace says:
Server stack trace: 
   at System.ServiceModel.Channels.MtomMessageEncoder.MtomBufferedMessageData.TakeXmlReader()
   at System.ServiceModel.Channels.BufferedMessageData.GetMessageReader()
   at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders, Boolean understoodHeadersModified)
   at System.ServiceModel.Channels.MtomMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
   at System.ServiceModel.Channels.HttpInput.DecodeBufferedMessage(ArraySegment`1 buffer, Stream inputStream)
   at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
   at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(HttpRequestMessage httpRequestMessage, Exception& requestException)
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at 

Open in new window

0
I'm trying to call a Java web service with an attachment in C#.    

string soap = "<?xml version='1.0' encoding='utf-8'?> <soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:soap='http://www.w3.org/2003/05/soap-envelope' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:int='http://xxxxx.com/'>" +
               "<soap:Header/> " +
                "<soap:Body> " +
                "	<int:xxxxxSubmission> " +
                "	xxxxxxxxxxxx " +
                "	</int:xxxxxSubmission> " +
                "</soap:Body> " +
                "</soap:Envelope> ";

            X509Certificate2 cert = new X509Certificate2(@"C:\Test\xxxxxx.pfx", @"xxxxx");
            X509Certificate2 cert2 = new X509Certificate2(@"C:\Test\xxx.cer", @"xxxxx");

            HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://xxxxx/TestService");

            req.ContentType = "application/soap+xml;charset=\"utf-8\"";
            req.Accept = "application/soap+xml";
            req.Method = "POST";
            req.Host = "test";
            req.KeepAlive = true;
            req.ClientCertificates.Add(cert);
            req.ClientCertificates.Add(cert2);


            using (Stream stm = req.GetRequestStream())
            {
                using (StreamWriter stmw = new StreamWriter(stm))
                {
                    stmw.Write(soap);
                    stmw.Close();
                }
            }

            WebResponse response = 

Open in new window

0
I'm calling a web service where I'm suppose to encrypt the data being passed over.    When I look at the diagnostic file I don't see my payload being encrypted.  Am I missing something in the app.config file for the encryption to occur?

Here is my app.config file:
<system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging">
        <listeners>
          <add name="messages"
          type="System.Diagnostics.XmlWriterTraceListener"
          initializeData="c:\logs\messages.xml" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>


  <system.serviceModel>
    <diagnostics>
      <messageLogging
           logEntireMessage="true"
           logMalformedMessages="false"
           logMessagesAtServiceLevel="true"
           logMessagesAtTransportLevel="false"
           maxMessagesToLog="3000"
           maxSizeOfMessageToLog="2000"/>
    </diagnostics>
    <bindings>
        <wsHttpBinding>
          <binding name="CoreSoapPortBinding">
            <security mode="Transport">  
              <transport clientCredentialType="Certificate"/>  
            </security>  
          </binding>  
        </wsHttpBinding>  
    </bindings>
    <client>
        <endpoint address="https://xxxxxxxxx/ESARWS/CORETransactionService"
            binding="wsHttpBinding" bindingConfiguration="CoreSoapPortBinding"
            contract="ESAR.CORETransaction" name="CoreSoapPort" behaviorConfiguration="endpointCredentialBehavior" 

Open in new window

0
Error method not allowed usin g POST in WCF


i want to send data from android to sqlserver using wcf post method because i want to send a stream of basex64 as a image in a parameter which GET method not accept in a browser but the post method can do this work.Kindly tell me the use of post method in WCF.Is is requires any additional information in post method?My all GET methods working fine.
First time post the problem hope so any one can rep me,tnx bilawal sharif
0
Client javascript calls aspx.vb. VB code behind which then calls a WCF data contract that returns data from an SQL data base. That data is then serialized and inserted into a response.write() method.

 It fails. No exceptions, no errors, nothing.

 After the WCF HTTPS call, the response.isClientConnected property is getting set to 'false'. Making the HTTPS call to the WCF service is making the response.write lose it's connection to the client that called it.

 Any ideas to get around this?

What I have tried:

1 -  I have taken the data returned from the WCF call, and pasted it as a string in the response.write("").

      If I then comment out the WCF HTTPS call, it works fine.

2 - I've tried moving the function that calls the WCF out of the aspx.vb that has the response.write.  No change.
0
Introduction to Web Design
LVL 12
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

In a very simple Silverlight Application I have a DomainService Class which has a single method that returns a list of Letter Objects.

The application works fine when I run it in VisualStudio. However, when I publish it to a folder on my Windows 10 local machine and run it using IIS (version 10.0.166299.5) I get the following error:
The remote server returned an error: NotFound. at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error) at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error) at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass1b.b__17(Object )

I supect this is due to something being wrong in missing in my WebConfig file. My WebConfig Currently looks like this:

<?xml version="1.0"?>

<configuration>


    <system.web>
      <compilation debug="true" targetFramework="4.6" />
      <httpRuntime targetFramework="4.6" />
    </system.web>




  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </modules>
  

Open in new window

0
UWd5sNhn
I cant upload or run moving wallpaper on this iphone 6s plus
Whats mean is the Mobifone Witalk network? In Vietnam im used VN mobifone. But while im work in to Apple the network change to Mobifone Witalk. Please help me to explain. Thanks
Safari---05-02-30-Heisei-09-33.pdf
FCC5930F-000B-44ED-8C95-539E7B5A7CA2.MOV
F1A7106D-423F-440A-9DD6-06C23D26D34F.png
0
Hi, I have 3 years of experience in Release Engineer and Software Engineer,

As I have less work for release management so I request for software development work to manager and got some work parallely. Now I am doing both Release as well as software development work in AngularJS, C#, WCF, MySQL, ASP.NET MVC etc. but my designation is "Release Engineer" . Now I want to switch to software engineer to different organization with this experience.

So is it possible? or how it should be done?

Please Help.

Thanks.
0
Is there any easy way to convert a WCF application to a pure web based application.
0
Hello guys,

I´m getting this error while trying to setup Outlook with autodiscover

Process w3wp.exe (FE_Autodiscover) (PID=8708). WCF request (Get Servers for sametime.cz) to the Microsoft Exchange Active Directory Topology service on server (TopologyClientTcpEndpoint (localhost)) failed. Make sure that the service is running. In addition, make sure that the network ports that are used by Microsoft Exchange Active Directory Topology service are not blocked by a firewall. The WCF call was retried 1 time(s). Error Details
 System.ServiceModel.Security.SecurityAccessDeniedException: Access is denied.

Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at …
0
Hello,

I have a webservice that I,m trying to apply a custome security, when I try to call the service it display the following error:


http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:FailedAuthentication

At least one security token in the message could not be validated.


To add the security I modify the service config file:

[b][b]<services> <service name = "WcfService1.Service1"> <endpoint address="" binding="customBinding" bindingConfiguration="customBindingOasis" contract="WcfService1.IService1"> <headers> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken> <wsse:Username>USERNAME</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password> </wsse:UsernameToken> </wsse:Security> </headers> </endpoint> </service> </services> <bindings> <customBinding> <binding name ="customBindingOasis"> <security authenticationMode="UserNameOverTransport" includeTimestamp="false" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> <secureConversationBootstrap /> </security> <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap12" writeEncoding="utf-8"> <readerQuotas maxDepth="32"
0

WCF

Windows Communication Foundation (WCF) is a tool used to implement and deploy a service-oriented architecture (SOA) to support distributed computing where services have remote consumers. It features a runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications. Services typically have a WSDL interface (Web Services Description Language) that any WCF client can use to consume the service, regardless of which platform the service is hosted on. WCF implements many advanced Web services (WS) standards such as WS-Addressing, WS-ReliableMessaging, WS-Security, RSS Syndication Services, WS-Discovery, routing and better support for REST services.

Top Experts In
WCF
<
Monthly
>