4 Replies Latest reply on Oct 23, 2006 11:25 AM by pete-polecat

    asp.net vb WSDL

    pete-polecat Level 1
      Hi
      Sorry if im a pain but im impressed with what i have seen of Flex 2 but im having trouble playing with data
      i have created a asp.net vb webservice

      quote:


      'listing categories from my access database
      <WebMethod()> Public Function ListCats() As DataSet
      Dim myConnection As OleDbConnection
      Dim myDataAdapter As OleDbDataAdapter
      Dim myDataSet As DataSet

      myConnection = New OleDbConnection _
      ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" + _
      Server.MapPath("db\my.mdb"))
      myDataAdapter = New _
      OleDbDataAdapter("SELECT * FROM cats WHERE catON ='Y'", myConnection)
      myDataSet = New DataSet()
      myDataAdapter.Fill(myDataSet)
      Return myDataSet
      End Function



      When i go to http://localhost:2004/DataServices/DBcatsService.asmx then invoke i see all the elements displayed with the returned data.

      - <xs:schema id="NewDataSet" xmlns="" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
      - <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      - <xs:complexType>
      - <xs:choice minOccurs="0" maxOccurs="unbounded">
      - <xs:element name="Table">
      - <xs:complexType>
      - <xs:sequence>
      <xs:element name="idCategory" type="xs:int" minOccurs="0" />
      <xs:element name="categoryDesc" type="xs:string" minOccurs="0" />
      <xs:element name="idParentCategory" type="xs:int" minOccurs="0" />
      <xs:element name="categoryFeatured" type="xs:string" minOccurs="0" />
      <xs:element name="CategoryHTML" type="xs:string" minOccurs="0" />
      <xs:element name="sortOrder" type="xs:int" minOccurs="0" />
      <xs:element name="categoryHTMLLong" type="xs:string" minOccurs="0" />
      <xs:element name="smallImageURL" type="xs:string" minOccurs="0" />
      <xs:element name="categoryfooter" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:choice>
      </xs:complexType>
      </xs:element>
      </xs:schema>
      - <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
      - <NewDataSet xmlns="">
      - <Table diffgr:id="Table1" msdata:rowOrder="0">
      <idCategory>72</idCategory>
      <categoryDesc>Large Studies</categoryDesc>
      <idParentCategory>1</idParentCategory>
      <categoryFeatured>Y</categoryFeatured>
      <CategoryHTML />
      <sortOrder>10</sortOrder>
      <categoryHTMLLong />
      <smallImageURL />
      <categoryfooter />
      </Table>
      - <Table diffgr:id="Table2" msdata:rowOrder="1">
      <idCategory>73</idCategory>
      <categoryDesc>Medium Studies</categoryDesc>
      <idParentCategory>1</idParentCategory>
      <categoryFeatured>Y</categoryFeatured>
      <CategoryHTML />
      <sortOrder>20</sortOrder>
      <categoryHTMLLong />
      <smallImageURL />
      <categoryfooter />
      </Table>

      In flex builder 2 have have tried loads of ways of getting and displaying the data but it just does not work

      quote:


      <mx:WebService id="DBcatsService"
      wsdl=" http://localhost:2004/DataServices/DBcatsService.asmx?WSDL"
      showBusyCursor="true" />
      <mx:Button label="Talk to server" click="DBcatsService.ListCats()" x="245" y="33"/>

      <mx:TextArea text="{DBcatsService.ListCats.lastResult }" x="236" y="282"/>



      I know this is probably wrong and i have read loads on event handlers but just cant get my head round this any help on syntax just to get this to work so i can learn from it would be great..I dont know if its the web service but all the examples i find are in c#.net and i use vb.net

      quote:


      This is the error returned by flex on button click event


      [WSDLError faultString="Element http://screaminlean.co.uk/catsDataService:ListCatsResponse not resolvable" faultCode="WSDL.BadElement" faultDetail="null"]
      at mx.rpc.soap::WSDLParser/ http://www.adobe.com/2006/flex/mx/internal::parseMessage()
      at mx.rpc.soap::WSDLOperation/parseMessages()
      at mx.rpc.soap::Operation/ http://www.adobe.com/2006/flex/mx/internal::invokePendingCall()
      at mx.rpc.soap::Operation/send()
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.rpc.soap.mxml::Operation/send()
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.rpc::AbstractService/ http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()
      at Store/___Button1_click()