none
Rest Web Service POST Method always return Error 411 - Content-Length required RRS feed

  • Question

  • Hi All,

    I configured a MIM 2016 Rest Web Services Connector to get data from a Web Service defined on an IIS 7 Windows Server 2012.
    I was able to get data definining the Full Import from the GET Method exposed by the Web Service, but there was no way to update an attribute using a POST Method.
    I always get the following error:
    --------------------------------------------------------
    Method Name : Logger : WriteLog Failed to export entries.
    --------- Outer Exception Data ---------
    Message: The remote server returned an error: (411) Length Required.
    Exception root Exception type: Microsoft.MetadirectoryServices.ExtensibleExtensionException
    Source: Microsoft.IdentityManagement.MA.WebServices
    Stack Trace:    at Microsoft.IdentityManagement.MA.WebServices.ExportStrategy.PutExportEntries(IList`1 csEntries)
       at Microsoft.IdentityManagement.MA.WebServices.WebServiceManagementAgent.PutExportEntries(IList`1 csentries)
    Target Site: PutExportEntries
     --------- Inner Exception Data ---------
    Message: The remote server returned an error: (411) Length Required.
    Exception root Exception type: Microsoft.MetadirectoryServices.MetadirectoryServicesException
    Source: Microsoft.IdentityManagement.MA.WebServices.Activities
    Stack Trace:    at Microsoft.IdentityManagement.MA.WebServices.Activities.ExceptionHelper.ThrowException(HttpStatusCode statusCode, Exception ex)
       at Microsoft.IdentityManagement.MA.WebServices.Activities.HttpRestServiceCallActivity.HandleRestServiceException(WebException fault, AsyncCodeActivityContext context)
       at Microsoft.IdentityManagement.MA.WebServices.Activities.HttpRestServiceCallActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
       at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
    Target Site: ThrowException
     --------- Inner Exception Data ---------
    Message: The remote server returned an error: (411) Length Required.
    Exception root Exception type: System.Net.WebException
    Source: System
    Stack Trace:    at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
       at Microsoft.IdentityManagement.MA.WebServices.Activities.HttpRestServiceCallActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
    Target Site: EndGetResponse
    ---------------------------------------------------
    Tracing network communication I noticed the IIS refused the connection because the POST request doesn't contain a correct Content-Length value.
    I tried to add to the POST Method defined in the Web Service Connector Tool an Header parameter to set the Content-Length to 0, but the dash char is not admitted, so I tried to set the ContentLength without it, but I always got the same message.
    Probably the Web Service Tool Header Parameters config can be used only for custom header attributes, not for the standard ones like Content-Length.

    Anyway, is there a way to change the Web Service Connector config to manage the Content-Length?

    Thanks a lot

    Carlo


    Carlo

    Monday, June 18, 2018 8:18 PM