Object in structure, yet not...?

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Object in structure, yet not...?

    Running MX7 on Win2000 / Apache.

    I have a structure in the session, but it won't let me access all the pieces.
    Here is a dump of Session.Sylantro.CallFwd showing the object "forwarding":
    [url]http://www.theprophet.net/dump.gif[/url]. However, trying to actually access the
    forwarding variable (Session.Sylantro.callFwd.forwarding) results in "Element
    SYLANTRO.CALLFWD.FORWARDING is undefined in SESSION."

    I thought maybe it didn't like trying to access the non-native object, but it
    accesses other ones just fine. It's this one and the "treatments" object it
    won't let me access. Why?


    ProphecyVI Guest

  2. Similar Questions and Discussions

    1. Class::Struct - want to access structure within structure
      I want to access a structure within a structure. Below is what I had in mind. Please help. #!/perl/bin/perl use Class::Struct; struct Step...
    2. Add to Structure
      I'm a structures newbie. I need to know how to 1) Determine if a structure already exists 2) If not, create it. If yes, add to it. I've got...
    3. ColdFusion Structure
      How to search the following structure of arrays for a user-provided string and return the key and array position of the match, if any. ...
    4. Query to Structure?
      Hi. I wanted to ask if someone knew how to do the following: I have a structure and a query. <cfset myStruct = StructNew()> <cfset...
    5. W3D structure...
      Hi My big problem is that I have some deformations that are already defined by vertices index, and their moves... But these deformations are...
  3. #2

    Default Re: Object in structure, yet not...?

    Did you try placing <CFDUMP VAR="SessionName"><cfabort> at various places in
    your code to see the state/values of the variables at the time of the error...
    its possible that the value that you are looking for was not defined in the
    session structure.

    smokin_joe Guest

  4. #3

    Default Re: Object in structure, yet not...?

    sorry the correct code is... <cfdump var="#SESSION#">
    smokin_joe Guest

  5. #4

    Default Re: Object in structure, yet not...?

    trust cf, it's not in there as you named it. if your struct is called "SYLANTRO" then accessing methods in that object might be Session.Sylantro.forwarding.yourMethodNameGoesHere ()
    PaulH Guest

  6. #5

    Default Re: Object in structure, yet not...?

    Yea, I can't access any methods or fields either, they all throw the same
    error, but the <cfdump> shows it, and most of the other elements in the
    structure ARE accessible - just these two CF can't handle. Here's some better
    detail.




    The calling screen. (All this is actually done in a couple of custom tags and
    a CFC, but presented this way for simplification.)

    <cfscript>
    Values = StructNew();
    // set up all the values, skipping this for brevity
    strResponse = SendGatewayMessage("Sylantro Instance", Values);
    </cfscript>

    The Java gateway code, again greatly simplified:

    public String outgoingMessage(coldfusion.eventgateway.CFEvent cfmsg) {
    Hashtable theData = new Hashtable();
    skvo = new
    SubscriberKeyVO(subscription.getTenantName(),subsc ription.getExtensionNumber());
    svo = sm.findSubscriber(clog, skvo);
    // ColdFusion sees this complex, non-native
    object perfectly
    theData.put("svo", svo);
    CBusinessFidVO callFwdData = (CBusinessFidVO)
    fidm.getFeatureInstanceData(clog, "SUB", svo.getSubscriberKey(),
    Feature.FEAT_CBIZ);
    //ColdFusion shows this object in any cfdump of
    its parent, but refuses to dump this object itself or access it any way,
    throwing a coldfusion.runtime.UndefinedElementException
    theData.put("forwarding", callFwdData);
    cfcFunction = "onIncomingMessage";
    CFEvent event = new CFEvent(strgatewayID);
    dataOut.put("wtn", strGlobalWTN);
    event.setCfcMethod(cfcFunction);
    event.setData(dataOut);
    event.setGatewayType("Sylantro");
    event.setOriginatorID("");
    for (int i = 0; i < listeners.length; i++) {
    cflog.info("sending to " + listeners[i]);
    event.setCfcPath(listeners[i]);
    gatewayService.addEvent(event);
    }
    }

    Back in the calling page (skipping the gateway's output CFC, it just puts the
    output event into the server scope so the application can see it):

    <cfset Session.Sylantro = Evaluate("Server.Sylantro.WTN" & tmpRef & ".getall")>
    <cfdump var="#Session.Sylantro.callFwd#"> <!--- This works perfectly
    fine, and shows the "forwarding" object --->
    <cfdump var="#Session.Sylantro.callFwd.forwarding#"> <!--- This throws
    undefinedElementException --->
    <cfset myVar = Session.Sylantro.callFwd.forwarding.CallForwardNum ber>
    <!--- so does this --->
    <cfset myVar = Session.Sylantro.callFwd.forwarding.getCallForward Number()>
    <!--- so does this --->
    <cfset myVar = Session.Sylantro.callFwd.forwarding.STATE_CFBNA> <!---
    so does this --->

    ProphecyVI Guest

Posting Permissions

  • You may not post new threads
  • You may 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