javascript - Completing the WCF implementation picture -
i have seen many examples , worked on wcf code perhaps without understanding it. trying implement on own cant seem work im looking tips!
here situation:
good -i can build service library , host in service application or in iis7, both giving me successful results in can see service via typing in location of .svc file in browser.
bad -i need connect service via javascript, connecting localhost via json gives me "no transport" , alternatively if try connect hosting server via jsonp gives me 'success' undefined response (should hello world response..)
here config file on service:
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetframework="4.0" /> </system.web> <system.servicemodel> <behaviors> <servicebehaviors> <behavior> <servicemetadata httpgetenabled="true"/> <servicedebug includeexceptiondetailinfaults="false"/> </behavior> </servicebehaviors> </behaviors> <servicehostingenvironment multiplesitebindingsenabled="true" /> </system.servicemodel> <system.webserver> <modules runallmanagedmodulesforallrequests="true"/> </system.webserver> </configuration>
here js json:
$.ajax({ url: "http://10.8.8.53/schools/schoolsservice.svc/testschoolval1", datatype: "json", timeout: 10000, data: "4", type: "post", success: function (data, textstatus, jqxhr) { }, error: function (jqxhr, textstatus, errorthrown) { }, complete: function (jqxhr, textstatus) { } });
the jsonp code same has jsonp instead of json , jsonpcallback function defined.
any suggestions? need both localhost , iis7!
i have tried including external reference in visual studio generates lot more web.config - want access svn via javascript, not backend code!!
more info: service namespace schoolswcf, class service1, service file schoolsservice.svc, method testschoolval1 takes int parameter, , localhost hosting app windows console app.
Comments
Post a Comment