Getting underlying exception from third party WCF - SOAP Exception - wcf

I have a client connecting to third part WCF Service (I have access to the web.config or service but not code).
The Third Party throws a SOAP Exception because the faulting assembly isn't marked as serializable - "Type Assembly not marked as serializable".
Is there anyway I can get the underlying exception detail that was thrown and not faulted on the WCF Service via configuration edit or other means?

You need to enable includeExceptionDetailInFaults in your web.config file.
Please check this.

Related

Use WCF UserNamePasswordValidator with nServiceBus 5

I'm working on a WCF service where I created a custom UserNamePasswordValidator to validate the client. If username or password are wrong a FaultException is thrown.
I use nServiceBus 5 in the WCF service to send the client message to some internal systems.
The issue is that if a FaultException is thrown because the client hasn't access to the service, the client's request is processed anyway because (I guess) nServiceBus is handling the exception also if I'm not inside an handler.
The bus is started inside a custom ServiceHostFactory.
How could I tell to nServiceBus to don't handle that kind of Exception?

"An unsecured or incorrectly secured fault was received from the other party."

I am trying to implement the same functionalities of one WCF web service (which is working of course) to another WCF web service, but I encounter an exception: {"An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail."}
and {"The message could not be processed because the action 'http://tempuri.org/IBlueWebService/GetDataSourceList' is invalid or unrecognized."}
I copied exactly same codes and same configuration and I use my client tool to call the new web service (I only changed the web service url to the new one), but it throws the exception.
Some forums told me to set the establishSecurityContext but it doesn't work also.
Please can somebody tell me what I am missing?
Solution
I tried to compare the wsdl files and I remarked that the new wcf web service had different action url from the old one, but I tried to use the same config file in client application (which is obviously looking for old wcf web service action url).
So in every operationcontract of new web service, I specified the action url and replyaction url for every operation and it works for me now.

Getting a "Failed to invoke the service" while trying to invoke a wcf service

I am trying to host a Wcf Service on the IIS, but am unable to do so. I have the service inside a website in IIS added as an application and am also able to get the wsdl for the service. But when trying to hit the service through the WcfTestClient, I get the following error -
Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service.
I have gone through the steps to host a wcf service on the IIS. Not sure what I am missing or doing wrong. Thanks in advance for any help.
It seems there is error in WCF.
Try putting
try and catch
or
make a empty method to return Hello World

SP2010: STS: 'SecurityTokenServiceApplicationPool' - autostart error

I am unable to create a web application from central administration
Need to get FBA site working
If I try to run SecurityTokenServiceApplication/securitytoken.svc following error is displayed.
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: An exception was thrown in a call to a policy export extension.
Extension: System.ServiceModel.Channels.TransportSecurityBindingElement
Error: Security policy export failed. The binding contains a TransportSecurityBindingElement but no transport binding element that implements ITransportTokenAssertionProvider. Policy export for such a binding is not supported. Make sure the transport binding element in the binding implements the ITransportTokenAssertionProvider interface. ---->
System.InvalidOperationException: Security policy export failed. The binding contains a TransportSecurityBindingElement but no transport binding element that implements ITransportTokenAssertionProvider. Policy export for such a binding is not supported. Make sure the transport binding element in the binding implements the ITransportTokenAssertionProvider interface.
at System.ServiceModel.Channels.TransportSecurityBindingElement.System.ServiceModel.Description.IPolicyExportExtension.ExportPolicy(MetadataExporter exporter, PolicyConversionContext policyContext)
at
System.ServiceModel.Description.MetadataExporter.ExportPolicy(ServiceEndpoint endpoint)
In event viewer below error is reported.
Event Id : 2303
Source: IIS-W3SVC-WP
There was an error during processing of the managed application service auto-start for application pool: 'SecurityTokenServiceApplicationPool'. Some application services may not have been processed correctly. Please check the configuration for application service auto-start for the application(s) assigned to this application pool. The data field contains the error code.
Already tried
.NET framework 3.5 SP1 installed
Disabling Forms authentication in SecurityTokenServiceApplication
Ensuring the SecurityTokenServiceApplication is provisioned.
Any other solutions please.
I tried changing web.config for security token service to use IssuedToken security. With this change now I am able to see the service metadata. But below error is reported in the event viewer
Event Id: 8306
An exception occurred when trying to issue security token: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail..

Throwing exception from WCF Service without faulting

When throwing a FaultException from a WCF service, is there a way it can be thrown without faulting the actual connection? I'm looking to prevent an action for a particular method, but don't want to disrupt the client's connection (just return saying "you can't do this action right now, and here's why"). Or, is the required paradigm to recreate a new proxy in the .NET consuming app (in the case of .NET)
If you throw a FaultException then the client will get an exception but should be able to carry on using the same connection. If you let any other kind of exception out of the service (without having a Custom Error Handler in place) then it will fault the channel
Are you using .NET 4.0, can you use WebFaultException to return an HTTP status code with the appropriate error reason?