c# - Sharepoint 2010 problems with WCF service -


i need create wcf service sharepoint 2010. idea use jquery ajax communicate service. cals service methods fail.

i try use wcf test client , message:

failed invoke service. possible causes: service offline or inaccessible; client-side configuration not match proxy; existing proxy invalid. refer stack trace more detail. can try recover starting new proxy, restoring default configuration, or refreshing service. 

and error detais:

    content type text/html; charset=utf-8 of response message not match content type of binding (text/xml; charset=utf-8). if using custom encoder, sure iscontenttypesupported method implemented properly. first 227 bytes of response were: 'a transport-level error has occurred when sending request server. (provider: shared memory provider, error: 0 - either required impersonation level not provided, or provided impersonation level invalid.)'.  server stack trace:     @ system.servicemodel.channels.httpchannelutilities.validaterequestreplyresponse(httpwebrequest request, httpwebresponse response, httpchannelfactory factory, webexception responseexception, channelbinding channelbinding)    @ system.servicemodel.channels.httpchannelfactory.httprequestchannel.httpchannelrequest.waitforreply(timespan timeout)    @ system.servicemodel.channels.requestchannel.request(message message, timespan timeout)    @ system.servicemodel.dispatcher.requestchannelbinder.request(message message, timespan timeout)    @ system.servicemodel.channels.servicechannel.call(string action, boolean oneway, proxyoperationruntime operation, object[] ins, object[] outs, timespan timeout)    @ system.servicemodel.channels.servicechannel.call(string action, boolean oneway, proxyoperationruntime operation, object[] ins, object[] outs)    @ system.servicemodel.channels.servicechannelproxy.invokeservice(imethodcallmessage methodcall, proxyoperationruntime operation)    @ system.servicemodel.channels.servicechannelproxy.invoke(imessage message)  exception rethrown @ [0]:     @ system.runtime.remoting.proxies.realproxy.handlereturnmessage(imessage reqmsg, imessage retmsg)    @ system.runtime.remoting.proxies.realproxy.privateinvoke(messagedata& msgdata, int32 type)    @ itv2wcfservice.dowork()    @ tv2wcfserviceclient.dowork() 

enter image description here

but service http://localhost/_vti_bin/site/tempservice.svc/mex avaliable , give me normal response.

everything done according article on msdn

http://msdn.microsoft.com/en-us/library/ff521581.aspx

whats problem , how deal it?

evgeny:

it looks webservice returns standard soap xml response. jquery expects use json. think easier way set jquery use xml. alternatively can change web service return json instead of xml.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -