Web Service CFC: Inserting multiple records

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

  1. #1

    Default Web Service CFC: Inserting multiple records

    I'm trying to create a web service in Coldfusion MX 6.1 that will allow a third
    party to upload an arbitrary number of records into our system, through a
    single call to the service. Basically I want to set it up to handle multiple
    tiers in the end to be similar to this:

    Customers (Parent)
    > Customer[1] (Child of Customers)
    > > Address[1] (Child of Customer[1])
    > > Address[2]
    > Customer[2]
    > > Address[1]
    > Customer[3]
    I can't figure out how to get the Customer.cfc to be a part of an array. I
    want the WSDL file to show the structure properly so that the third party can
    do their implementation easily based off of the generated file. If I do this,
    I get some nasty Java errors:

    <cfcomponent displayName="ModifyCustomers">
    <cfproperty name="Customers" type="Array" required="true">
    <cfproperty name="Customers.Customer" type="Customer" required="true">
    .... code ....
    </cfcomponent>

    I've looked everywhere for an example along these lines, but there doesn't
    appear to be any. Any idea on how to get this to work?

    Thanks,

    Patrick

    GiantGinkgo Guest

  2. Similar Questions and Discussions

    1. Error inserting records
      I am getting this error: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' Syntax error in INSERT INTO statement My code is as...
    2. Inserting and Updating Records at the same time
      Hi, Ive created a form which inserts a record into one table within the database, but i also need it to increment a field in another table of the...
    3. serialization errors when inserting new records
      Hoi, I searched the archives but couldn't find an answer to this: I have a table (simplyfied) CREATE TABLE test ( id INT PRIMARY KEY,...
    4. Inserting blank records
      I need to import records created in filemaker to an accounting program (MYOB). It can only recognise different records if there is a blank in...
    5. Inserting Records with Bound Controls
      This may seem obvious but I cant seem to find anything on it. Is it possible to use bound controls to insert a new record into a database? I have a...
  3. #2

    Default Re: Web Service CFC: Inserting multiple records

    Bump!
    GiantGinkgo Guest

  4. #3

    Default Re: Web Service CFC: Inserting multiple records

    You should be able to define an array of customer.cfc:
    <cfargument name="in" type="customer[]" required="yes">

    Then in your customer.cfc file you can have cfproperties that are arrays
    themselves:
    <cfproperty name="address" type="array">

    I think that should get you going in the right direction.

    --
    Tom Jordahl
    Macromedia Server Development


    Tom Jordahl Guest

  5. #4

    Default Re: Web Service CFC: Inserting multiple records

    Tom,

    Is this CF7 syntax you're using here? The syntax you gave in your example does
    not work in 6.1? Like Patrick, I'm trying to create a simple service that takes
    in an array of arrays or an array of structures (whichever one I can get
    working first).

    And like Patrick, I need this structure to be reflected in the WSDL that's
    auto-magically created so third-parties can consume.

    Any help would be appreciated - I've found very little in documentation on
    this subject. If CF can't do this, please recommend another route.

    MSDesigns 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