Expand my Community achievements bar.

Nothing but CFC errors..

Avatar

Level 1

Ok.. so here's the layout;

My personal computer:

          Flex Builder 3

          MAC Leopard

          Dreamweaver CS4

Server:

          ColdFusion MX 6.1 (fully updated)

          IIS

Trying to build a simple CFC to retrieve a record of data from a datasource from within Flex.  When I visit the WSDL URL (http://blah.blah.com/mycfc/db_getbrat.cfc?wsdl), it shows the following:


<wsdl:definitions targetNamespace="http://mycfc">
<wsdl:portType name="db_getBrat">
  </wsdl:portType>

<wsdl:binding name="db_getBrat.cfcSoapBinding" type="impl:db_getBrat">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
</wsdl:binding>

<wsdl:service name="db_getBratService">

<wsdl:port name="db_getBrat.cfc" binding="impl:db_getBrat.cfcSoapBinding">
<wsdlsoap:address location="http://blah.blah.com/mycfc/db_getBrat.cfc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

So it appears that the CFC is working and loaded.  I have even tested the code within the CFC (the SQL query and output) using a basic .CFM file, and it works perfectly.  So I know the DSN and query are working.

However, when I use the following code:

     <mx:WebService id="srv" wsdl="http://blah.blah.com/mycfc/db_getBrat.cfc?wdsl" useProxy="false" showBusyCursor="true" />
   
    <mx:DataGrid dataProvider="{srv.retrieveBrat.lastResult}" width="726" height="194" x="25" y="10">
        <mx:columns>
            <mx:DataGridColumn dataField="contactid" headerText="Contact ID"/>
            <mx:DataGridColumn dataField="firstname" headerText="First Name"/>
            <mx:DataGridColumn dataField="lastname" headerText="Last Name"/>
        </mx:columns>
    </mx:DataGrid>
   
    <mx:Button label="Get Data" click="srv.retrieveBrat()" x="25" y="212"/>

I get the following error in a popup after the application loads:

RPC Fault faultString="Error #1085: The element type "br" must be terminated by the matching end-tag "</br>"." faultCode="Client.CouldNotDecode" faultDetail="Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL (http://blah.blah.com/mycfc/db_getBrat.cfc?wdsl)"]
    at mx.rpc.wsdl::WSDLLoader/faultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:98]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170]
    at mx.rpc.http::HTTPService/http://www.adobe.com/2006/flex/mx/internal::processResult()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\http\HTTPService.as:925]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:188]
    at mx.rpc::Responder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:43]
    at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74]
    at DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:403]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

And when I run a .CFM file to <cfinvoke..> the CFC, I get the following error:

 

Name: http://blah.blah.com/mycfc/db_getBrat.cfc?wdsl. 
WSDL: http://blah.blah.com/mycfc/db_getBrat.cfc?wdsl. org.xml.sax.SAXException:
Fatal Error: URI=null Line=40: Expected "" to terminate element starting on line 16.


Only problem is.. there IS no line 16 in the CFC.. but that's the right one.  Only one in there.  And that very same URL in my browser pulls up
the WSDL info above.

Anyone have a clue as to why this is happening?  I'm about to throw the computers out the window.  (well.. not really.. too expensive)

Thanks to all, in advance, for any help..

1 Reply

Avatar

Level 1

couple things, how come you didnt use and mx:operation tag between the mx:webservice open and close tags?  im not sure if thats even the issue but to me it makes it easier because you specify the function inside the cfc you're trying to call by doing this.

also, most of the time when you get the wsdl error you wrote of, its because of some mal-formed xml.  if your result has any html tags in its output, theres a good chance youll get a parsing error because xml is wicked picky.  youd wanna do a coldfusion string replace function to look for < or > signs.

if you want, post your flex and cfc code, i just finished doing a few projects doing the exact same stuff so i got it fresh in my head!