web services - Client App with WsHttpBinding gets "no endpoint listening at..." -
i have client application talks our web service hosted on server (we'll call hostserver). client application can build , connect fine using basichttpbinding. however, i'm trying impliment wshttpbinding security reasons.
last week before lunch swear working hardcoded certificate. came lunch, checked in code , won't run. keep getting "there no endpoint listening @ https://hostserver:1234/service.svc/myservicename accept message. caused incorrect address or soap action.". i've tried re-checking settings, retracing steps, can't seem functioning state in.
i using servicereference address of "https ://hostserver:1234/service.svc?singlewsdl". can navigate "https ://hostserver:1234/service.svc" without problem , view wsdl.
my client code is
wshttpbinding wsbinding = new wshttpbinding(securitymode.transport); wsbinding.security.transport.clientcredentialtype = httpclientcredentialtype.certificate; client = new myservicename(wsbinding, new endpointaddress(endpoint)); client.clientcredentials.clientcertificate.setcertificate( storelocation.currentuser, storename.my, x509findtype.findbysubjectname, "localcertname"); client.changepassword("test_user", "pt", "a1");
my value endpoint = https://hostserver:1234/service.svc/myservicename
my iis site set binding http , https (with correct ip & port id)
i need code working before taking off (my wife due our second child day). i've been working debug 2 days, in addition time took me stand is. please help.
so able working again. listing steps performed below in hopes might else.
on iis server (iis manager):
modified "site bindings" include http & https (w/different port numbers)
set ssl setting "require ssl" , "accept"
on iis server (web.config):
added
<bindings> <wshttpbinding> <binding name="wshttpendpointbinding"> <security mode="transport"> <transport clientcredentialtype ="certificate"/> </security> </binding> </wshttpbinding> </bindings>
to "system.servicemodel" tag.
also, added 'bindingconfiguration="wshttpendpointbinding"' endpoint.
in code
updated endpoint address use generated on iis server.
used following code creating endpoint
wshttpbinding wsbinding = new wshttpbinding(securitymode.transport); wsbinding.security.transport.clientcredentialtype = httpclientcredentialtype.certificate; client = new serviceclient(wsbinding, new endpointaddress(endpoint)); client.clientcredentials.clientcertificate.setcertificate(storelocation.localmachine, storename.my, x509findtype.findbyissuername, certname);
Comments
Post a Comment