Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Service with 'shared' datatypes

Reply
Thread Tools

Service with 'shared' datatypes

 
 
Maik Albrecht
Guest
Posts: n/a
 
      08-23-2004
Hello NG,

I need to write a factory where I be able to switch between webservice
support and normal dll support. So I wrote a small test programm. In this
case I get the problem that I can't find a way to load a komplex datatype
from a dll und use it as a parameter in the service. In normal case the
client will use the datatypes published by the webservice. But so i have to
use the published types in the main programm and are not able to switsch.

Here some code

WebService.dll
<WebMethod()> _

Public Function GetName(ByVal param As [Shared].MyEnum) As String

' The parameter [Shared].MyEnum lost his namespace in the wsdl document

Return "MyName"

End Function



Shared.dll

Public Enum MyEnum

param1

param2

End Enum



Client.exe



Dim dm As New localhost.Service1

Dim a As [Shared].MyEnum

a = [Shared].MyEnum.param1

'Me.Label1.Text = dm.GetName(a) ' not working because it is not the valid
type, but thats the way i need it !

Me.Label1.Text = dm.GetName(localhost.MyEnum.param1)


 
Reply With Quote
 
 
 
 
Dino Chiesa [Microsoft]
Guest
Posts: n/a
 
      08-23-2004
I am not certain that I completely understand your problem.
but,
I think you might be able to correct the problem by modifying the generated
webservice proxy classes to reference the datatypes defined in your DLL.

By default a webservice will give you new datatypes - localhost1.DataType1,
localhost1.DataType2, etc

just modify the generated code to reference your externally defined
datatypes, in place of those generated ones.

-D

"Maik Albrecht" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello NG,
>
> I need to write a factory where I be able to switch between webservice
> support and normal dll support. So I wrote a small test programm. In this
> case I get the problem that I can't find a way to load a komplex datatype
> from a dll und use it as a parameter in the service. In normal case the
> client will use the datatypes published by the webservice. But so i have

to
> use the published types in the main programm and are not able to switsch.
>
> Here some code
>
> WebService.dll
> <WebMethod()> _
>
> Public Function GetName(ByVal param As [Shared].MyEnum) As String
>
> ' The parameter [Shared].MyEnum lost his namespace in the wsdl document
>
> Return "MyName"
>
> End Function
>
>
>
> Shared.dll
>
> Public Enum MyEnum
>
> param1
>
> param2
>
> End Enum
>
>
>
> Client.exe
>
>
>
> Dim dm As New localhost.Service1
>
> Dim a As [Shared].MyEnum
>
> a = [Shared].MyEnum.param1
>
> 'Me.Label1.Text = dm.GetName(a) ' not working because it is not the valid
> type, but thats the way i need it !
>
> Me.Label1.Text = dm.GetName(localhost.MyEnum.param1)
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
complex datatypes in webservices. Ashish ASP .Net 1 12-19-2005 07:51 PM
text box and SqlDecimal datatypes Mark ASP .Net 2 11-07-2005 05:34 PM
Specified cast not valid on decimal & double datatypes .Net Sports ASP .Net 1 08-31-2005 09:11 AM
Problem while reading excel file with mix datatypes =?Utf-8?B?UGF1cmF2aQ==?= ASP .Net 1 03-04-2004 03:11 AM
interrogating database for field names/datatypes? ASP .Net 2 07-28-2003 01:39 AM



Advertisments