1

I have to consume 3 web services (Sharepoint/Alfresco/Documentum CMIS) via WCF with HTTP Basic auth.

With Sharepoint or Alfresco, first request goes without Authorization header, receives HTTP 401, gets auto-retried by WCF with header, everything's fine.

But with Documentum, I receive HTTP 500 and a SOAP Fault instead, so WCF never gets an opportunity to send the header and returns the exception as-is.

I can of course add the headers manually via HttpRequestMessageProperty, but this looks like an ugly hack to me. Is there anything that could be configured on the WCF side to send headers with the first request, or on Documentum side to return 401?

wizzard0
  • 1,883
  • 1
  • 15
  • 38
  • Your question does not clarify whether WCF is used on the client side or server side, but I am presuming client-side. Now, the HTTP 500 is a Server side error. It should never be sent as a response indicating that authentication is required, and if a server is doing so, it is broken. If the 500 error is being sent for some other reason, the server is broken. So I suggest that the fix for this problem is not on the client side (in WCF). It is on the server side, in Documentum, because, regardless of client input, the server should never issue 500 except when encountering a bug. – Cheeso Jul 04 '12 at 06:18
  • Yes, WCF is on the client side. Unfortunately, (almost) nobody would upgrade their Documentum installations because a) it costs lots of money and b) in fear of breaking existing deployments, so I have to find client-side workaround. – wizzard0 Jul 04 '12 at 09:22

1 Answers1

0

You could try fronting the Documentum service with another web server that behaves properly, and passing the requests through?

I implemented something similar using IIS to front Apache Tomcat in order to use Windows Auth, and used the isapi_redirect.dll filter to pass requests through. More information about that can be found here: http://tomcat.apache.org/connectors-doc/reference/iis.html

Don't know if something like that is an option for you, but it may provide an easier solution in code.

Brendan Hannemann
  • 2,084
  • 1
  • 18
  • 33