Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Webservices QuestionWebservices Question
Previous
 
Next
New Post
3/5/2006 9:07 AM
 

Didn't know where else to put this one. I'm a newbie with webservices and VB.net in general. I'm using VWD Express and this is a learning excercise I've created for myself but I'm running into problems. I've created a web service IO.asmx that handles the webservices "low-level API" (i.e. the changing of an xml file) and another called Menu.asmx that uses the classes defined in IO.asmx.

Here's what I have:

    In IO.asmx

    <WebMethod()> _
    Public Function LoadXML(ByVal sFileName As String, _
                            ByVal asFields() As String) As Data.DataSet
        Dim oDataSet As Data.DataSet = CreateTableStruct(sFileName, asFields)
        oDataSet.ReadXml("c:/website/XMLStorage/XML/" & sFileName & ".xml")
        Return oDataSet
    End Function

    In Menu.asmx

    <WebMethod()> _
    Public Function GetMenu() As Data.DataSet
        'Create instance of IO web service
        Dim oIO As New localhost.IO()
        'Create a DataSet and load it with data from Menu.xml
        Dim oDataSet As Data.DataSet = oIO.LoadXML("menu", "itemname", _
                "itemdescription", "itemprice")
        Return oDataSet
    End Function

1. What is the proper way to reference the methods in Class "IO"? Using the syntax localhost.IO seems to work but I don't think this is what I want to do.

2. I want to keep everything in the IO Class abstract so it can be reused. When IO.LoadXML is called I want to be able to pass it 1 or 100 variables depending on the XML file. The implementation that I'm trying is erroring (see below). Any ideas? Thanx!

Compiler Error Message: BC30311: Value of type 'String' cannot be converted to '1-dimensional array of String'.

Source Error:

Line 18:         Dim oIO As New localhost.IO()
Line 19:         'Create a DataSet and load it with data from Menu.xml
Line 20:         Dim oDataSet As Data.DataSet = oIO.LoadXML("menu", "itemname", _
Line 21:                 "itemdescription", "itemprice")
Line 22:         Return oDataSet

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Webservices QuestionWebservices Question


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out