Professional Web Applications Themes

Need help with webservice - Macromedia Flex General Discussion

I want to collect data using Flex and insert into a remote server's database. On the remote server, I've got CF running with a cfc file that takes care of the actual insertion. I know the cfc works because we're calling/using it right now from a different CF file. What I'm not sure about is how to call the same cfc properly from a Flex ActionScript. The error message that I'm getting is: message = ProxyBase.faultHandler() -- Error calling/opening submit! faultString = Timeout on call to undefined What am I missing and how do I fix it? Thanks in advance ...

  1. #1

    Default Need help with webservice

    I want to collect data using Flex and insert into a remote server's database.
    On the remote server, I've got CF running with a cfc file that takes care of
    the actual insertion. I know the cfc works because we're calling/using it right
    now from a different CF file. What I'm not sure about is how to call the same
    cfc properly from a Flex ActionScript.

    The error message that I'm getting is:
    message = ProxyBase.faultHandler() -- Error calling/opening submit!
    faultString = Timeout on call to undefined

    What am I missing and how do I fix it? Thanks in advance for your help!

    Stelly
    ---------------
    In the form.mxml where I have my form, I've got this:
    function sendInquiry() {
    var temp;
    temp= mx.validators.Validator.isStructureValid(this,'Che ckModel');
    if (temp == true) {
    if (insertProxy == null) insertProxy =
    ProxyFactory.getProxy("toRemoteServer");
    insertProxy.invoke( "submit", this, "getInsertResult",input1,input2);
    }
    }
    function getInsertResult(result) {
    insertResult = result;
    }
    -------------
    Then in a serviceProxy.mxml file I've got:
    <mx:WebService id="toRemoteServer"
    serviceName="sendtoRemoteServer"
    useProxy="true"
    result="resultHandler(event)"
    fault="faultHandler(event)"
    showBusyCursor="true"/>
    -------------
    In the flex-config.mxml, I've got
    <web-service-proxy>
    <proxy-use-policy>client</proxy-use-policy>
    <url>{context.root}/flashproxy</url>
    <https-url>{context.root}/flashproxy</https-url>
    <allow-url-override>false</allow-url-override>
    <allow-lax-ssl>false</allow-lax-ssl>
    <whitelist>
    <unnamed>
    <url>https://*</url>
    </unnamed>
    <named>
    <service name="sendtoRemoteServer">
    <wsdl>https://myremoteserver/mycfcfile.cfc?wsdl</wsdl>
    <endpoints>

    <endpoint>https://myremoteserver/mycfcfile.cfc</endpoint>
    </endpoints>
    <run-as user="myLoginOntheRemoteServer"
    password="myPasswordFortheRemoteServer"/>
    </service>
    </named>
    </whitelist>
    </web-service-proxy>
    -------------
    Finally, in my cfc, I've got:
    <cfcomponent output="false" displaystring="" hint="On-Line Inquiry Form
    Handler">

    <cffunction name="submit" returntype="boolean" output="false"
    access="remote">
    <cfargument name="address" type="string" default="" />
    <cfargument name="budget" type="string" default="" />
    ...etc
    </cffunction>
    </cfcomponent>

    Stelly@abovenet Guest

  2. #2

    Default Re: Need help with webservice

    Welp. I'd skip doing the webservice route and access your cfc as a
    RemoteObject. The syntax is almost the same. In your flex-config.xml open up
    the remoteobject whitelist and set the unnamed <source>*</source> to test if
    connectivity is there. Similarly with the webservice stuff, white list
    everything for unnamed webservices just to make sure this isn't the problem.
    Once you get the functionality going, then you can lock it down.

    But looking at your code.. First I would rename your function from submit to
    somehing else, as Flex already has a submit function on WS and RO operations.
    Eg make it insertData.

    In your webservice you probably need to define the function name like this I
    think:

    <mx:WebService id="myWS" wsdl="http://myremoteserver/mycfcfile.cfc?wsdl">
    <mx:operation name="insertData" result="getInsertResult(event.result)"/>
    </mx:WebService>

    And lets simplify your function to just:

    function sendInquiry() {
    myWS.insertData(input1,input2).submit();
    }


    Check out these links:

    [url]http://www.richinternet.de/blog/index.cfm?entry=831FE26E-0D70-9C2D-2549E1D1978CF[/url]
    1B0

    [url]http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=1013[/url]


    DOPEJAM Guest

Similar Threads

  1. Can a webservice call another webservice?
    By Chris Ludlow in forum ASP.NET Web Services
    Replies: 2
    Last Post: June 23rd, 08:22 AM
  2. CFC WebService
    By theMex in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: April 29th, 04:50 PM
  3. Calling a webservice from a webservice
    By bgauvey@gmail.com in forum ASP.NET Web Services
    Replies: 2
    Last Post: April 20th, 02:02 PM
  4. How to communicates with another webservice with another webservice
    By Dotnet developer in forum ASP.NET Web Services
    Replies: 3
    Last Post: April 13th, 05:52 AM
  5. Webservice calling a webservice.....Error
    By Peter Nordström in forum ASP.NET Web Services
    Replies: 0
    Last Post: October 21st, 12:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139