Here's the deal. Flex and .NET Datasets don't play well together.
Your web service needs to return a class or an array. Thank the
Java gods that there is a way to do this, but it's a little off-
list. If you would like some help with this and a little sample
code, I can help you.
Tim Hoff
--- In flexcoders@yahoogroups.com, "Ken Bromberger" <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
>
>
> I am trying to consume a dataset returned by an asp.net web
service and
> I get the following error.
>
>
>
> Any help or resources related to consuming web services would be
greatly
> appreciated! - Ken
>
>
>
>
>
> [WSDLError faultString="Element
> http://fatmango/wsExtranet:getContactsResponse not resolvable"
> faultCode="WSDL.BadElement" faultDetail="null"]
>
> at
>
mx.rpc.soap::WSDLParser/http://www.adobe.com/2006/flex/mx/internal::p
ars
> eMessage()
>
> at mx.rpc.soap::WSDLOperation/parseMessages()
>
> at
>
mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::in
vok
> ePendingCall()
>
> at
>
mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::in
vok
> eAllPending()
>
> at mx.rpc.soap::WebService/::unEnqueueCalls()
>
> at
>
mx.rpc.soap::WebService/http://www.adobe.com/2006/flex/mx/internal::w
sdl
> Handler()
>
> at flash.events::EventDispatcher/dispatchEvent()
>
> at mx.rpc.soap::WSDLParser/dispatchEvent()
>
> at mx.rpc.soap::WSDLParser/::parseCompleted()
>
> at
>
mx.rpc.soap::WSDLParser/http://www.adobe.com/2006/flex/mx/internal::h
ttp
> ResultHandler()
>
> at flash.events::EventDispatcher/dispatchEvent()
>
> at
>
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::d
isp
> atchRpcEvent()
>
> at
>
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::r
esu
> ltHandler()
>
> at mx.rpc::Responder/result()
>
> at mx.rpc::AsyncRequest/acknowledge()
>
> at ::DirectHTTPMessageResponder/completeHandler()
>
> at flash.events::EventDispatcher/dispatchEvent()
>
> at flash.net::URLLoader/flash.net:URLLoader::onComplete
()
>
>
>
>
>
> I am able to get a simple "hello world" web service to return a
string
> and display it just fine but when I return the data set flash
crashes
> when the web service is called...
>
>
>
>
>
> Here is the mxml code:
>
>
>
>
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="absolute" creationComplete="wsContacts.getContacts.send()">
>
> <mx:WebService id="wsContacts"
> wsdl="http://fatmango/wsExtranet/getContacts.asmx?wsdl"
> useProxy="false">
>
> <mx:operation name="getContacts" resultFormat="e4x">
>
> <mx:request>
>
> <varCntKey>
>
> 156
>
> </varCntKey>
>
> </mx:request>
>
> </mx:operation>
>
> </mx:WebService>
>
> </mx:Application>
>
>
>
>
>
> Here is the .Net web service code
>
>
>
>
>
>
>
> Imports System.Web.Services
>
> Imports System.Web.Services.Protocols
>
>
>
> <WebService(Namespace:="http://fatmango/wsExtranet")> _
>
> <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
>
> <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()
> _
>
> Public Class getContacts
>
> Inherits System.Web.Services.WebService
>
>
>
> <WebMethod()> _
>
> Public Function getContacts(ByVal varCntKey As Integer) As
> Data.DataSet
>
>
>
> Dim conn As Data.SqlClient.SqlConnection
>
> Dim myDataAdapter As Data.SqlClient.SqlDataAdapter
>
> Dim myDataSet As Data.DataSet
>
> Dim cmdString As String = "Select * From tblCnt Where
CntKey=" &
> varCntKey
>
>
>
> conn = New
> Data.SqlClient.SqlConnection
("Server=monstermango;uid=sa;pwd=******;data
> base=ExtranetData")
>
> myDataAdapter = New Data.SqlClient.SqlDataAdapter
(cmdString,
> conn)
>
>
>
> myDataSet = New Data.DataSet()
>
> myDataAdapter.Fill(myDataSet, "tblCnt")
>
>
>
> Return myDataSet
>
>
>
> End Function
>
>
>
> End Class
>
>
>
> The result of the web service call looks like this...
>
>
>
> <?xml version="1.0" encoding="utf-8" ?>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
<DataSet
> xmlns="http://fatmango/wsExtranet">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
> <xs:schema id="NewDataSet" xmlns=""
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
> <xs:element name="NewDataSet" msdata:IsDataSet="true"
> msdata:UseCurrentLocale="true">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
> <xs:complexType>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
> <xs:choice minOccurs="0" maxOccurs="unbounded">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
> <xs:element name="tblCnt">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
> <xs:complexType>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
> <xs:sequence>
>
> <xs:element name="CntKey" type="xs:int" minOccurs="0" />
>
> <xs:element name="CntTtlKey" type="xs:int" minOccurs="0" />
>
> <xs:element name="CntCmpKey" type="xs:int" minOccurs="0" />
>
> <xs:element name="CntTypeKey" type="xs:int" minOccurs="0" />
>
> <xs:element name="CntDivKey" type="xs:int" minOccurs="0" />
>
> <xs:element name="CntNmTtl" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntFName" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntMName" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntLName" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntAdr" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntCity" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntState" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntZip" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntAdr2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntCity2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntState2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntZip2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntCell1" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntCell2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntPager1" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntPager2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntOPhone" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntOExt" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntOPhone2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntOExt2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntFax1" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntFax2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntHPhone" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntHPhone2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntAltPhone" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntAltPhone2" type="xs:string"
minOccurs="0" />
>
> <xs:element name="CntEmail1" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntEmail2" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntEmail3" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntWeb" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntRadio" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntUsrKey" type="xs:int" minOccurs="0" />
>
> <xs:element name="CntPrjBillCnt" type="xs:boolean"
minOccurs="0" />
>
> <xs:element name="CntPrjReq" type="xs:boolean" minOccurs="0" />
>
> <xs:element name="CntPrjCnt" type="xs:boolean" minOccurs="0" />
>
> <xs:element name="CntCustTtl" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntCrDte" type="xs:dateTime" minOccurs="0" />
>
> <xs:element name="CntBatchID" type="xs:int" minOccurs="0" />
>
> <xs:element name="CntBatchExport" type="xs:boolean"
minOccurs="0" />
>
> <xs:element name="CntPeachID" type="xs:string" minOccurs="0" />
>
> <xs:element name="CntSolCustNO" type="xs:string"
minOccurs="0" />
>
> <xs:element name="CntSolCustID" type="xs:string"
minOccurs="0" />
>
> <xs:element name="CntSolBatchID" type="xs:int" minOccurs="0" />
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
> </xs:choice>
>
> </xs:complexType>
>
> </xs:element>
>
> </xs:schema>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
> <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-
msdata"
> xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
> <NewDataSet xmlns="">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx/getContacts##>
<tblCnt
> diffgr:id="tblCnt1" msdata:rowOrder="0">
>
> <CntKey>145</CntKey>
>
> <CntTtlKey>1</CntTtlKey>
>
> <CntCmpKey>1</CntCmpKey>
>
> <CntTypeKey>1</CntTypeKey>
>
> <CntDivKey>6</CntDivKey>
>
> <CntFName>TEST</CntFName>
>
> <CntMName>S</CntMName>
>
> <CntLName>TEST</CntLName>
>
> <CntAdr>3721 South TEST</CntAdr>
>
> <CntCity>Tacoma</CntCity>
>
> <CntState>WA</CntState>
>
> <CntZip>98000</CntZip>
>
> <CntAdr2 />
>
> <CntCity2 />
>
> <CntState2 />
>
> <CntZip2 />
>
> <CntCell1>0</CntCell1>
>
> <CntCell2>5551231234</CntCell2>
>
> <CntPager1>0</CntPager1>
>
> <CntPager2>0</CntPager2>
>
> <CntOPhone>5551231234</CntOPhone>
>
> <CntOExt>0</CntOExt>
>
> <CntOPhone2>0</CntOPhone2>
>
> <CntOExt2>0</CntOExt2>
>
> <CntFax1>0</CntFax1>
>
> <CntFax2>0</CntFax2>
>
> <CntHPhone>5551231234</CntHPhone>
>
> <CntHPhone2>0</CntHPhone2>
>
> <CntAltPhone>0</CntAltPhone>
>
> <CntAltPhone2>0</CntAltPhone2>
>
> <CntEmail1>[EMAIL PROTECTED]</CntEmail1>
>
> <CntEmail2 />
>
> <CntEmail3 />
>
> <CntWeb />
>
> <CntRadio>0</CntRadio>
>
> <CntUsrKey>6</CntUsrKey>
>
> <CntPrjBillCnt>false</CntPrjBillCnt>
>
> <CntPrjReq>false</CntPrjReq>
>
> <CntPrjCnt>false</CntPrjCnt>
>
> <CntCrDte>2005-10-01T19:57:47.99-07:00</CntCrDte>
>
> <CntBatchID>640</CntBatchID>
>
> <CntBatchExport>true</CntBatchExport>
>
> <CntSolCustNO>RTBCON00</CntSolCustNO>
>
> </tblCnt>
>
> </NewDataSet>
>
> </diffgr:diffgram>
>
> </DataSet>
>
>
>
>
>
>
>
> The WSDL looks like this...
>
>
>
> <?xml version="1.0" encoding="utf-8" ?>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
> <wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:tns="http://fatmango/wsExtranet"
> xmlns:s="http://www.w3.org/2001/XMLSchema"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> targetNamespace="http://fatmango/wsExtranet"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:types>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##> <s:schema
> elementFormDefault="qualified"
> targetNamespace="http://fatmango/wsExtranet">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##> <s:element
> name="getContacts">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<s:complexType>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<s:sequence>
>
> <s:element minOccurs="1" maxOccurs="1" name="varCntKey"
type="s:int"
> />
>
> </s:sequence>
>
> </s:complexType>
>
> </s:element>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##> <s:element
> name="getContactsResponse">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<s:complexType>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<s:sequence>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##> <s:element
> minOccurs="0" maxOccurs="1" name="getContactsResult">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<s:complexType>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<s:sequence>
>
> <s:element ref="s:schema" />
>
> <s:any />
>
> </s:sequence>
>
> </s:complexType>
>
> </s:element>
>
> </s:sequence>
>
> </s:complexType>
>
> </s:element>
>
> </s:schema>
>
> </wsdl:types>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:message
> name="getContactsSoapIn">
>
> <wsdl:part name="parameters" element="tns:getContacts" />
>
> </wsdl:message>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:message
> name="getContactsSoapOut">
>
> <wsdl:part name="parameters"
element="tns:getContactsResponse" />
>
> </wsdl:message>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:portType
> name="getContactsSoap">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:operation
> name="getContacts">
>
> <wsdl:input message="tns:getContactsSoapIn" />
>
> <wsdl:output message="tns:getContactsSoapOut" />
>
> </wsdl:operation>
>
> </wsdl:portType>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:binding
> name="getContactsSoap" type="tns:getContactsSoap">
>
> <soap:binding
transport="http://schemas.xmlsoap.org/soap/http" />
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:operation
> name="getContacts">
>
> <soap:operation
soapAction="http://fatmango/wsExtranet/getContacts"
> style="document" />
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:input>
>
> <soap:body use="literal" />
>
> </wsdl:input>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:output>
>
> <soap:body use="literal" />
>
> </wsdl:output>
>
> </wsdl:operation>
>
> </wsdl:binding>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:binding
> name="getContactsSoap12" type="tns:getContactsSoap">
>
> <soap12:binding
transport="http://schemas.xmlsoap.org/soap/http" />
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:operation
> name="getContacts">
>
> <soap12:operation
soapAction="http://fatmango/wsExtranet/getContacts"
> style="document" />
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:input>
>
> <soap12:body use="literal" />
>
> </wsdl:input>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:output>
>
> <soap12:body use="literal" />
>
> </wsdl:output>
>
> </wsdl:operation>
>
> </wsdl:binding>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##>
<wsdl:service
> name="getContacts">
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##> <wsdl:port
> name="getContactsSoap" binding="tns:getContactsSoap">
>
> <soap:address
location="http://fatmango/wsExtranet/getcontacts.asmx"
> />
>
> </wsdl:port>
>
> - <http://fatmango/wsExtranet/getcontacts.asmx?WSDL##> <wsdl:port
> name="getContactsSoap12" binding="tns:getContactsSoap12">
>
> <soap12:address
location="http://fatmango/wsExtranet/getcontacts.asmx"
> />
>
> </wsdl:port>
>
> </wsdl:service>
>
> </wsdl:definitions>
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.