i'm facing problem sharepoint 2010 custom web service. service svc installed , deployed on system: without particular configuration works need customize web.config achieve security roles.
the problems when try invoke methods browser response empty.
this web.config
<?xml version="1.0"?> <configuration> <system.servicemodel> <services> <service name="sharepointwcfservice.getlistdata" behaviorconfiguration="wcfbasichttpbinding.service1behavior"> <endpoint address="http://address" binding="basichttpbinding" contract="sharepointwcfservice.igetlistdata"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange"/> <endpoint address="http://address" binding="webhttpbinding" contract="sharepointwcfservice.igetlistdata" > <identity> <dns value="localhost" /> </identity> </endpoint> </service> </services> <behaviors> <servicebehaviors> <behavior name="wcfbasichttpbinding.service1behavior"> <servicemetadata httpgetenabled="true"/> <servicedebug includeexceptiondetailinfaults="true"/> </behavior> </servicebehaviors> </behaviors> </system.servicemodel> </configuration>
this interface i'm implementing:
[servicecontract] public interface igetlistdata { [operationcontract] [webinvoke(method = "get", bodystyle = webmessagebodystyle.bare, responseformat = webmessageformat.json, requestformat = webmessageformat.json)] jsonresult getjsonresponse(string data);
}
and class
[basichttpbindingservicemetadataexchangeendpointattribute] [aspnetcompatibilityrequirements(requirementsmode = aspnetcompatibilityrequirementsmode.required)] class getlistdata : igetlistdata { private const string admin_svc_getlistdata = "admin_svc_getlistdata"; public jsonresult getjsonresponse(string data) { return new jsonresult() { firstname = "myfirstname", lastname = "mylastname" }; } // public jsonresult getjsonresponse(string data)
do must declare different @ web.config side?
Comments
Post a Comment