0 Replies Latest reply on Nov 19, 2010 9:02 AM by Brian Russel Davis

    Problems with ActionScript Proxy for ColdFusion I/O Errors in Sample and Invoke Errors

    Brian Russel Davis

      Hello!

       

      I am going to try to be as explict as possible ( hopefully this gets some traction in Google so others who run into the same error will benefit )

       

      I am trying to use the ActionScript Proxy for ColdFusion : http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS45F7E41F-825B-4fcd-B96D-D5B7E2107E 7E.html .  In particular the <cf:Pdf/> tag ( PDF (cfpdf) )

       

      Here is my code:

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

         xmlns:s="library://ns.adobe.com/flex/spark"

         xmlns:mx="library://ns.adobe.com/flex/mx"

         xmlns:cf="coldfusion.service.mxml.*"

         minWidth="955" minHeight="600" applicationComplete="application1_applicationCompleteHandler(event)">

      <fx:Script>

      <![CDATA[

      import coldfusion.service.events.ColdFusionServiceFaultEvent;

      import coldfusion.service.events.ColdFusionServiceResultEvent;

       

      import mx.events.FlexEvent;

       

      protected function pdf1_faultHandler(event:ColdFusionServiceFaultEvent):void

      {

      // TODO Auto-generated method stub

      trace(event)

      }

       

       

      protected function pdf1_resultHandler(event:ColdFusionServiceResultEvent):void

      {

      // TODO Auto-generated method stub

      trace(event)

      }

       

       

      protected function application1_applicationCompleteHandler(event:FlexEvent):void

      {

      // TODO Auto-generated method stub

      pdfGetInfoTest.execute();

      }

       

      ]]>

      </fx:Script>

      <fx:Declarations>

       

      <cf:Config servicePassword="service" serviceUserName="service" cfPort="8500" cfServer="localHost"/>

      <cf:Pdf id="pdfGetInfoTest" action="GETINFO" fault="pdf1_faultHandler(event)" result="pdf1_resultHandler(event)" source="my_pdf.pdf"/>

       

      <!-- Place non-visual elements (e.g., services, value objects) here -->

      </fx:Declarations>

      </s:Application>

       

      The "my_pdf.pdf" is right beside the code.

       

      The user "service" has been given all the right permissions in the CF Admin Panel.

       

      The IP addresses : 127.0.0.0, *.*.*.* and 0:0:0:0:0:0:0:1 have been set as allowed IP's in CF Admin.

       

      In both Security>Administrator and Security>RDS has been selected.

       

      I have rebooted the CF Server.

       

      But still I get this error:

       

      [FaultEvent fault=[RPC Fault faultString="User service is not authorized to invoke pdf service from 0:0:0:0:0:0:0:1%0." faultCode="Server.Processing" faultDetail="null"] messageId="5BC1B3D0-0108-DF05-442F-3EDFCB13048C" type="fault" bubbles=false cancelable=true eventPhase=2]

       

      If I add this to allowed IPS's : 0:0:0:0:0:0:0:*

       

      I then get this error:

       

      [FaultEvent fault=[RPC Fault faultString="Could not read file from URL my_pdf.pdf" faultCode="Server.Processing" faultDetail="null"] messageId="62AE7923-9F08-E46F-46C8-EB01C4E8E5D7" type="fault" bubbles=false cancelable=true eventPhase=2]

       

      So then I have to specify the ABSOLUTE path to the pdf in the source tag: <cf:Pdf id="pdfGetInfoTest" action="GETINFO" fault="pdf1_faultHandler(event)" result="pdf1_resultHandler(event)" source="http://localhost:8500/TestPDF-debug/my_pdf.pdf"/>

       

      Then ( thank you big baby jesus! ) I get rid of errors!  And I get a normal trace action:

       

      (mx.messaging.messages::AcknowledgeMessage)#0

        body = (Object)#1

          application = "Adobe Acrobat 9.4"

          author = ""

          centerWindowOnScreen = ""

          changingDocument = "Allowed"

          commenting = "Allowed"

          contentExtraction = "Allowed"

          copyContent = "Allowed"

          created = "D:20101119083823-08'00'"

          documentAssembly = "Allowed"

          encryption = "No Security"

          filePath = "/Applications/ColdFusion9/tmpCache/CFFileServlet/_cfservicelayer/_cf-4138005669036998691 .pdf"

          fillingForm = "Allowed"

          fitToWindow = ""

          hideMenubar = ""

          hideToolbar = ""

          hideWindowUI = ""

          keywords = ""

          language = ""

          modified = "D:20101119084020-08'00'"

          pageLayout = "SinglePage"

          pageSizes = (Array)#2

            [0] (Object)#3

              height = 435

              rotation = 0

              width = 525

          printing = "Allowed"

          producer = "Adobe Acrobat 9.4 Image Conversion Plug-in"

          properties = "[]"

          secure = "Allowed"

          showDocumentsOption = ""

          showWindowsOption = ""

          signing = "Allowed"

          subject = ""

          title = ""

          totalPages = 1

          trapped = ""

          version = "1.6"

        clientId = "62C45809-7E0F-9B72-790D-640A530A04FA"

        correlationId = "373D4D96-BC39-5734-9326-65136425B3D2"

        destination = (null)

        headers = (Object)#4

        messageId = "62C4581F-770E-F9B4-E0E7-C0E72A4D6BD4"

        timestamp = 1290185958503

        timeToLive = 0

       

      But will someone, somewhere explain WHY have to add this strange IP address and what that means AND WHY the source can't be a relative path if "my_pdf.pdf" is RIGHT THERE next to the SWF.  Seems like a lot of pain to get something that is supposed to be a time saver to work??

       

      Brian Russel Davis

      "Giving it to you raw in 1's and 0's"

      brian@brianrusseldavis.com | brian@nurdymuny.com