Data Loss Prevention

 View Only
  • 1.  Reporting API: error retrieving data from DLP

    Posted Sep 17, 2014 11:09 AM

    Hi,

    i am looking for any help regarding retrieving data using API. The code successfully opens the client, but fails to retrieve data (incidentList call). The error:

    "System.ServiceModel.ProtocolException was unhandled... response message does not match the content type of the binding (text/xml; charset=utf-8)"

    The fault code in the return SOAP envelop:

     <faultstring>Authentication failed</faultstring>
          <detail>
            <AuthenticationFault:AuthenticationFault xmlns:AuthenticationFault="http://www.vontu.com/enforce/webservice/incident/schema" xmlns="" xmlns:ns7="http://www.vontu.com/enforce/webservice/incident/schema" reason="Authentication failed"/>
          </detail>

    I am using correct crudentials to connect, userID/password combination works fine while logging from the console.

    Here is the code fragment I am running, C#:

                string client_username = "userID";
                string client_password = "pass123";

                string url = "https://enforce_host/ProtectManager/services/reporting";

                EndpointAddress epAddress = new EndpointAddress(url);

                BasicHttpBinding httpBinding = new BasicHttpBinding();
                httpBinding.Security.Mode = BasicHttpSecurityMode.Transport;
                httpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
                            

                ReportingServicePortTypeClient client = new ReportingServicePortTypeClient(httpBinding, epAddress);

                client.ClientCredentials.UserName.UserName = client_username;
                client.ClientCredentials.UserName.Password = client_password;

                IEndpointBehavior behavior = new  HttpBasicAuthenticationEndpointBehavior();
                client.Endpoint.Behaviors.Add(behavior);

                
                client.Open();           

                IncidentListRequest request = new IncidentListRequest();

                int reportID = 999;

                request.savedReportId = reportID;

               List<int> ids = new List<int>();

                ids.AddRange(client.incidentList(request)); // --->> Execption is here 

     

    Any suggestions are welcome!

    Thanks!

    Alex

     



  • 2.  RE: Reporting API: error retrieving data from DLP

    Trusted Advisor
    Posted Sep 18, 2014 01:44 AM

    hello

     

     does the userID used in your script is allowed to do some call to webservice ?

    Did you check the error message in DLP log files ?

     regards.



  • 3.  RE: Reporting API: error retrieving data from DLP

    Posted Sep 19, 2014 03:31 AM

    It seems there is some authetication issue between API and DB. Plz make sure that DLP DB and APPS may have different authetications so verify and try