c# - Error during connection to wcf service by ssl -
c# - Error during connection to wcf service by ssl -
hello everybody,
i've done wcf service, published (i can connect browser , can see wsdl) when seek consume client programme i've written, obtain "an error occurred when verifying security message" message.
some detail: consumer , server on same machine (so isn't case of out-of-sync time between consumer , server), utilize self signed certificate, service set in subsection of greater solution, , has dedicated web.config overrides solution one.
web.config files same both on service side on consumer side (i've done re-create , paste service consumer file). consumer uses basichttpbinding , transportwithmessagecredential connection and, after several attempts, if i've created service reference service visual studio tool, in consumer code specify 1 time again both binding type endpoint address.
as i've said, service uses self signed certificate, , i've implemented validation class validate non trusted certificate.
when create proxy object in consumer class don't error, receive when seek consume method on service. i've set tracelog, doesn't seem show error, can understand:
<e2etraceevent xmlns="http://schemas.microsoft.com/2004/06/e2etraceevent"> <system xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"> <eventid>262165</eventid> <type>3</type> <subtype name="information">0</subtype> <level>8</level> <timecreated systemtime="2014-10-30t10:41:32.4017455z" /> <source name="system.servicemodel" /> <correlation activityid="{43c6480e-e3fe-4916-b3a3-efaa10881db5}" /> <execution processname="w3wp" processid="7004" threadid="6" /> <channel /> <computer>wkr1007r</computer> </system> <applicationdata> <tracedata> <dataitem> <tracerecord xmlns="http://schemas.microsoft.com/2004/10/e2etraceevent/tracerecord" severity="information"> <traceidentifier>http://msdn.microsoft.com/it-it/library/system.servicemodel.channels.requestchannelreplyreceived.aspx</traceidentifier> <description>ricevuta risposta tramite il canale di richiesta</description> <appdomain>/lm/w3svc/1/root/pbews_client_test-1-130591392918713557</appdomain> <source>system.servicemodel.channels.bufferedmessage/2733477</source> <extendeddata xmlns="http://schemas.microsoft.com/2006/08/servicemodel/messagetracerecord"> <messageproperties> <encoder>text/xml; charset=utf-8</encoder> <allowoutputbatching>false</allowoutputbatching> <security> <isanonymous>false</isanonymous> <windowsidentityused>false</windowsidentityused> </security> </messageproperties> <messageheaders></messageheaders> </extendeddata> </tracerecord> </dataitem> </tracedata>
only using fiddler can find error:
errore server nell'applicazione '/pbews_client_test'. errore durante la verifica della sicurezza del messaggio. descrizione: eccezione non gestita durante l'esecuzione della richiesta web corrente. per ulteriori informazioni sull'errore e sul suo punto di origine nel codice, vedere la traccia dello stack.
<b> dettagli eccezione: </b>system.servicemodel.faultexception: errore durante la verifica della sicurezza del messaggio.<br><br> <b>errore nel codice sorgente:</b> <br><br> <table width=100% bgcolor="#ffffcc"> <tr> <td> <code><pre>
riga 584: riga 585: public r...contracts.polpolizza recuperapolizza(int idpolizza, bool modalita) { riga 586: homecoming base.channel.recuperapolizza(idpolizza, modalita); riga 587: } riga 588:
</td> </tr> </table> <br> <b> file di origine: </b> c:\..\pbews_client_test\service references\servicereference1\reference.cs<b> riga: </b> 586 <br><br> <b>traccia dello stack:</b> <br><br> <table width=100% bgcolor="#ffffcc"> <tr> <td> [faultexception: errore durante la verifica della sicurezza del messaggio.]
system.runtime.remoting.proxies.realproxy.handlereturnmessage(imessage reqmsg, imessage retmsg) +14799942 system.runtime.remoting.proxies.realproxy.privateinvoke(messagedata& msgdata, int32 type) +622 pbews_client_test.servicereference1.pbews.recuperapolizza(int32 idpolizza, boolean modalita) +0 pbews_client_test.servicereference1.pbewsclient.recuperapolizza(int32 idpolizza, boolean modalita) in c:...\pbews_client_test\service references\servicereference1\reference.cs:586 pbews_client_test.pbews_testform.button1_click(object sender, eventargs e) in c:...\pbews_client_test\pbews_testform.aspx.cs:103 system.web.ui.webcontrols.button.raisepostbackevent(string eventargument) +155 system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint) +3804
</td> </tr> </table>
it says "an error occurred when verifying security message" , refers reference.cs, file has been created visual studio tool when setting service reference. lines 577 590 contains next code:
public pbews_client_test.servicereference1.mranaanagraficabaselist ricercaanagrafiche(system.collections.generic.list<rgi.passbroker.wcf.contracts.criterioricercaws> criteri) { homecoming base.channel.ricercaanagrafiche(criteri); } public system.threading.tasks.task<pbews_client_test.servicereference1.mranaanagraficabaselist> ricercaanagraficheasync(system.collections.generic.list<rgi.passbroker.wcf.contracts.criterioricercaws> criteri) { homecoming base.channel.ricercaanagraficheasync(criteri); } public rgi.passbroker.wcf.contracts.polpolizza recuperapolizza(int idpolizza, bool modalita) { homecoming base.channel.recuperapolizza(idpolizza, modalita); } public system.threading.tasks.task<rgi.passbroker.wcf.contracts.polpolizza> recuperapolizzaasync(int idpolizza, bool modalita) { homecoming base.channel.recuperapolizzaasync(idpolizza, modalita); }
does have suggestion can help me solve error?
thanks in andvance.
c# web-services wcf ssl
Comments
Post a Comment