Pulling guid over webservices

Ask the few things google does not know

Moderator: Dictators in Training

Pulling guid over webservices

Postby Naethyn » Thu May 11, 2006 1:48 pm

I am creating a .NETCF 2.0 application that pulls a guid from a HTTP endpoint in a SQL server 2005 database on webservices. When I create the same project using the same endpoint on a regular .NET application it works fine. If anyone knows of any complications dealing with a guid and .netcf that would be great.

Here is the following error:

Message:
Two mappings for string.

Stack Trace:
at System.Xml.Serialization.TypeContainer.AddType()
at System.Xml.Serialization.TypeContainer.AddType()
at System.Xml.Serialization.XmlSerializationReflector.AddIXmlSerializableType()
at System.Xml.Serialization.XmlSerializationReflector.AddType()
at System.Xml.Serialization.XmlSerializationReflector.FindType()
at System.Xml.Serialization.XmlSerializationReflector.FindType()
at System.Xml.Serialization.XmlSerializationReflector.ResolveLiteralTypeUsingDeclaredType()
at System.Xml.Serialization.XmlSerializationReflector.ResolveLiteralType()
at System.Xml.Serialization.XmlSerializationReflector.ReflectXmlElementAttributes()
at System.Xml.Serialization.XmlSerializationReflector.ReflectLiteralMemberValue()
at System.Xml.Serialization.XmlSerializationReflector.ReflectMemberValue()
at System.Web.Services.Protocols.SoapReflector.ReflectInParameter()
at System.Web.Services.Protocols.SoapReflector.ReflectMethodParameters()
at System.Web.Services.Protocols.SoapReflector.ReflectMethodArguments()
at System.Web.Services.Protocols.SoapReflector.getSoapMethod()
at System.Web.Services.Protocols.SoapMessageSerializer.GetSoapMethod()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at pda.SQLServer.MobileData.PullUniqueID()
at pda.Form1.pullMenuItem_Click()
at System.Windows.Forms.MenuItem.OnClick()
at System.Windows.Forms.Menu.ProcessMnuProc()
at System.Windows.Forms.Form.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at pda.Form1.Main()

It calls a simple function that returns a unique identifier.

USE MobileData
GO
ALTER FUNCTION PullUniqueID(@company NVARCHAR(100), @technician NVARCHAR(100))
RETURNS uniqueidentifier
AS
BEGIN
RETURN
(
SELECT TOP(1) UniqueID
FROM mobiledata.dbo.Connection
WHERE company = @company AND technician = @technician
)
END



Here is the VB code used.

Public Class Form1

'Declare the web service
Dim webService As New SQLServer.MobileData

'Declare connection variables
Dim company As String = "2"
Dim technician As String = "nathan@vms_md.com"

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'Set the webservice credentials
webService.Credentials = New System.Net.NetworkCredential("sqlsync", "sqlsync")

End Sub

Private Sub pullButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pullButton.Click

Try

Dim uniqueID As Guid = webService.PullUniqueID(company, technician)

Dim messageString As String = webService.PullMessageUniqueID(uniqueID)

infoTextBox.Text = messageString

Catch ex As Exception

End Try

End Sub

Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clearButton.Click

infoTextBox.Clear()

pullButton.Focus()

End Sub
End Class
User avatar
Naethyn
NT Traveller
NT Traveller
 
Posts: 2085
Joined: Wed May 04, 2005 12:13 pm

Return to Tech Support

Who is online

Users browsing this forum: No registered users and 47 guests