PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

ASMX not showing webmethod that should return a dataset

 
 
=?Utf-8?B?TWljaGFlbCBSZWluaGFydA==?=
Guest
Posts: n/a
 
      30th Oct 2006
Hi all...

I'm fairly new to buildling web services in .NET 2.0. Using VB.NET (2005),
I'm doing something like this in a webmethod:

- instantiating a 3rd party business object (QuickBooks customers actually)
- iterating through the collection and adding rows to a DataTable in a DataSet
- Returning the DataSet ("Return dsCustomers")

I've got other webmethods that return strings working just fine. I know the
code in this method works, because I've tested it inside an ASP.NET page.

My questions are:

1) if it compiles, why wouldn't the method show up in the service's ASMX page?
2) what's the best way to debug a web service like this?

Thanks,
Michael
 
Reply With Quote
 
 
 
 
W.G. Ryan [MVP]
Guest
Posts: n/a
 
      30th Oct 2006
Do you have it marked with the WebMethod attribute? That's the usual
culprit. You can use the debugger like you normally would but I'd recommend
logging once it's past development.
"Michael Reinhart" <(E-Mail Removed)> wrote in
message news:8E82C411-9BAC-4DD5-948C-(E-Mail Removed)...
> Hi all...
>
> I'm fairly new to buildling web services in .NET 2.0. Using VB.NET
> (2005),
> I'm doing something like this in a webmethod:
>
> - instantiating a 3rd party business object (QuickBooks customers
> actually)
> - iterating through the collection and adding rows to a DataTable in a
> DataSet
> - Returning the DataSet ("Return dsCustomers")
>
> I've got other webmethods that return strings working just fine. I know
> the
> code in this method works, because I've tested it inside an ASP.NET page.
>
> My questions are:
>
> 1) if it compiles, why wouldn't the method show up in the service's ASMX
> page?
> 2) what's the best way to debug a web service like this?
>
> Thanks,
> Michael



 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWljaGFlbCBSZWluaGFydA==?=
Guest
Posts: n/a
 
      30th Oct 2006
Yes... I'm using it exactly as I am for methods that ARE working...

Any thoughts?

Michael


"W.G. Ryan [MVP]" wrote:

> Do you have it marked with the WebMethod attribute? That's the usual
> culprit. You can use the debugger like you normally would but I'd recommend
> logging once it's past development.
> "Michael Reinhart" <(E-Mail Removed)> wrote in
> message news:8E82C411-9BAC-4DD5-948C-(E-Mail Removed)...
> > Hi all...
> >
> > I'm fairly new to buildling web services in .NET 2.0. Using VB.NET
> > (2005),
> > I'm doing something like this in a webmethod:
> >
> > - instantiating a 3rd party business object (QuickBooks customers
> > actually)
> > - iterating through the collection and adding rows to a DataTable in a
> > DataSet
> > - Returning the DataSet ("Return dsCustomers")
> >
> > I've got other webmethods that return strings working just fine. I know
> > the
> > code in this method works, because I've tested it inside an ASP.NET page.
> >
> > My questions are:
> >
> > 1) if it compiles, why wouldn't the method show up in the service's ASMX
> > page?
> > 2) what's the best way to debug a web service like this?
> >
> > Thanks,
> > Michael

>
>
>

 
Reply With Quote
 
Jeff Dillon
Guest
Posts: n/a
 
      31st Oct 2006
Show your code

"Michael Reinhart" <(E-Mail Removed)> wrote in
message news:8E82C411-9BAC-4DD5-948C-(E-Mail Removed)...
> Hi all...
>
> I'm fairly new to buildling web services in .NET 2.0. Using VB.NET
> (2005),
> I'm doing something like this in a webmethod:
>
> - instantiating a 3rd party business object (QuickBooks customers
> actually)
> - iterating through the collection and adding rows to a DataTable in a
> DataSet
> - Returning the DataSet ("Return dsCustomers")
>
> I've got other webmethods that return strings working just fine. I know
> the
> code in this method works, because I've tested it inside an ASP.NET page.
>
> My questions are:
>
> 1) if it compiles, why wouldn't the method show up in the service's ASMX
> page?
> 2) what's the best way to debug a web service like this?
>
> Thanks,
> Michael



 
Reply With Quote
 
W.G. Ryan [MVP]
Guest
Posts: n/a
 
      31st Oct 2006
Like Jeff mentions, it's probably best to show the code.
"Michael Reinhart" <(E-Mail Removed)> wrote in
message news:566687BD-1575-4508-AE05-(E-Mail Removed)...
> Yes... I'm using it exactly as I am for methods that ARE working...
>
> Any thoughts?
>
> Michael
>
>
> "W.G. Ryan [MVP]" wrote:
>
>> Do you have it marked with the WebMethod attribute? That's the usual
>> culprit. You can use the debugger like you normally would but I'd
>> recommend
>> logging once it's past development.
>> "Michael Reinhart" <(E-Mail Removed)> wrote in
>> message news:8E82C411-9BAC-4DD5-948C-(E-Mail Removed)...
>> > Hi all...
>> >
>> > I'm fairly new to buildling web services in .NET 2.0. Using VB.NET
>> > (2005),
>> > I'm doing something like this in a webmethod:
>> >
>> > - instantiating a 3rd party business object (QuickBooks customers
>> > actually)
>> > - iterating through the collection and adding rows to a DataTable in a
>> > DataSet
>> > - Returning the DataSet ("Return dsCustomers")
>> >
>> > I've got other webmethods that return strings working just fine. I
>> > know
>> > the
>> > code in this method works, because I've tested it inside an ASP.NET
>> > page.
>> >
>> > My questions are:
>> >
>> > 1) if it compiles, why wouldn't the method show up in the service's
>> > ASMX
>> > page?
>> > 2) what's the best way to debug a web service like this?
>> >
>> > Thanks,
>> > Michael

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?TWljaGFlbCBSZWluaGFydA==?=
Guest
Posts: n/a
 
      1st Nov 2006
Here's my code:

<WebMethod()> _
Private Function LoadCustomers() As System.Data.DataSet

Dim dsClients As System.Data.DataSet
Dim tblClients As System.Data.DataTable
Dim drClient As System.Data.DataRow
Dim dcClientName As System.Data.DataColumn
dsClients = New System.Data.DataSet
tblClients = New System.Data.DataTable("Clients")
dcClientName = New System.Data.DataColumn("ClientName",
Type.GetType("System.String"))
tblClients.Columns.Add(dcClientName)
dsClients.Tables.Add(tblClients)

qbCustomer.Reset()
qbCustomer.QBXMLVersion = "CA3.0"
qbCustomer.QBConnectionMode =
nsoftware.IBizQB.VendorQBConnectionModes.cmDontCare
qbCustomer.QBConnectionString =
ConfigurationManager.AppSettings("IbizQB")
qbCustomer.OpenQBConnection()

Objsearch.Reset()
Objsearch.QBXMLVersion = "CA3.0"
Objsearch.QBConnectionMode =
nsoftware.IBizQB.ObjsearchQBConnectionModes.cmDontCare
Objsearch.QBConnectionString =
ConfigurationManager.AppSettings("IbizQB")
Objsearch.OpenQBConnection()

Objsearch.QueryType =
nsoftware.IBizQB.ObjsearchQueryTypes.qtCustomerSearch
Objsearch.ActiveStatus =
nsoftware.IBizQB.ObjsearchActiveStatus.asActiveOnly
Objsearch.Search()
Dim i As Integer

For i = 0 To Objsearch.ResultCount - 1
qbCustomer.QBResponseAggregate = Objsearch.ResultAggregate(i)

If qbCustomer.ParentId = "" Then

drClient = dsClients.Tables("Clients").NewRow
drClient.Item("ClientName") = qbCustomer.CustomerName
dsClients.Tables("Clients").Rows.Add(drClient)
drClient = Nothing

End If
Next i

If qbCustomer.QBOpenCompanyFile.ToString <> "" Then
qbCustomer.CloseQBConnection()
End If
If Objsearch.QBOpenCompanyFile.ToString <> "" Then
Objsearch.CloseQBConnection()
End If
qbCustomer = Nothing
Objsearch = Nothing

Return dsClients
End Function


"Jeff Dillon" wrote:

> Show your code
>
> "Michael Reinhart" <(E-Mail Removed)> wrote in
> message news:8E82C411-9BAC-4DD5-948C-(E-Mail Removed)...
> > Hi all...
> >
> > I'm fairly new to buildling web services in .NET 2.0. Using VB.NET
> > (2005),
> > I'm doing something like this in a webmethod:
> >
> > - instantiating a 3rd party business object (QuickBooks customers
> > actually)
> > - iterating through the collection and adding rows to a DataTable in a
> > DataSet
> > - Returning the DataSet ("Return dsCustomers")
> >
> > I've got other webmethods that return strings working just fine. I know
> > the
> > code in this method works, because I've tested it inside an ASP.NET page.
> >
> > My questions are:
> >
> > 1) if it compiles, why wouldn't the method show up in the service's ASMX
> > page?
> > 2) what's the best way to debug a web service like this?
> >
> > Thanks,
> > Michael

>
>
>

 
Reply With Quote
 
Jeff Dillon
Guest
Posts: n/a
 
      1st Nov 2006
Shouldn't it be Public and not Private?

"Michael Reinhart" <(E-Mail Removed)> wrote in
message news:4073C748-3CC7-48AD-AC4B-(E-Mail Removed)...
> Here's my code:
>
> <WebMethod()> _
> Private Function LoadCustomers() As System.Data.DataSet
>
> Dim dsClients As System.Data.DataSet
> Dim tblClients As System.Data.DataTable
> Dim drClient As System.Data.DataRow
> Dim dcClientName As System.Data.DataColumn
> dsClients = New System.Data.DataSet
> tblClients = New System.Data.DataTable("Clients")
> dcClientName = New System.Data.DataColumn("ClientName",
> Type.GetType("System.String"))
> tblClients.Columns.Add(dcClientName)
> dsClients.Tables.Add(tblClients)
>
> qbCustomer.Reset()
> qbCustomer.QBXMLVersion = "CA3.0"
> qbCustomer.QBConnectionMode =
> nsoftware.IBizQB.VendorQBConnectionModes.cmDontCare
> qbCustomer.QBConnectionString =
> ConfigurationManager.AppSettings("IbizQB")
> qbCustomer.OpenQBConnection()
>
> Objsearch.Reset()
> Objsearch.QBXMLVersion = "CA3.0"
> Objsearch.QBConnectionMode =
> nsoftware.IBizQB.ObjsearchQBConnectionModes.cmDontCare
> Objsearch.QBConnectionString =
> ConfigurationManager.AppSettings("IbizQB")
> Objsearch.OpenQBConnection()
>
> Objsearch.QueryType =
> nsoftware.IBizQB.ObjsearchQueryTypes.qtCustomerSearch
> Objsearch.ActiveStatus =
> nsoftware.IBizQB.ObjsearchActiveStatus.asActiveOnly
> Objsearch.Search()
> Dim i As Integer
>
> For i = 0 To Objsearch.ResultCount - 1
> qbCustomer.QBResponseAggregate = Objsearch.ResultAggregate(i)
>
> If qbCustomer.ParentId = "" Then
>
> drClient = dsClients.Tables("Clients").NewRow
> drClient.Item("ClientName") = qbCustomer.CustomerName
> dsClients.Tables("Clients").Rows.Add(drClient)
> drClient = Nothing
>
> End If
> Next i
>
> If qbCustomer.QBOpenCompanyFile.ToString <> "" Then
> qbCustomer.CloseQBConnection()
> End If
> If Objsearch.QBOpenCompanyFile.ToString <> "" Then
> Objsearch.CloseQBConnection()
> End If
> qbCustomer = Nothing
> Objsearch = Nothing
>
> Return dsClients
> End Function
>
>
> "Jeff Dillon" wrote:
>
>> Show your code
>>
>> "Michael Reinhart" <(E-Mail Removed)> wrote in
>> message news:8E82C411-9BAC-4DD5-948C-(E-Mail Removed)...
>> > Hi all...
>> >
>> > I'm fairly new to buildling web services in .NET 2.0. Using VB.NET
>> > (2005),
>> > I'm doing something like this in a webmethod:
>> >
>> > - instantiating a 3rd party business object (QuickBooks customers
>> > actually)
>> > - iterating through the collection and adding rows to a DataTable in a
>> > DataSet
>> > - Returning the DataSet ("Return dsCustomers")
>> >
>> > I've got other webmethods that return strings working just fine. I
>> > know
>> > the
>> > code in this method works, because I've tested it inside an ASP.NET
>> > page.
>> >
>> > My questions are:
>> >
>> > 1) if it compiles, why wouldn't the method show up in the service's
>> > ASMX
>> > page?
>> > 2) what's the best way to debug a web service like this?
>> >
>> > Thanks,
>> > Michael

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?TWljaGFlbCBSZWluaGFydA==?=
Guest
Posts: n/a
 
      1st Nov 2006
CLUNK <heel of hand hitting forhead> ! Boy do I feel stupid...

Thank you Jeff.

m

"Jeff Dillon" wrote:

> Shouldn't it be Public and not Private?
>
> "Michael Reinhart" <(E-Mail Removed)> wrote in
> message news:4073C748-3CC7-48AD-AC4B-(E-Mail Removed)...
> > Here's my code:
> >
> > <WebMethod()> _
> > Private Function LoadCustomers() As System.Data.DataSet
> >
> > Dim dsClients As System.Data.DataSet
> > Dim tblClients As System.Data.DataTable
> > Dim drClient As System.Data.DataRow
> > Dim dcClientName As System.Data.DataColumn
> > dsClients = New System.Data.DataSet
> > tblClients = New System.Data.DataTable("Clients")
> > dcClientName = New System.Data.DataColumn("ClientName",
> > Type.GetType("System.String"))
> > tblClients.Columns.Add(dcClientName)
> > dsClients.Tables.Add(tblClients)
> >
> > qbCustomer.Reset()
> > qbCustomer.QBXMLVersion = "CA3.0"
> > qbCustomer.QBConnectionMode =
> > nsoftware.IBizQB.VendorQBConnectionModes.cmDontCare
> > qbCustomer.QBConnectionString =
> > ConfigurationManager.AppSettings("IbizQB")
> > qbCustomer.OpenQBConnection()
> >
> > Objsearch.Reset()
> > Objsearch.QBXMLVersion = "CA3.0"
> > Objsearch.QBConnectionMode =
> > nsoftware.IBizQB.ObjsearchQBConnectionModes.cmDontCare
> > Objsearch.QBConnectionString =
> > ConfigurationManager.AppSettings("IbizQB")
> > Objsearch.OpenQBConnection()
> >
> > Objsearch.QueryType =
> > nsoftware.IBizQB.ObjsearchQueryTypes.qtCustomerSearch
> > Objsearch.ActiveStatus =
> > nsoftware.IBizQB.ObjsearchActiveStatus.asActiveOnly
> > Objsearch.Search()
> > Dim i As Integer
> >
> > For i = 0 To Objsearch.ResultCount - 1
> > qbCustomer.QBResponseAggregate = Objsearch.ResultAggregate(i)
> >
> > If qbCustomer.ParentId = "" Then
> >
> > drClient = dsClients.Tables("Clients").NewRow
> > drClient.Item("ClientName") = qbCustomer.CustomerName
> > dsClients.Tables("Clients").Rows.Add(drClient)
> > drClient = Nothing
> >
> > End If
> > Next i
> >
> > If qbCustomer.QBOpenCompanyFile.ToString <> "" Then
> > qbCustomer.CloseQBConnection()
> > End If
> > If Objsearch.QBOpenCompanyFile.ToString <> "" Then
> > Objsearch.CloseQBConnection()
> > End If
> > qbCustomer = Nothing
> > Objsearch = Nothing
> >
> > Return dsClients
> > End Function
> >
> >
> > "Jeff Dillon" wrote:
> >
> >> Show your code
> >>
> >> "Michael Reinhart" <(E-Mail Removed)> wrote in
> >> message news:8E82C411-9BAC-4DD5-948C-(E-Mail Removed)...
> >> > Hi all...
> >> >
> >> > I'm fairly new to buildling web services in .NET 2.0. Using VB.NET
> >> > (2005),
> >> > I'm doing something like this in a webmethod:
> >> >
> >> > - instantiating a 3rd party business object (QuickBooks customers
> >> > actually)
> >> > - iterating through the collection and adding rows to a DataTable in a
> >> > DataSet
> >> > - Returning the DataSet ("Return dsCustomers")
> >> >
> >> > I've got other webmethods that return strings working just fine. I
> >> > know
> >> > the
> >> > code in this method works, because I've tested it inside an ASP.NET
> >> > page.
> >> >
> >> > My questions are:
> >> >
> >> > 1) if it compiles, why wouldn't the method show up in the service's
> >> > ASMX
> >> > page?
> >> > 2) what's the best way to debug a web service like this?
> >> >
> >> > Thanks,
> >> > Michael
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WebMethod returning a Dataset =?Utf-8?B?S2h1cnJhbQ==?= Microsoft C# .NET 3 18th Jul 2006 06:12 PM
Webservice installer not installing my .ASMX files acteon@yahoo.com Microsoft Dot NET 0 17th Jul 2006 04:55 PM
Return value from webmethod problem Justin Dutoit Microsoft C# .NET 2 3rd Oct 2004 12:40 PM
return object from WebMethod kids_pro Microsoft C# .NET 2 2nd Apr 2004 02:01 AM
Pulling DataSet From WebMethod -- Possible? Temp Microsoft ASP .NET 1 11th Aug 2003 06:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:46 AM.