2

I have a WCF service that lives on another server that I am trying to connect to from an EventReciever in a SharePoint 2010 feature. I have gone through all the hoops of configuring the feature in the web application's web.config file, installed the certificates, and I have verified I can see the web service from IE on that machine. When I try to trigger the service in SharePoint, I get this error:

An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail

I'm not sure what I'm supposed to do at this point. A lot of other sources on the web say this is a timing issue on the server, but wouldn't that nerf Internet Explorer, too?

Thanks,

  • Matt

Edit 4:11PM 5/24/2012 OK, I made a few edits to the solution in visual studio (which I am leery of because someone else wrote it) and was able to get an inner exception:

[System.ServiceModel.FaultException] = {"At least one security token in the message could not be validated."}

Edit 11:23AM 5/25/2012

I created a test application on the same machine as the sharepoint server and ran some tests with that. So at least it's not a sharepoint issue, specifically, since that little winforms app is having the same problem.

In the FaultException there's a property called "Code" which is a "FaultCode" object. Two properties of this strike me as possibly useful: isSenderFault = true and Name = "Sender"

Not sure if that will help anybody give good tips but at least it's more.

Edit 11:50AM 6/1/2012

Still no luck connecting to the wcf service. The winforms app does not work when placed directly on the server hosting the service, either, with the same error.

4
  • Any chances you can get the details from the inner fault exception? Commented May 24, 2012 at 19:34
  • OK, inner exception found. I'll do some googling on this in the mean time.
    – Matt
    Commented May 24, 2012 at 21:18
  • What kind of WCF binding are you using and how is the authentication provider in SharePoint configured (classic mode, claims mode, kerberos, etc...)? Can you post the service configuration from both web.configs (client and service)? Have you enabled WIF logging on the web service? Commented Jun 1, 2012 at 17:04
  • I can do this on Monday, but SharePoint is in Claims mode.
    – Matt
    Commented Jun 2, 2012 at 16:44

2 Answers 2

2

Not sure if you are using the Windows Identity Foundation (WIF) which simplifies accesses between services. There is a four-part series on accessing WCF services using SharePoint that may provide you with more information. The following two posts may be directly relevant to your development effort -

Also, if you are using Event Receivers to access the external services - keep in mind the type of event handlers as they behave differently: synchronous or asynchronous.

UPDATE: One approach would be to verify the communications between SharePoint (or your test Winform app) & WCF services using network tools like Microsoft NetMon, WireShark, Sniffer, etc. If you are using Internet Explorer 9 (IE9) - there is a provision to look at the Network Traffic too.

5
  • I'm not trying to develop anything here, this service and feature should already work. I'm just trying to deploy the thing to staging. Never touched it before this week. So either there is some .config issue on my part or the security certs are messed up. I have no clue if this thing talks to STS or not, but it really doesn't look like it does.
    – Matt
    Commented May 25, 2012 at 15:28
  • I have posted an update to my above response by suggesting a network monitoring approach. Hope it helps. Commented May 25, 2012 at 16:37
  • if I go to the service URL it has no problem - IE just says it takes 250 ms to get the page. It doesn't say anything in the Network Traffic tool about the security aspect.
    – Matt
    Commented May 25, 2012 at 18:14
  • the tools were to verify if bidirectional communications were established. Commented Jun 1, 2012 at 12:50
  • I'm going to upvote your answer because I think you put out some good information, although this did not solve my problem.
    – Matt
    Commented Oct 16, 2012 at 16:04
0

group, and thank you for your contributions to this question. I really appreciate it. I found out what the problem is, though - at the Service end of the chain I had a connection string pointing at a different user database, so the user trying to connect was not getting recognized. Hopefully THAT helps someone, because it was a real egg-on-face moment for me and I would never have figured it out until I re-installed the whole operation from the ground up. Fortunately I had a colleague who took some time and he actually did look at everything from the ground up and thusly discovered the erroneous connection string.

  • Matt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.