Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

How to use SSL with a WCF web service? -


i have web service in asp.net running , works fine. need access methods in web-service using ssl. works perfect when contact web-service using http:// https:// "there no endpoint listening @ https://...".

can please me on how set web.config support both http , https access web service. have tried follow guidelines can't working.

some code:

my testservice.svc:

[servicecontract(namespace = "")] [aspnetcompatibilityrequirements(requirementsmode = aspnetcompatibilityrequirementsmode.allowed)] public class testservice {     [operationcontract]     [webget(responseformat = webmessageformat.json)]     public bool validuser(string email) {         return true;     } } 

my web.config:

<system.servicemodel>     <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" />         <behaviors>             <endpointbehaviors>                 <behavior name="serviceaspnetajaxbehavior">                     <enablewebscript />                 </behavior>             </endpointbehaviors>             <servicebehaviors>                 <behavior name="servicebehavior">                     <servicedebug includeexceptiondetailinfaults="true" />                 </behavior>                 <behavior name="">                     <servicemetadata httpgetenabled="true" />                     <servicedebug includeexceptiondetailinfaults="false" />                 </behavior>             </servicebehaviors>         </behaviors>         <services>             <service behaviorconfiguration="servicebehavior" name="testservice">                 <endpoint address="" behaviorconfiguration="serviceaspnetajaxbehavior"                      binding="webhttpbinding" bindingconfiguration="servicebinding"                      contract="testservice" />             </service>         </services>         <bindings>             <webhttpbinding>                 <binding name="servicebinding" maxbufferpoolsize="1000000" maxreceivedmessagesize="1000000">                     <readerquotas maxdepth="1000000" maxstringcontentlength="1000000" maxarraylength="1000000" maxbytesperread="1000000" maxnametablecharcount="1000000"/>                 </binding>             </webhttpbinding>         </bindings> </system.servicemodel> 

instead of using webhttpbinding, try creating custombinding instead:

<custombinding>     <binding name="poxbindinghttps" closetimeout="00:00:20">         <textmessageencoding writeencoding="utf-8" />         <httpstransport manualaddressing="true"/>     </binding>     <binding name="poxbindinghttp" closetimeout="00:00:20">         <textmessageencoding writeencoding="utf-8" />         <httptransport manualaddressing="true"/>     </binding> </custombinding> 

you'll need setup webhttpbehavior so:

<behaviors>     <endpointbehaviors>         <behavior name="ajaxbehavior">             <enablewebscript/>             <webhttp/>         </behavior>     </endpointbehaviors> </behaviors> 

and finally, service & endpoint:

<services>     <service name="testservice">         <endpoint name="ssldefault" address="" binding="custombinding" bindingconfiguration="poxbindinghttps" behaviorconfiguration="ajaxbehavior" contract="testservice"/>         <endpoint name="nossldefault" address="" binding="custombinding" bindingconfiguration="poxbindinghttp" behaviorconfiguration="ajaxbehavior" contract="testservice"/>     </service> </services> 

hopefully works out in creating ssl endpoint


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -