0 Replies Latest reply on Jul 1, 2014 10:37 AM by flex_anoop

    Urgent requirement : security error accessing url and http error: standalone flex

    flex_anoop

      Hi,

      I have a requirement to create record from standalone flex. I am using Flex builder 3.

       

      I used Flex-force toolkit to login  to salesforce. The swf file generated when used internal to salesforce it works great.

       

      But my requirement is to run it from public sites page / standalone pages. How will I configure it? I am getting error 'security error accessing url', default HTTP

       

      The requirement is on priority, please help me to resolve this issue.

       

      The login code is also furnished below. please help.

       

      Full error details:

       

      (com.salesforce.events::ApexFaultEvent)#0

        bubbles = false

        cancelable = true

        context = (null)

        currentTarget = (null)

        eventPhase = 2

        fault = (mx.rpc::Fault)#1

          content = (null)

          errorID = 0

          faultCode = "Channel.Security.Error"

          faultDetail = "Destination: DefaultHTTP"

          faultString = "Security error accessing url"

          message = "faultCode:Channel.Security.Error faultString:'Security error accessing url' faultDetail:'Destination: DefaultHTTP'"

          name = "Error"

          rootCause = (flash.events::SecurityErrorEvent)#2

            bubbles = false

            cancelable = false

            currentTarget = (flash.net::URLLoader)#3

              bytesLoaded = 0

              bytesTotal = 0

              data = (null)

              dataFormat = "text"

            eventPhase = 2

            target = (flash.net::URLLoader)#3

            text = "Error #2170: Security sandbox violation: file:///C|/Users/R/DOCUME%7E1/FLEXBU%7E1/TESTLO%7E1/BIN%2DRE%7E1/TESTLO%7E1.SWF cannot send HTTP headers to https://login.salesforce.com/services/Soap/u/14.0?1000.1153011256829."

            type = "securityError"

        headers = (null)

        message = (mx.messaging.messages::ErrorMessage)#4

          body = (null)

          clientId = "DirectHTTPChannel0"

          correlationId = "B8A1B02E-CE17-DCBA-4894-F2E4CBEB7C04"

          destination = ""

          extendedData = (null)

          faultCode = "Channel.Security.Error"

          faultDetail = "Destination: DefaultHTTP"

          faultString = "Security error accessing url"

          headers = (Object)#5

            DSStatusCode = 0

          messageId = "41F6A90D-ECAE-EA2D-7C84-F2E4DABD72F3"

          rootCause = (flash.events::SecurityErrorEvent)#2

          timestamp = 0

          timeToLive = 0

        messageId = "41F6A90D-ECAE-EA2D-7C84-F2E4DABD72F3"

        statusCode = 0

        target = (null)

        token = (mx.rpc::AsyncToken)#6

          message = (mx.messaging.messages::HTTPRequestMessage)#7

            body = "<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/"><se:Header xmlns:sfns="urn:partner.soap.sforce.com"/><se:Body><login xmlns="urn:partner.soap.sforce.com" xmlns:ns1="sobject.partner.soap.sforce.com"><username>uname</username><password>pwdandsec token</password></login></se:Body></se:Envelope>"

            clientId = (null)

            contentType = "text/xml; charset=UTF-8"

            destination = "DefaultHTTP"

            headers = (Object)#8

              DSEndpoint = "direct_http_channel"

            httpHeaders = (Object)#9

              Accept = "text/xml"

              SOAPAction = """"

              X-Salesforce-No-500-SC = "true"

            messageId = "B8A1B02E-CE17-DCBA-4894-F2E4CBEB7C04"

            method = "POST"

            recordHeaders = false

            timestamp = 0

            timeToLive = 0

            url = "https://login.salesforce.com/services/Soap/u/14.0?1000.1153011256829"

          responders = (Array)#10

            [0] (::SalesForceResponder)#11

          result = (null)

        type = "fault"

       

      Login code:

      [Bindable] public var sfdc:Connection = new Connection();

      private function login():void {

      Security.loadPolicyFile("http://salesforce.com/services/crossdomain.xml");

      var lr:LoginRequest = new LoginRequest();

      lr.username = "uname";

      lr.password = "pwdtoken";

      sfdc.protocol = "https";

      sfdc.serverUrl = "https://login.salesforce.com/services/Soap/u/14.0";

      lr.callback = new AsyncResponder(loginSuccess, loginFault);

      sfdc.login(lr);