Lec 17 Problems with server

168 views
Skip to first unread message

Vasil

unread,
Oct 20, 2010, 2:06:51 PM10/20/10
to Flex 3:Training from the Source
Hello, I have a problem with lesson 17 - Working with Web Services:
Handling Web Services part.
I've started the Cold Fusion server, it works fine - it returns the
categorizedProducts.xml file, category.xml, rawSalesData.xml etc.
But when I put the WebService for the first time and implemented the
getSalesData() and getTypeSalesData() in Dashboard.mxml, received the
following fault:
DecodingError:SOAP Response cannot be decoded. Raw response:
I received it twice (once for each call, I presume)

Any idea is helpful
Thank you

Vasil

unread,
Oct 20, 2010, 2:27:38 PM10/20/10
to Flex 3:Training from the Source
I installed the Cold Fusion on C:/, reinstalled it again, but nothing.
I'm using Windows XP.

Jeff Tapper

unread,
Oct 20, 2010, 2:29:42 PM10/20/10
to Flex 3:Training from the Source
Can you post the raw response? im wondering if the CF Server is
tacking on an additional header which is messing up the parsing.

Vasil

unread,
Oct 20, 2010, 5:22:30 PM10/20/10
to Flex 3:Training from the Source
By using event.toString() i got this message: (event is type
FaultEvent)

[FaultEvent fault=[RPC Fault faultString="SOAP Response cannot be
decoded. Raw response: " faultCode="DecodingError" faultDetail="null"]
messageId="A1D705D8-3EDE-4CE0-02AB-CB14F3EBADF9" type="fault"
bubbles=false cancelable=true eventPhase=2]

by using event.fault.faultString i received the very first message.

Seems I can't get the raw response. Is there any other way to access
the raw response?

Thank you

Jeff Tapper

unread,
Oct 20, 2010, 5:50:21 PM10/20/10
to Flex 3:Training from the Source
try event.token.message.body

not sure if thats right, buts its pretty close.

if that doesnt work, set a break point in the fault handler, and
explore the event.token to see if you can find the text of the
response

Vasil

unread,
Oct 20, 2010, 6:35:48 PM10/20/10
to Flex 3:Training from the Source
I used event.token.message.body, got this XML:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/">
<intf:getTypeSalesData xmlns:intf="http://cfcs.flexGrocer">
<startDate xsi:type="xsd:dateTime">2006-03-31T22:00:00Z</
startDate>
<endDate xsi:type="xsd:dateTime">2006-04-30T22:00:00Z</endDate>
</intf:getTypeSalesData>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


event.token.message.body gave this (longer) XML

(mx.messaging.messages::SOAPMessage)#0
body = "<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://
schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/
XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/">
<impl:getSalesData xmlns:impl="http://cfcs.flexGrocer">
<startDate xsi:type="xsd:dateTime">2006-03-31T22:00:00Z</
startDate>
<endDate xsi:type="xsd:dateTime">2006-04-30T22:00:00Z</endDate>
<category xsi:type="xsd:string">All</category>
</impl:getSalesData>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>"
clientId = "DirectHTTPChannel0"
contentType = "text/xml; charset=utf-8"
destination = "DefaultHTTP"
headers = (Object)#1
DSEndpoint = "direct_http_channel"
httpHeaders = (Object)#2
SOAPAction = """"
messageId = "9993EA9F-65C2-A94B-F743-CBB93701C3E6"
method = "POST"
recordHeaders = false
timestamp = 0
timeToLive = 0
url = "http://localhost:8300/flexGrocer/cfcs/aggregate.cfc"

I hoped this helped ...

Vasil

unread,
Oct 20, 2010, 6:37:06 PM10/20/10
to Flex 3:Training from the Source
the second one is received with event.token.message.toString() method,
sorry for the mistake

Jeff Tapper

unread,
Oct 20, 2010, 8:25:21 PM10/20/10
to Flex 3:Training from the Source
odd, i dont see anthing inherently invalid about that response. Just
so i can be on the same page (literally), which exercise in lesson 17
are you doing?

Vasil

unread,
Oct 21, 2010, 9:29:54 AM10/21/10
to Flex 3:Training from the Source
Page 450 - 457 Using a web service in the Dashboard.

Thank you

Jeff Tapper

unread,
Oct 21, 2010, 11:24:09 AM10/21/10
to Flex 3:Training from the Source
ok, a couple of things for you to try.

1st: Call the cfc method from the browser directly. Open this in a
browser and see what the response is:

http://localhost:8300/flexGrocer/cfcs/aggregate.cfc?method=getTypeSalesData&startDate=3/31/2006&endDate=4/1/2006

if there is an error, please post it back here, otherwise, onto step
2.

2: open C:\cfusionFlexTFS\servers\cfusion\cfusion-ear\cfusion-war
\flexGrocer\cfcs\aggregate.cfc, and delete line 81 (which reads:
<cfdump var="#aData#"> ). Then run it again in the browser. If
everything is working properly, you should see something like this in
the browser:
1467.0Vegetables8534.01674.0Dairy8715.01155.0Fruit6825.01755.0Meat9391.0998.0Seafood6848.01410.0Deli7466.0

and if you view source, you should see something like this:

<wddxpacket version="1.0">
<header>
<data>
<array length="6">
<struct>
<var name="NET">
<number>1467.0</number>
</var>
<var name="CATEGORY">
<string>Vegetables</string>
</var>
<var name="GROSS">
<number>8534.0</number>
</var>
</struct>
<struct>
<var name="NET">
<number>1674.0</number>
</var>
<var name="CATEGORY">
<string>Dairy</string>
</var>
<var name="GROSS">
<number>8715.0</number>
</var>
</struct>
<struct>
<var name="NET">
<number>1155.0</number>
</var>
<var name="CATEGORY">
<string>Fruit</string>
</var>
<var name="GROSS">
<number>6825.0</number>
</var>
</struct>
<struct>
<var name="NET">
<number>1755.0</number>
</var>
<var name="CATEGORY">
<string>Meat</string>
</var>
<var name="GROSS">
<number>9391.0</number>
</var>
</struct>
<struct>
<var name="NET">
<number>998.0</number>
</var>
<var name="CATEGORY">
<string>Seafood</string>
</var>
<var name="GROSS">
<number>6848.0</number>
</var>
</struct>
<struct>
<var name="NET">
<number>1410.0</number>
</var>
<var name="CATEGORY">
<string>Deli</string>
</var>
<var name="GROSS">
<number>7466.0</number>
</var>
</struct>
</array>
</data>
</header>
</wddxpacket>


is this what you are seeing? anything else?

Vasil

unread,
Oct 21, 2010, 3:23:48 PM10/21/10
to Flex 3:Training from the Source
hello, calling the cfc method resulted with error in the browser:


Error Occurred While Processing Request
Error Executing Database Query.
Internal OLE Automation error


Resources:
Enable Robust Exception Information to provide greater detail about
the source of errors. In the Administrator, click Debugging & Logging
> Debug Output Settings, and select the Robust Exception Information
option.
Check the ColdFusion documentation to verify that you are using the
correct syntax.
Search the Knowledge Base to find a solution to your problem.


Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR
3.0.04506.648; .NET CLR 3.5.21022; OfficeLiveConnector.1.3;
OfficeLivePatch.0.0)
Remote Address 127.0.0.1
Referrer
Date/Time 21-Oct-10 09:15 PM

Jeff Tapper

unread,
Oct 21, 2010, 4:26:45 PM10/21/10
to Flex 3:Training from the Source
ok, so its clearly a problem with your CF server reading from your
database. Did you install the CF server exactly as it listed in the
book, that is, extract all the contents of the zip file to the root of
the c drive?

On Oct 21, 3:23 pm, Vasil <boroza...@gmail.com> wrote:

Vasil

unread,
Nov 2, 2010, 6:37:16 PM11/2/10
to Flex 3:Training from the Source
Hello again, firstly i am sorry about the delay since my last post.
The location of the file is as suggested(C:\cfusionFlexTFS\servers
\cfusion\cfusion-ear\cfusion-war\flexGrocer\cfcs\aggregate.cfc).
All other Web services till Chapter 19 are working perfectly.
I was inspecting the aggregate.cfc file, and managed to find my error.

Inside it, the code for the CFFUNCTION getRawSalesData was the
troubling part, more specific, the cfquery:

SELECT dtSale, category, sumcost, sumList
FROM aggregateSales a, category c
WHERE a.categoryID = c.categoryID
AND dtSale between #createODBCDate(startDate)# and
#createODBCDate(endDate)#
ORDER BY dtSale, category

The strange part is, when I deleted the "AND dtSale between .." row,
the query executes successfully, and no error is reported.
Is there alternative to get specific date-bounded results in Cold
Fusion?

Hope that this will help for someone with similar problem
Thank you for your help
Reply all
Reply to author
Forward
0 new messages