Featured post
c# - WCF in IIS, using MSMQ in workgroup mode -
i've been trying out msmq wcf, can't seem work properly. i've got client (which sends messages queue) working, using wcf , service reference. code more or less this:
static void main(string[] args) { var client = new msmqservicereference.msmqcontractclient(); client.sendmessage("test"); client.close(); console.readkey(); }
where msmqcontractclient proxy generated visual studio when add service reference. endpoint in app.config pointing msmqueue:
<client> <endpoint address="net.msmq://localhost/private/msmqservice/msmqservice.svc" binding="netmsmqbinding" bindingconfiguration="msmqbindingnontransactionalnosecurity" contract="msmqservicereference.imsmqcontract" name="msmqservice" /> </client>
this works, messages being posted queue.
now trying service work, keep getting error:
binding validation failed because binding's msmqauthenticationmode property set windowsdomain msmq installed active directory integration disabled. channel factory or service host cannot opened.
things i've tried are:
give full access (including anonymous logon) queue
configuring app use specific binding config file using:
<bindings> <netmsmqbinding> <binding name="msmqbindingnontransactionalnosecurity" deadletterqueue="custom" exactlyonce="false"> <security mode="none" /> </binding> </netmsmqbinding> </bindings>
i tried running app pool in iis (7) under own account , administrator account
what stumps me keeps trying convince me trying run windowsdomain authentication. stated didn't want security mode set none, right?
my app @ moment webforms asp.net site wcf service added it.
if @ least point me right direction i'll grateful, i've spent time on already.
it seems if configuration being ignored, or overridden. full error message:
webhost failed process request. sender information: system.servicemodel.activation.hostedhttprequestasyncresult/63721755 exception: system.servicemodel.serviceactivationexception: service '/msmqservice/msmqservice.svc' cannot activated due exception during compilation. exception message is: binding validation failed because binding's msmqauthenticationmode property set windowsdomain msmq installed active directory integration disabled. channel factory or service host cannot opened.. ---> system.invalidoperationexception: binding validation failed because binding's msmqauthenticationmode property set windowsdomain msmq installed active directory integration disabled. channel factory or service host cannot opened. @ system.servicemodel.channels.msmqverifier.verifysecurity(msmqtransportsecurity security, nullable`1 useactivedirectory) @ system.servicemodel.channels.msmqverifier.verifyreceiver(msmqreceiveparameters receiveparameters, uri listenuri) @ system.servicemodel.channels.msmqtransportbindingelement.buildchannellistener[tchannel](bindingcontext context) @ system.servicemodel.channels.bindingcontext.buildinnerchannellistener[tchannel]() @ system.servicemodel.channels.messageencodingbindingelement.internalbuildchannellistener[tchannel](bindingcontext context) @ system.servicemodel.channels.binarymessageencodingbindingelement.buildchannellistener[tchannel](bindingcontext context) @ system.servicemodel.channels.bindingcontext.buildinnerchannellistener[tchannel]() @ system.servicemodel.channels.binding.buildchannellistener[tchannel](uri listenuribaseaddress, string listenurirelativeaddress, listenurimode listenurimode, bindingparametercollection parameters) @ system.servicemodel.description.dispatcherbuilder.maybecreatelistener(boolean actuallycreate, type[] supportedchannels, binding binding, bindingparametercollection parameters, uri listenuribaseaddress, string listenurirelativeaddress, listenurimode listenurimode, servicethrottle throttle, ichannellistener& result, boolean supportcontextsession) @ system.servicemodel.description.dispatcherbuilder.buildchannellistener(stuffperlistenuriinfo stuff, servicehostbase servicehost, uri listenuri, listenurimode listenurimode, boolean supportcontextsession, ichannellistener& result) @ system.servicemodel.description.dispatcherbuilder.initializeservicehost(servicedescription description, servicehostbase servicehost) @ system.servicemodel.servicehostbase.initializeruntime() @ system.servicemodel.servicehostbase.onbeginopen() @ system.servicemodel.servicehostbase.onopen(timespan timeout) @ system.servicemodel.channels.communicationobject.open(timespan timeout) @ system.servicemodel.channels.communicationobject.open() @ system.servicemodel.servicehostingenvironment.hostingmanager.activateservice(string normalizedvirtualpath) @ system.servicemodel.servicehostingenvironment.hostingmanager.ensureserviceavailable(string normalizedvirtualpath) --- end of inner exception stack trace --- @ system.runtime.asyncresult.end[tasyncresult](iasyncresult result) @ system.servicemodel.activation.hostedhttprequestasyncresult.end(iasyncresult result) process name: w3wp process id: 5660
i tried figuring out happens using reflector, seems somehow msmqtransportbindingelement passed channel building process, convinced has use windowsdomain security measure. however, have security set none in config file. ideas on override behavior comes from?
resolution:
i feel stupid on 1 hand, feel there's room improvement on other hand. short version messed value in 'name' attribute on service element:
<services> <service name="wcfservice.msmqservice"> <!-- <endpoint binding="mexhttpbinding" contract="imetadataexchange" />--> <endpoint name="msmq" address="net.msmq://localhost/private/msmqservice/msmqservice.svc" binding="netmsmqbinding" bindingconfiguration="nosecurity" contract="wcfservice.imsmqcontract" /> </service> </services>
the name same on client, however, client had bindings generated visual studio. gave different name (msmqservice), name value 'msmqservice.msmqservice'.
what kinda bothers me didn't warning whatsoever configuring non-existing service, or indication using default configuration service. nice if framework @ least generate warning somewhere using defaults, or option turn on form of strict mode. either way, input, , going bang head against wall few more times.
and yes, may point , laugh ;-)
try these settings... useactivedirectory
should false default, try it. authentication mode set on transport itself, msmqauthenticationmode
should set 'none'. msmqprotectionlevel
, clientcredentialtype
sound relevant, threw them in there,
: )
<bindings> <netmsmqbinding> <binding name="msmqbindingnontransactionalnosecurity" deadletterqueue="custom" useactivedirectory="false" exactlyonce="false"> <security mode="none"> <transport msmqauthenticationmode="none" msmqprotectionlevel="none" clientcredentialtype="none"/> </security> </binding> </netmsmqbinding> </bindings>
i'd concerned removing security, however... if you're on domain, should install msmq active directory integration, or use workgroup methods of securing messages.
also, don't forget, settings server , client have match.
hth,
james
sorry continual updates, attention details seems bit low today
: p
- Get link
- X
- Other Apps
Comments
Post a Comment