Using .Net Bindings

Seppuku

New member
Joined
Apr 4, 2005
Messages
1
Hi! Im rather new to .Net, but not new to programming. Im working on developing a web service that references a 3rd party DLL. The 3rd party has supplied both a win32 DLL and a .Net Binding (which includes a DLL written in C#). I added the C# DLL (.Net Binding) to the References of the web service. It shows up under the References folder, and I can browse all the functions, methods and members of the DLL. The problem comes in when I call a DLL function which takes a parameter of "type" defined by the DLL itself, and shown in a sample provided with the component. This seems strange. You would assume that if you are using a value specified by the binding in a call to a function defined by the binding, you shouldnt have any problem, but instead, I get the following error:

C:\iis\gcp\Service1.asmx.vb(80): Value of type Short cannot be converted to GameStat.GameType.

The value of parameter (GameStat.GameType.UnrealTournament2004) is an integer, but the DLL declares this of the type "type". I thought that maybe Im missing some extra step that I need to do to get the web service to recognize this as its defined type, but I dont know where to look. Heres a sample of my code:

Code:
Imports System.Web.Services
Imports GameStat

<System.Web.Services.WebService(Namespace:="http://localhost/gcp/gcp")> _
Public Class Primes
    Inherits System.Web.Services.WebService


 generic .Net code replaced for brevity...

    <WebMethod()> _
    Public Function GetServerInfo(ByVal Host As String) As String

        Dim gs As GameStat
        Dim gsInfo As GameStat.ServerInfo

        gsInfo = GameStat.ServerInfo.Query(GameType.UnrealTournament2004, Host)

        GetServerInfo = gsInfo.Map

    End Function

End Class

The DLL and .Net Bindings can be found at http://www.int64.org/gamestat.html

Any ideas? Thanks!
 
The function takes these parameters?

[VB]
GameStat.ServerInfo.Query(System.Type, String)
[/VB]

Or

[VB]
GameStat.ServerInfo.Query(GameStat.GameType, String)
[/VB]
 
Back
Top