Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2004

Tip: Looking for answers? Try searching our database.

Service with 'shared' datatypes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maik Albrecht - 23 Aug 2004 15:22 GMT
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)
Dino Chiesa [Microsoft] - 23 Aug 2004 16:25 GMT
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

> Hello NG,
>
[quoted text clipped - 40 lines]
>
> Me.Label1.Text = dm.GetName(localhost.MyEnum.param1)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.