web services - Protocol Exception Wcf -
i wondering whether can trouble wcf, web.config
<?xml version="1.0" encoding="utf-8"?> <configuration> <!--diagnostics section, catch error , warning in production--> <system.diagnostics> <trace autoflush="true" /> <sources> <source propagateactivity="true" name="system.servicemodel" switchvalue="error, warning"> <listeners> <add type="system.diagnostics.defaulttracelistener" name="itlocal.olapwcfservicebrowser2005"> <filter type="" /> </add> <add name="servicemodeltracelistener"> <filter type="" /> </add> </listeners> </source> <source name="system.servicemodel.messagelogging" switchvalue="error, warning"> <listeners> <add type="system.diagnostics.defaulttracelistener" name="itlocal.olapwcfservicebrowser2005"> <filter type="" /> </add> <add name="servicemodelmessagelogginglistener"> <filter type="" /> </add> </listeners> </source> </sources> <sharedlisteners> <!--this our path in production server: d:\sitios\itlocal.olapwcfservicebrowser2005\log\--> <add initializedata="c:\users\tmxidsggutie\desktop\itlocal.olapwcfservicebrowser2005_web_tracelog.svclog" type="system.diagnostics.xmlwritertracelistener, system, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" name="servicemodeltracelistener" traceoutputoptions="logicaloperationstack, datetime, timestamp, processid, callstack"> <filter type="" /> </add> <add initializedata="c:\users\tmxidsggutie\desktop\itlocal.olapwcfservicebrowser2005_web_messages.svclog" type="system.diagnostics.xmlwritertracelistener, system, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" name="servicemodelmessagelogginglistener" traceoutputoptions="logicaloperationstack, datetime, timestamp, processid, callstack"> <filter type="" /> </add> </sharedlisteners> </system.diagnostics> <appsettings> <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true" /> </appsettings> <system.web> <compilation debug="true" targetframework="4.5" /> <httpruntime targetframework="4.5" maxrequestlength="2147483646" /> </system.web> <!--for services aply following service , endpoint behaviors--> <system.servicemodel> <diagnostics> <messagelogging logmalformedmessages="true" logmessagesattransportlevel="true" /> <endtoendtracing activitytracing="false" /> </diagnostics> <behaviors> <servicebehaviors> <behavior> <servicemetadata httpgetenabled="true" httpsgetenabled="true" /> <servicedebug includeexceptiondetailinfaults="true" httphelppageenabled="true" /> <datacontractserializer maxitemsinobjectgraph="2147483646" /> <servicetimeouts transactiontimeout="02:00:00" /> <servicediscovery></servicediscovery> </behavior> </servicebehaviors> <endpointbehaviors> <behavior> <endpointdiscovery enabled="true"></endpointdiscovery> <datacontractserializer maxitemsinobjectgraph="2147483646" /> </behavior> </endpointbehaviors> </behaviors> <!--all femsa's clients .net, use proprietary binary message encoding reduce message's size --> <bindings> <custombinding> <binding name="wshttpbindingbynaryencoding" closetimeout="01:00:00" opentimeout="01:00:00" receivetimeout="01:00:00" sendtimeout="01:00:00"> <binarymessageencoding> <readerquotas maxdepth="32" maxstringcontentlength="5242880" maxarraylength="2147483646" maxbytesperread="4096" maxnametablecharcount="5242880" /> </binarymessageencoding> <httptransport allowcookies="false" transfermode="buffered" maxbufferpoolsize="2147483646" maxreceivedmessagesize="2147483646"> </httptransport> </binding> </custombinding> </bindings> <!-- in case want scale service --> <standardendpoints> <udpdiscoveryendpoint> <standardendpoint name="adhocdiscoveryendpointconfiguration" discoverymode="adhoc" discoveryversion="wsdiscovery11" maxresponsedelay="00:00:10"> </standardendpoint> </udpdiscoveryendpoint> <announcementendpoint> <standardendpoint name="udpannouncementendpoint" discoveryversion="wsdiscovery11" /> </announcementendpoint> </standardendpoints> <services> <service name="itlocal.analysis2005.analysis2005"> <host> <baseaddresses> <add baseaddress="http://localhost:8081/analysis2005browser.svc/"/> </baseaddresses> </host> <endpoint name="rules" address="rules" binding="custombinding" bindingconfiguration="wshttpbindingbynaryencoding" contract="itlocal.contracts.olap.issasrulescontract"></endpoint> <endpoint name="udpdiscovery" kind="udpdiscoveryendpoint" endpointconfiguration="adhocdiscoveryendpointconfiguration" /> <endpoint name="mex" address="mex" binding="mexhttpbinding" contract="imetadataexchange" /> </service> </services> <protocolmapping> <add binding="basichttpsbinding" scheme="https" /> </protocolmapping> <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" /> </system.servicemodel> <system.webserver> <directorybrowse enabled="true"/> <handlers> <remove name="svc-integrated"/> </handlers> </system.webserver> </configuration>
as can see i'm tracing service both, tracelog , messagelog, problem i'm facing i'm getting protocol exception when adding service reference in client, if add uri [http://localhost:8081/analysis2005browser.svc/mex] in tracelog:
<exception> <exceptiontype>system.servicemodel.protocolexception, system.servicemodel, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089</exceptiontype> <message>there problem xml received network. see inner exception more details.</message> <stacktrace> @ system.runtime.diagnostics.etwdiagnostictrace.writeexceptiontotracestring(xmltextwriter xml, exception exception, int32 remaininglength, int32 remainingallowedrecursiondepth) @ system.runtime.diagnostics.etwdiagnostictrace.exceptiontotracestring(exception exception, int32 maxtracestringlength) @ system.runtime.diagnostics.etwdiagnostictrace.getserializedpayload(object source, tracerecord tracerecord, exception exception, boolean getservicereference) @ system.runtime.tracecore.throwingexception(etwdiagnostictrace trace, string param0, string param1, exception exception) @ system.runtime.exceptiontrace.traceexception[texception](texception exception, string eventsource) @ system.runtime.exceptiontrace.aserror(exception exception) @ system.servicemodel.channels.httppipeline.enqueuemessageasyncresult.completeparseandenqueue(iasyncresult result) @ system.servicemodel.channels.httppipeline.enqueuemessageasyncresult.handleparseincomingmessage(iasyncresult result) @ system.runtime.asyncresult.synccontinue(iasyncresult result) @ system.servicemodel.channels.httppipeline.enqueuemessageasyncresult..ctor(replychannelacceptor acceptor, action dequeuedcallback, httppipeline pipeline, asynccallback callback, object state) @ system.servicemodel.channels.httppipeline.emptyhttppipeline.beginprocessinboundrequest(replychannelacceptor replychannelacceptor, action dequeuedcallback, asynccallback callback, object state) @ system.servicemodel.channels.httpchannellistener`1.httpcontextreceivedasyncresult`1.processhttpcontextasync() @ system.servicemodel.channels.httpchannellistener`1.beginhttpcontextreceived(httprequestcontext context, action acceptorcallback, asynccallback callback, object state) @ system.servicemodel.activation.hostedhttptransportmanager.httpcontextreceived(hostedhttprequestasyncresult result) @ system.servicemodel.activation.hostedhttprequestasyncresult.handlerequest() @ system.servicemodel.activation.hostedhttprequestasyncresult.beginrequest() @ system.servicemodel.activation.hostedhttprequestasyncresult.onbeginrequest(object state) @ system.servicemodel.aspnetpartialtrusthelpers.partialtrustinvoke(contextcallback callback, object state) @ system.servicemodel.activation.hostedhttprequestasyncresult.onbeginrequestwithflow(object state) @ system.runtime.iothreadscheduler.scheduledoverlapped.iocallback(uint32 errorcode, uint32 numbytes, nativeoverlapped* nativeoverlapped) @ system.runtime.fx.iocompletionthunk.unhandledexceptionframe(uint32 error, uint32 bytesread, nativeoverlapped* nativeoverlapped) @ system.threading._iocompletioncallback.performiocompletioncallback(uint32 errorcode, uint32 numbytes, nativeoverlapped* poverlap) </stacktrace> <exceptionstring>system.servicemodel.protocolexception: there problem xml received network. see inner exception more details. ---> system.xml.xmlexception: body of message cannot read because empty. --- end of inner exception stack trace ---</exceptionstring> <innerexception> <exception> <exceptiontype>system.xml.xmlexception, system.xml, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089</exceptiontype> <message>the body of message cannot read because empty.</message> <stacktrace> @ system.runtime.diagnostics.etwdiagnostictrace.writeexceptiontotracestring(xmltextwriter xml, exception exception, int32 remaininglength, int32 remainingallowedrecursiondepth) @ system.runtime.diagnostics.etwdiagnostictrace.getinnerexception(exception exception, int32 remaininglength, int32 remainingallowedrecursiondepth) @ system.runtime.diagnostics.etwdiagnostictrace.writeexceptiontotracestring(xmltextwriter xml, exception exception, int32 remaininglength, int32 remainingallowedrecursiondepth) @ system.runtime.diagnostics.etwdiagnostictrace.exceptiontotracestring(exception exception, int32 maxtracestringlength) @ system.runtime.diagnostics.etwdiagnostictrace.getserializedpayload(object source, tracerecord tracerecord, exception exception, boolean getservicereference) @ system.runtime.tracecore.throwingexception(etwdiagnostictrace trace, string param0, string param1, exception exception) @ system.runtime.exceptiontrace.traceexception[texception](texception exception, string eventsource) @ system.runtime.exceptiontrace.aserror(exception exception) @ system.servicemodel.channels.httppipeline.enqueuemessageasyncresult.completeparseandenqueue(iasyncresult result) @ system.servicemodel.channels.httppipeline.enqueuemessageasyncresult.handleparseincomingmessage(iasyncresult result) @ system.runtime.asyncresult.synccontinue(iasyncresult result) @ system.servicemodel.channels.httppipeline.enqueuemessageasyncresult..ctor(replychannelacceptor acceptor, action dequeuedcallback, httppipeline pipeline, asynccallback callback, object state) @ system.servicemodel.channels.httppipeline.emptyhttppipeline.beginprocessinboundrequest(replychannelacceptor replychannelacceptor, action dequeuedcallback, asynccallback callback, object state) @ system.servicemodel.channels.httpchannellistener`1.httpcontextreceivedasyncresult`1.processhttpcontextasync() @ system.servicemodel.channels.httpchannellistener`1.beginhttpcontextreceived(httprequestcontext context, action acceptorcallback, asynccallback callback, object state) @ system.servicemodel.activation.hostedhttptransportmanager.httpcontextreceived(hostedhttprequestasyncresult result) @ system.servicemodel.activation.hostedhttprequestasyncresult.handlerequest() @ system.servicemodel.activation.hostedhttprequestasyncresult.beginrequest() @ system.servicemodel.activation.hostedhttprequestasyncresult.onbeginrequest(object state) @ system.servicemodel.aspnetpartialtrusthelpers.partialtrustinvoke(contextcallback callback, object state) @ system.servicemodel.activation.hostedhttprequestasyncresult.onbeginrequestwithflow(object state) @ system.runtime.iothreadscheduler.scheduledoverlapped.iocallback(uint32 errorcode, uint32 numbytes, nativeoverlapped* nativeoverlapped) @ system.runtime.fx.iocompletionthunk.unhandledexceptionframe(uint32 error, uint32 bytesread, nativeoverlapped* nativeoverlapped) @ system.threading._iocompletioncallback.performiocompletioncallback(uint32 errorcode, uint32 numbytes, nativeoverlapped* poverlap) </stacktrace> <exceptionstring>system.xml.xmlexception: body of message cannot read because empty.</exceptionstring> </exception> </innerexception> </exception>
i exception warning one, because can invoke methods of wcf service without problem , strange thing using wcf test client, when add same uri above, don't exception @ all. strange thing if change uri 1 [http://localhost:8081/analysis2005browser.svc/] different exception: either endpoint or soap action not found (in case exception in svc tracelog either using wcf test client or adding service reference):
<e2etraceevent xmlns="http://schemas.microsoft.com/2004/06/e2etraceevent"><system xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><eventid>262155</eventid><type>3</type><subtype name="error">0</subtype><level>2</level><timecreated systemtime="2013-05-04t22:09:47.8030567z" /><source name="system.servicemodel" /><correlation activityid="{00000000-0000-0000-0000-000000000000}" /><execution processname="w3wp" processid="3596" threadid="26" /><channel /><computer>femxdmscontr1a</computer></system><applicationdata><tracedata><dataitem><tracerecord xmlns="http://schemas.microsoft.com/2004/10/e2etraceevent/tracerecord" severity="error"><traceidentifier>http://msdn.microsoft.com/es-mx/library/system.servicemodel.channels.httpchannelmessagereceivefailed.aspx</traceidentifier><description>failed lookup channel receive incoming message. either endpoint or soap action not found.</description><appdomain>/lm/w3svc/6/root-1-130121789629535720</appdomain><source>system.servicemodel.activation.hostedhttptransportmanager/43776817</source><extendeddata xmlns="http://schemas.microsoft.com/2006/08/servicemodel/stringtracerecord"><isrecycling>false</isrecycling></extendeddata></tracerecord></dataitem></tracedata><system.diagnostics xmlns="http://schemas.microsoft.com/2004/08/system.diagnostics"><logicaloperationstack></logicaloperationstack><timestamp>7122556802571</timestamp><callstack> @ system.environment.getstacktrace(exception e, boolean needfileinfo) @ system.environment.get_stacktrace() @ system.diagnostics.traceeventcache.get_callstack() @ system.diagnostics.xmlwritertracelistener.writefooter(traceeventcache eventcache) @ system.diagnostics.xmlwritertracelistener.tracedata(traceeventcache eventcache, string source, traceeventtype eventtype, int32 id, object data) @ system.diagnostics.tracesource.tracedata(traceeventtype eventtype, int32 id, object data) @ system.servicemodel.diagnostics.legacydiagnostictrace.traceevent(traceeventtype type, int32 code, string msdntracecode, string description, tracerecord trace, exception exception, object source) @ system.servicemodel.diagnostics.traceutility.traceevent(traceeventtype severity, int32 tracecode, string tracedescription, tracerecord extendeddata, object source, exception exception) @ system.servicemodel.activation.hostedhttptransportmanager.httpcontextreceived(hostedhttprequestasyncresult result) @ system.servicemodel.activation.hostedhttprequestasyncresult.handlerequest() @ system.servicemodel.activation.hostedhttprequestasyncresult.beginrequest() @ system.servicemodel.activation.hostedhttprequestasyncresult.onbeginrequest(object state) @ system.servicemodel.aspnetpartialtrusthelpers.partialtrustinvoke(contextcallback callback, object state) @ system.servicemodel.activation.hostedhttprequestasyncresult.onbeginrequestwithflow(object state) @ system.runtime.iothreadscheduler.scheduledoverlapped.iocallback(uint32 errorcode, uint32 numbytes, nativeoverlapped* nativeoverlapped) @ system.runtime.fx.iocompletionthunk.unhandledexceptionframe(uint32 error, uint32 bytesread, nativeoverlapped* nativeoverlapped) @ system.threading._iocompletioncallback.performiocompletioncallback(uint32 errorcode, uint32 numbytes, nativeoverlapped* poverlap)</callstack></system.diagnostics></applicationdata></e2etraceevent>
what doing wrong guys, said before, can invoke service operations without problem why exceptions...????
also noticed when using mex address in message log, (double mex):
<messagelogtracerecord> <s:envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:header> <a:action s:mustunderstand="1" xmlns:a="http://www.w3.org/2005/08/addressing">http://schemas.xmlsoap.org/ws/2004/09/transfer/get</a:action> <a:messageid xmlns:a="http://www.w3.org/2005/08/addressing">urn:uuid:b60bf2b8-f798-471f-a9da-295168061277</a:messageid> <a:replyto xmlns:a="http://www.w3.org/2005/08/addressing"> <a:address>http://www.w3.org/2005/08/addressing/anonymous</a:address> </a:replyto> <a:to s:mustunderstand="1" xmlns:a="http://www.w3.org/2005/08/addressing">http://localhost:8081/analysis2005browser.svc/mex/mex</a:to> </s:header> </s:envelope> </messagelogtracerecord>
thanks in advise. i'm using .net framework 4.5.
Comments
Post a Comment