c# - MessageSecurityException No signature message parts were specified for messages with the 'http://...' action -


here config file used both client , server

<?xml version="1.0" encoding="utf-8" ?> <configuration>   <system.servicemodel>     <bindings>       <wshttpbinding>         <binding name="wshttpbinding_ipm_service" closetimeout="00:01:00"             opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00"             bypassproxyonlocal="false" transactionflow="false" hostnamecomparisonmode="strongwildcard"             maxbufferpoolsize="524288" maxreceivedmessagesize="65536"             messageencoding="text" textencoding="utf-8" usedefaultwebproxy="true"             allowcookies="false">           <readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384"               maxbytesperread="4096" maxnametablecharcount="16384" />           <reliablesession ordered="true" inactivitytimeout="00:10:00"               enabled="false" />           <security mode="message">             <transport clientcredentialtype="windows" proxycredentialtype="none"                 realm="" />             <message clientcredentialtype="windows" negotiateservicecredential="true"                 algorithmsuite="default" establishsecuritycontext="true" />           </security>         </binding>       </wshttpbinding>     </bindings>     <client>       <endpoint address="http://localhost:8080/pm_service"           binding="wshttpbinding" bindingconfiguration="wshttpbinding_ipm_service"           contract="ipm_service" name="wshttpbinding_ipm_service">         <identity>          </identity>       </endpoint>     </client>   </system.servicemodel> </configuration> 

this block of code error.

            programmingmaster_serviceclient aclient = new programmingmaster_serviceclient();             aclient.beginprogrammingsession(0x01);             aclient.close(); 

the second line exception happens at. programmingmaster_serviceclient created using svcutil.exe tool.

this code i'm using start server.

public bool startservice(string aip) {     string lsinstanceid = pfblock.instanceid.tostring();     uri lobaseaddr = new uri(string.format("http://localhost:808{0}/{1}", lsinstanceid, pfblock.fblockname));      plocalhost = new servicehost(typeof(shadow_programmingmasterservice), lobaseaddr);      start(aip);     return ishostopen; }  private void start(string aip) {     shadow_programmingmasterservice.setapi(this);      try     {         plocalhost.addserviceendpoint(typeof(iprogrammingmaster_service), new wshttpbinding(), "pm_service");          servicemetadatabehavior losmb = new servicemetadatabehavior();         losmb.httpgetenabled = true;         plocalhost.description.behaviors.add(losmb);         try         {             plocalhost.open();             ishostopen = true;             ppm_client = new programmingmasterproxyclient(this, poutput);             ppm_client.ipaddress = aip;             this.subscribe(ppm_client);             poutput.setcomment("programmingmasterservice initialized");         }         catch (communicationexception ce)         {             poutput.seterror(ce.message);             plocalhost.abort();             ishostopen = false;         }     }     catch (communicationexception ex)     {         poutput.seterror(ex.message);         plocalhost.abort();         ishostopen = false;         //this.unsubscribe(posttsclient);         //posttsclient = null;     } } 

anyone have ideas of causing this?

the reason occurs in case wcf service code has been modified, recompiled (and deployed in debugger) while client, has outdated service reference, expecting , depending on subject change , hence conflicts ensue.

updating service reference client correct problem.

to continue, above not can't change code within service once referenced client (without breaking client), however, such problem suggests substantial changes parts of service client depending on, such signatures of exposed methods, existing datamember properties of existing datacontract types , like.

in contrast can alter method body of existing service calls heart's content (the client doesn't care how service works, how make work); can add new members existing composite datacontract types new clients may consume updates readily, preventing datatype2 type scenarios redundancy, , on.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -