473,396 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Web service and business logic

I have an n-tier system as follows:

Business

Data Access

Web Services

Basically the Business layer has all the functionality and I want to
expose that functionality thru web services. As an example, I have a
class called AddressTypes, and a method on it called GetAddressType.

I want to expose that method, GetAddressType thru a web service.

This is what I have:

<WebMethod()_

Public Function GetAddressType(ByVal AddressTypeID As String) As
Auxiliar.AddressType

Dim AddressType As New Auxiliar.AddressType

Try

Return AddressType.GetAddressType(AddressTypeID)

Catch ex As Exception

Return Nothing

End Try

End Function

In the client side though, when I call the web service method, I try to
assign its result to an instance of Auxiliar.AddressType, but I got an
error, which says basically that the Web service AddressType returned
cannot be converted to Auxiliar.AddressType.

What seems to be the problem here?

Thanks


Aug 22 '07 #1
4 1361
On Aug 22, 1:26 pm, "Mike" <m...@hitnext.comwrote:
I have an n-tier system as follows:

Business

Data Access

Web Services

Basically the Business layer has all the functionality and I want to
expose that functionality thru web services. As an example, I have a
class called AddressTypes, and a method on it called GetAddressType.

I want to expose that method, GetAddressType thru a web service.

This is what I have:

<WebMethod()_

Public Function GetAddressType(ByVal AddressTypeID As String) As
Auxiliar.AddressType

Dim AddressType As New Auxiliar.AddressType

Try

Return AddressType.GetAddressType(AddressTypeID)

Catch ex As Exception

Return Nothing

End Try

End Function

In the client side though, when I call the web service method, I try to
assign its result to an instance of Auxiliar.AddressType, but I got an
error, which says basically that the Web service AddressType returned
cannot be converted to Auxiliar.AddressType.

What seems to be the problem here?

Thanks
post the code you are using on the client to invoke the web service.

Aug 22 '07 #2
You must make the returning type public availlable in your webclass
in the client you assign a varibale pointer to the public exposed type
now it should work .

regards

Michel
"kelphis" <am******@hotmail.comschreef in bericht
news:11*********************@i38g2000prf.googlegro ups.com...
On Aug 22, 1:26 pm, "Mike" <m...@hitnext.comwrote:
>I have an n-tier system as follows:

Business

Data Access

Web Services

Basically the Business layer has all the functionality and I want to
expose that functionality thru web services. As an example, I have a
class called AddressTypes, and a method on it called GetAddressType.

I want to expose that method, GetAddressType thru a web service.

This is what I have:

<WebMethod()_

Public Function GetAddressType(ByVal AddressTypeID As String) As
Auxiliar.AddressType

Dim AddressType As New Auxiliar.AddressType

Try

Return AddressType.GetAddressType(AddressTypeID)

Catch ex As Exception

Return Nothing

End Try

End Function

In the client side though, when I call the web service method, I try to
assign its result to an instance of Auxiliar.AddressType, but I got an
error, which says basically that the Web service AddressType returned
cannot be converted to Auxiliar.AddressType.

What seems to be the problem here?

Thanks

post the code you are using on the client to invoke the web service.

Aug 22 '07 #3

'This is the web service
Dim WSCommon As New WSCommon.Common

'This is a class en Business
Dim AddressType As New Auxiliar.AddressType

'Here I try to assign whatever the webservice returns to the instance of
my class

AddressType = WSCommon.GetAddressType("BILL")
I get a design time error saying that
Value of type Webservice.AddressType cannot be converted to
Business.GetType

-----Original Message-----
From: kelphis [mailto:am******@hotmail.com]
Posted At: Wednesday, August 22, 2007 2:35 PM
Posted To: microsoft.public.dotnet.languages.vb
Conversation: Web service and business logic
Subject: Re: Web service and business logic

On Aug 22, 1:26 pm, "Mike" <m...@hitnext.comwrote:
I have an n-tier system as follows:

Business

Data Access

Web Services

Basically the Business layer has all the functionality and I want to
expose that functionality thru web services. As an example, I have a
class called AddressTypes, and a method on it called GetAddressType.

I want to expose that method, GetAddressType thru a web service.

This is what I have:

<WebMethod()_

Public Function GetAddressType(ByVal AddressTypeID As String) As
Auxiliar.AddressType

Dim AddressType As New Auxiliar.AddressType

Try

Return AddressType.GetAddressType(AddressTypeID)

Catch ex As Exception

Return Nothing

End Try

End Function

In the client side though, when I call the web service method, I try
to
assign its result to an instance of Auxiliar.AddressType, but I got an
error, which says basically that the Web service AddressType returned
cannot be converted to Auxiliar.AddressType.

What seems to be the problem here?

Thanks
post the code you are using on the client to invoke the web service.

Aug 22 '07 #4
HI,

What do you mean by public available, can you provide an example?

Thanks

-----Original Message-----
From: Michel Posseth [MCP] [mailto:MS**@posseth.com]
Posted At: Wednesday, August 22, 2007 2:59 PM
Posted To: microsoft.public.dotnet.languages.vb
Conversation: Web service and business logic
Subject: Re: Web service and business logic

You must make the returning type public availlable in your webclass
in the client you assign a varibale pointer to the public exposed type
now it should work .

regards

Michel
"kelphis" <am******@hotmail.comschreef in bericht
news:11*********************@i38g2000prf.googlegro ups.com...
On Aug 22, 1:26 pm, "Mike" <m...@hitnext.comwrote:
>I have an n-tier system as follows:

Business

Data Access

Web Services

Basically the Business layer has all the functionality and I want to
expose that functionality thru web services. As an example, I have a
class called AddressTypes, and a method on it called GetAddressType.

I want to expose that method, GetAddressType thru a web service.

This is what I have:

<WebMethod()_

Public Function GetAddressType(ByVal AddressTypeID As String) As
Auxiliar.AddressType

Dim AddressType As New Auxiliar.AddressType

Try

Return AddressType.GetAddressType(AddressTypeID)

Catch ex As Exception

Return Nothing

End Try

End Function

In the client side though, when I call the web service method, I try
to
>assign its result to an instance of Auxiliar.AddressType, but I got
an
>error, which says basically that the Web service AddressType returned
cannot be converted to Auxiliar.AddressType.

What seems to be the problem here?

Thanks

post the code you are using on the client to invoke the web service.

Aug 22 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ray5531 | last post by:
We have a solution consists of an O/R mapper project,Business Logice layer and a Web application.I need to add a windows service to this solution and add the business logic layer as a reference to...
0
by: Mythran | last post by:
I have a custom Principal (implements System.Security.Principal.IPrincipal interface) that I need to access from a WebService. My web application has the Thread.CurrentPrincipal set to this new...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
6
by: Eric Guthmann | last post by:
Hello all We have an SOA application that includes an ASP.NET webservice and WinForms client. My question is regarding the use of Add Web Reference in Visual Studio. The tool is nice because...
5
by: Nate | last post by:
We are attempting to make a request to a web service (we will refer to it as XXXServices) hosted on a Web Logic server from a C# SOAP client. The server responds with a 401 Unauthorized error...
2
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
7
by: deko | last post by:
I'm trying to finalize a windows service design any would appreciate any comments - I'm new to windows services. Essentially my UI app relies on a service to schedule IO tasks. The service does...
2
by: Bill Davidson | last post by:
All: I have a Win32 service that takes about 30 seconds to shutdown (give or take a few seconds). I shut the service down via the 'Services' console on Windows Server 2003. When the service...
0
mbmccormick
by: mbmccormick | last post by:
I have a web service in the same project as the rest of my website. I am able to call my web service without any trouble from the Javascript on my page using the Script Manager. Now, I want to have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.