|
|
|
start date: Wed, 22 Aug 2007 14:26:03 -0400,
posted on: microsoft.public.dotnet.languages.vb
back
| Thread Index |
|
1
Mike
|
|
2
kelphis
|
|
3
Michel Posseth [MCP]
|
|
4
Mike
|
|
5
Mike
|
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
Date:Wed, 22 Aug 2007 14:26:03 -0400
Author:
|
Re: Web service and business logic
On Aug 22, 1:26 pm, "Mike" wrote:
> 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.
Date:Wed, 22 Aug 2007 11:34:44 -0700
Author:
|
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" schreef in bericht
news:1187807684.039623.71070@i38g2000prf.googlegroups.com...
> On Aug 22, 1:26 pm, "Mike" wrote:
>> 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.
>
Date:Wed, 22 Aug 2007 20:59:06 +0200
Author:
|
Re: Web service and business logic
'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:amchater@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" wrote:
> 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.
Date:Wed, 22 Aug 2007 15:07:32 -0400
Author:
|
Re: Web service and business logic
HI,
What do you mean by public available, can you provide an example?
Thanks
-----Original Message-----
From: Michel Posseth [MCP] [mailto:MSDN@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" schreef in bericht
news:1187807684.039623.71070@i38g2000prf.googlegroups.com...
> On Aug 22, 1:26 pm, "Mike" wrote:
>> 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.
>
Date:Wed, 22 Aug 2007 15:24:18 -0400
Author:
|
|
|