Web service and business logic

M

Mike

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
 
K

kelphis

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.
 
M

Michel Posseth [MCP]

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
 
M

Mike

'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:[email protected]]
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

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.
 
M

Mike

HI,

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

Thanks



-----Original Message-----
From: Michel Posseth [MCP] [mailto:[email protected]]
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top