Security Issues and ContractID Issues

denis30

New Member
I'm trying to figure out how to get this service working, as it's my first time with WCF. I'm trying to just output json when I visit \[code\]https://appsnet/EMS/EMSService.svc/GetData/5.\[/code\]My entire solution is setup to use directory based auth, and then on top of that I don't think I'm configuring my web.config properly, but I don't know what to do...help?Code behind:\[code\]Imports System.ServiceModelImports System.XmlImports System.IOImports Newtonsoft.JsonImports AppsNet.EMSAPIImports System.ServiceModel.WebImports AppsNet<ServiceContract()> _Public Interface IEMSService <OperationContract()> _ <WebGet()> Function EventByType(intEventTypeID As Integer) As String <OperationContract()> _ <WebGet()> Function GetData(value As String) As StringEnd Interface\[/code\]Service File:\[code\]Imports System.ServiceModel.ActivationImports AppsNet<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Required)> _Public Class EMSService Implements IEMSService Public Function EventByType(ByVal intEventTypeID As Integer) As String Implements IEMSService.EventByType Dim q = 'proprietary stuff here Return Newtonsoft.Json.JsonConvert.SerializeObject(q) End Function Public Function GetData(ByVal value As String) As String Implements IEMSService.GetData Return String.Format("You entered: {0}", value) End FunctionEnd Class\[/code\]Web.config excerpts:\[code\]<system.serviceModel> <bindings> <basicHttpBinding> <binding> <security mode="None"> </security> </binding> </basicHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="AppsNet.Service1AspNetAjaxBehavior"> <enableWebScript /> </behavior> <behavior name="AppsNet.EMSServiceBehavior"> <enableWebScript /> </behavior> </endpointBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> <services> <service name="AppsNet.Service1"> <endpoint address="" behaviorConfiguration="AppsNet.Service1AspNetAjaxBehavior" binding="webHttpBinding" contract="AppsNet.Service1" /> </service> <service name="AppsNet.EMSService"> <endpoint behaviorConfiguration="AppsNet.EMSServiceBehavior" binding="webHttpBinding" contract="EMSService.IEMSService" /> </service> </services></system.serviceModel>\[/code\]
 
Back
Top