0

As we see in this answer, DISCO is a sub-service for discovering the WSDL URL for a given SOAP service.

Indeed, when we examine the HTML source of the Help page returned by a WCF service, we can see the DISCO URL:

<head>
  <link rel="alternate" type="text/xml" href="https://example.com/service?disco" />
  ...
</head>

When we follow that link with an old net48 service, we get a well-formed XML response that contains the correct WSDL URL.

Not so with CoreWCF, however, at least in its default implementation.

Instead, we get:

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: Token StartDocument in state Document would result in an invalid XML document.
   at System.Xml.XmlWellFormedWriter.ThrowInvalidStateTransition(Token token, State currentState)
   at System.Xml.XmlWellFormedWriter.AdvanceState(Token token)
   at System.Xml.XmlWellFormedWriter.WriteStartDocumentImpl(XmlStandalone standalone)
   at CoreWCF.Description.ServiceMetadataExtension.HttpGetImpl.DiscoResult.Write(XmlWriter writer)
   at CoreWCF.Description.ServiceMetadataExtension.HttpGetImpl.MetadataResult.WriteResponseAsync(HttpResponse response)
   at CoreWCF.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleMetadataRequestAsync(HttpContext requestContext, IQueryCollection queries)
   at CoreWCF.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(HttpContext requestContext)
   at CoreWCF.Description.ServiceMetadataExtension.HttpGetImpl.HandleRequest(HttpContext httpContext)

Is there a way to turn on DISCO in CoreWCF, so that a consuming client can get the WSDL URL? The documentation doesn't seem to address this problem (unless I missed it, which I don't think I did).

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.