|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ASMX not showing webmethod that should return a datasetI'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 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. Show quote "Michael Reinhart" <MichaelReinh***@discussions.microsoft.com> wrote in message news:8E82C411-9BAC-4DD5-948C-3738810F8180@microsoft.com... > 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 Yes... I'm using it exactly as I am for methods that ARE working...
Any thoughts? Michael Show quote "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" <MichaelReinh***@discussions.microsoft.com> wrote in > message news:8E82C411-9BAC-4DD5-948C-3738810F8180@microsoft.com... > > 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 > > > Like Jeff mentions, it's probably best to show the code.
Show quote "Michael Reinhart" <MichaelReinh***@discussions.microsoft.com> wrote in message news:566687BD-1575-4508-AE05-9CE336802F9A@microsoft.com... > 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" <MichaelReinh***@discussions.microsoft.com> wrote in >> message news:8E82C411-9BAC-4DD5-948C-3738810F8180@microsoft.com... >> > 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 >> >> >> Show your code
Show quote "Michael Reinhart" <MichaelReinh***@discussions.microsoft.com> wrote in message news:8E82C411-9BAC-4DD5-948C-3738810F8180@microsoft.com... > 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 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 Show quote "Jeff Dillon" wrote: > Show your code > > "Michael Reinhart" <MichaelReinh***@discussions.microsoft.com> wrote in > message news:8E82C411-9BAC-4DD5-948C-3738810F8180@microsoft.com... > > 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 > > > Shouldn't it be Public and not Private?
Show quote "Michael Reinhart" <MichaelReinh***@discussions.microsoft.com> wrote in message news:4073C748-3CC7-48AD-AC4B-5D47695D2B05@microsoft.com... > 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" <MichaelReinh***@discussions.microsoft.com> wrote in >> message news:8E82C411-9BAC-4DD5-948C-3738810F8180@microsoft.com... >> > 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 >> >> >> CLUNK <heel of hand hitting forhead> ! Boy do I feel stupid...
Thank you Jeff. m Show quote "Jeff Dillon" wrote: > Shouldn't it be Public and not Private? > > "Michael Reinhart" <MichaelReinh***@discussions.microsoft.com> wrote in > message news:4073C748-3CC7-48AD-AC4B-5D47695D2B05@microsoft.com... > > 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" <MichaelReinh***@discussions.microsoft.com> wrote in > >> message news:8E82C411-9BAC-4DD5-948C-3738810F8180@microsoft.com... > >> > 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 > >> > >> > >> > > > |
|||||||||||||||||||||||