Kaizer
Legacy Member
Hey gasten,
ik ben bezig met Silverlight te bekijken en ik bots al op een probleem. Ik heb een kleine SL applicatie gemaakt dat data haalt uit mijn sql database die ergens gehost staat. Nu op mijn develop omgeving werkt dit allemaal smooth, maar van het moment dat ik het zet op m'n website (ook extern) lukt het niet meer.
Dit is de opzet:
The Class:
------
Public Class Gebruiker
Public UserID As Integer
Public UserName As String
Private _PassWord As String
Public Property PassWord() As String
Get
Return _PassWord
End Get
Set(ByVal value As String)
_PassWord = Left(value, 3) & "****"
End Set
End Property
Private _Email As String
Public Property Email() As String
Get
Return _Email
End Get
Set(ByVal value As String)
_Email = Left(value, 3) & "****"
End Set
End Property
End Class
The Service:
Imports System.ServiceModel
Imports System.ServiceModel.Activation
<ServiceContract(Namespace:="http://www.swtor-bountyhunters.com/sl/")>
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)>
Public Class BHService
<OperationContract()>
Public Function GetUserList() As List(Of Gebruiker)
Dim BH As New BHDataClassDataContext
Dim Users = (From U In BH.Users
Select U)
Dim list As New List(Of Gebruiker)
For Each x In Users
list.Add(New Gebruiker With {.UserID = x.UserID, .UserName = x.UserName, .PassWord = x.PassWord, .Email = x.Email})
Next
Return list
End Function
End Class
The Web.Config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
ASP.NET Web Configuration Guidelines
-->
<configuration>
<connectionStrings>
<add name="XXX" connectionString="Data Source=XXXXX;Initial Catalog=XXX;Persist Security Info=True;User ID=XXX;Password=XXX"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="SLBH.WebServer.BHService.customBinding0">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
<services>
<service name="SLBH.WebServer.BHService">
<endpoint address="" binding="basicHttpBinding" contract="SLBH.WebServer.BHService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
</configuration>
===
Je kan het hier testen
SL applicatie: SLBH
Link v/d service: http://www.swtor-bountyhunters.com/sl/bhservice.svc
Enige help wordt geapprecieerd
ik ben bezig met Silverlight te bekijken en ik bots al op een probleem. Ik heb een kleine SL applicatie gemaakt dat data haalt uit mijn sql database die ergens gehost staat. Nu op mijn develop omgeving werkt dit allemaal smooth, maar van het moment dat ik het zet op m'n website (ook extern) lukt het niet meer.
Dit is de opzet:
The Class:
------
Public Class Gebruiker
Public UserID As Integer
Public UserName As String
Private _PassWord As String
Public Property PassWord() As String
Get
Return _PassWord
End Get
Set(ByVal value As String)
_PassWord = Left(value, 3) & "****"
End Set
End Property
Private _Email As String
Public Property Email() As String
Get
Return _Email
End Get
Set(ByVal value As String)
_Email = Left(value, 3) & "****"
End Set
End Property
End Class
The Service:
Imports System.ServiceModel
Imports System.ServiceModel.Activation
<ServiceContract(Namespace:="http://www.swtor-bountyhunters.com/sl/")>
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)>
Public Class BHService
<OperationContract()>
Public Function GetUserList() As List(Of Gebruiker)
Dim BH As New BHDataClassDataContext
Dim Users = (From U In BH.Users
Select U)
Dim list As New List(Of Gebruiker)
For Each x In Users
list.Add(New Gebruiker With {.UserID = x.UserID, .UserName = x.UserName, .PassWord = x.PassWord, .Email = x.Email})
Next
Return list
End Function
End Class
The Web.Config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
ASP.NET Web Configuration Guidelines
-->
<configuration>
<connectionStrings>
<add name="XXX" connectionString="Data Source=XXXXX;Initial Catalog=XXX;Persist Security Info=True;User ID=XXX;Password=XXX"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="SLBH.WebServer.BHService.customBinding0">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
<services>
<service name="SLBH.WebServer.BHService">
<endpoint address="" binding="basicHttpBinding" contract="SLBH.WebServer.BHService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
</configuration>
===
Je kan het hier testen
SL applicatie: SLBH
Link v/d service: http://www.swtor-bountyhunters.com/sl/bhservice.svc
Enige help wordt geapprecieerd



ad: