Service with 'shared' datatypes

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Service with 'shared' datatypes

    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)


    Maik Albrecht Guest

  2. Similar Questions and Discussions

    1. Converting Datatypes
      Hi, I need to change a varchar field in my DB to a small date/time field. The problem is I don't want to lose the data, as I have quite a lot of...
    2. sql=access=datatypes?
      What would be the corresponding data types for the following existing Access data types: Autonumber = (UniqueIdentifier?) Number =...
    3. Problem publishing web service on shared server
      Gerry, I am having exactly the same symptoms - but I know what the problem is but don't have a fix yet. My hosting provider runs .NET 1.1 and to...
    4. Shared Fax Problem with Windows 2003 the NETWORK SERVICE account and a Domain Controller
      Can you share more details as to what the exact problem is? Service not starting? Not able to send/receive? -- Manoj K Jain Microsoft Printing,...
    5. Datatypes in Informix
      Hi, I am trying to obtain an extract of my Informix database into a formatted spreadsheet. The information of the fields in a table is...
  3. #2

    Default Re: Service with 'shared' datatypes

    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" <albrecht.m@gmx.de> wrote in message
    news:esFruyRiEHA.2880@TK2MSFTNGP10.phx.gbl...
    > 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] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139