web service issue with boolean data tyoes

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

  1. #1

    Default web service issue with boolean data tyoes

    When I switched the access method of My CFC to a web service, I noticed that
    booleans are outputted differently. When called as a Web Service, a boolean is
    outputted as Yes/No. When called as a CFC, a boolean is outputted 1/0. My CFC
    is actually returning a Query but the SQL Server BIT columns in the results are
    outputting the way described above. I can easily get around it by doing
    CAST(Columnname AS INT) in my SQL, but was wondering if this is expected
    behavior for a web service? We will initially be having a wireless smartphone
    client doing a HTTP XML Post to a CFM page, which then calls the web service,
    and outputs XML to the phone using the query results Our engineers working on
    the smartphones want booleans to be 1/0 in the XML, not Yes/No. Their XML
    parser is a custom built C++ version of Xerces. Any comments would be helpful.
    testboolean.cfc ----- <cfcomponent> <cffunction name='test' output='false'
    returntype='boolean' access='remote'> <cfset a = 1> <cfreturn a> </cffunction>
    </cfcomponent> testboolean.html ----- <cfinvoke
    webservice='http://mydomain.com/testboolean.cfc?wsdl' returnvariable='a'
    method='test'> Web Service Result: <cfoutput>#a#</cfoutput> (This returns YES)
    <br> <cfinvoke component='testboolean' method='test' returnvariable='a'> CFC
    Result: <cfoutput>#a#</cfoutput> (This returns 1)

    Coos Guest

  2. Similar Questions and Discussions

    1. Web Service / SSL Issue
      Did you ever get a solution to this problem? I'm just creating some webservices which work perfectly on their own, perfectly under HTTP directory...
    2. Web Service Deployment issue(s)
      Hello, I am just learning the ins and outs of web services and their implementation and I'm having a bit of difficult successfully moving a...
    3. Boolean column in a data grid
      My data grid constains several boolean columns, it is connected to a dataset. Can anyone tell me why i have to click the bool columns (init value...
    4. Referencing web service complex data type within a second web service (like a delegate)
      Hi, I am trying to figure out if ASP.NET XML Web Services and the WSDL standard can handle this type of scenario: I have two web services, and...
    5. Boolean Data Column Check Box
      I am using a DataColumn with the Boolean data type. This produces a check box in the DataGrid displayed on the screen. The problem is, when I try...
  3. #2

    Default Re: web service issue with boolean data tyoes

    Yes, this is "expected behavior" for a web service Boolean.

    In CFML, YES or 1 or TRUE are all the same.

    --
    Tom Jordahl
    Macromedia Server Development


    Tom Jordahl 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