asp.net - WCF service not working when accessed over HTTPS and HTTP -



asp.net - WCF service not working when accessed over HTTPS and HTTP -

i've installed ssl certificate in iis.

now when navigate domain https://www.example.com/ page loads correctlty. when seek approach web service (which works perfect on http) on https: https://www.example.com/service.svc/newprofile/?id=8&ipaddress=124.162.13.109 get:

the resource cannot found. description: http 404. resource looking (or 1 of dependencies) have been removed, had name changed, or temporarily unavailable. please review next url , create sure spelled correctly. requested url: /service.svc/newprofile/

i checked here

webservice on ssl endpoint not found 404 create asp.net webservice ssl https moved asp.net website iis 8 on windows server 2012... services missing: .svc files viewable, methods give 404

but renaming webhttpbinding basichttpbinding throws unsupported error in combination jsonp. service element name in web.config matches qualified named of class implements contract.

here's web.config

<system.servicemodel> <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" /> <bindings> <webhttpbinding> <binding name="webhttpbindingwithjsonp" crossdomainscriptaccessenabled="true"> </binding> <binding name="webhttpsbindingwithjsonp" crossdomainscriptaccessenabled="true"> <security mode="transport"></security> </binding> </webhttpbinding> </bindings> <client /> <services> <service name="restservice.service"> <endpoint behaviorconfiguration="webhttp" binding="webhttpbinding" contract="restservice.iservice" /> <endpoint address="/service.svc" binding="webhttpbinding" bindingconfiguration="webhttpbindingwithjsonp" contract="restservice.iservice" /> <endpoint address="/service.svc" binding="webhttpbinding" bindingconfiguration="webhttpsbindingwithjsonp" contract="restservice.iservice" /> </service> </services> <behaviors> <servicebehaviors> <behavior name=""> <servicemetadata httpgetenabled="true" /> <servicedebug includeexceptiondetailinfaults="true" /> </behavior> </servicebehaviors> <endpointbehaviors> <behavior name="webhttp"> <webhttp /> </behavior> <behavior name="webhttpbehavior"> <webhttp /> </behavior> </endpointbehaviors> </behaviors> </system.servicemodel>

i checked wsdl: http://www.example.com/service.svc?wsdl

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="service" targetnamespace="http://tempuri.org/"> <wsdl:types> <xsd:schema targetnamespace="http://tempuri.org/imports"> <xsd:import schemalocation="http://www.example.com/service.svc?xsd=xsd0" namespace="http://tempuri.org/"/> <xsd:import schemalocation="http://www.example.com/service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/serialization/"/> <xsd:import schemalocation="http://www.example.com/service.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/restservice"/> <xsd:import schemalocation="http://www.example.com/service.svc?xsd=xsd3" namespace="http://schemas.microsoft.com/message"/> <xsd:import schemalocation="http://www.example.com/service.svc?xsd=xsd4" namespace="http://schemas.datacontract.org/2004/07/ajaxcontroltoolkit"/> <xsd:import schemalocation="http://www.example.com/service.svc?xsd=xsd5" namespace="http://schemas.microsoft.com/2003/10/serialization/arrays"/> </xsd:schema> </wsdl:types> <wsdl:message name="iservice_newprofile_inputmessage"> <wsdl:part name="parameters" element="tns:newprofile"/> </wsdl:message>

when check on https: https://www.example.com/service.svc?wsdl

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="service" targetnamespace="http://tempuri.org/"> <wsdl:types> <xsd:schema targetnamespace="http://tempuri.org/imports"> <xsd:import schemalocation="https://www.example.com/service.svc?xsd=xsd0" namespace="http://tempuri.org/"/> <xsd:import schemalocation="https://www.example.com/service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/serialization/"/> <xsd:import schemalocation="https://www.example.com/service.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/restservice"/> <xsd:import schemalocation="https://www.example.com/service.svc?xsd=xsd3" namespace="http://schemas.microsoft.com/message"/> <xsd:import schemalocation="https://www.example.com/service.svc?xsd=xsd4" namespace="http://schemas.datacontract.org/2004/07/ajaxcontroltoolkit"/> <xsd:import schemalocation="https://www.example.com/service.svc?xsd=xsd5" namespace="http://schemas.microsoft.com/2003/10/serialization/arrays"/> </xsd:schema> </wsdl:types> <wsdl:message name="iservice_newprofile_inputmessage"> <wsdl:part name="parameters" element="tns:newprofile"/> </wsdl:message>

the service in case defined as:

<operationcontract()> _ <web.webinvoke(method:="get", responseformat:=web.webmessageformat.json, bodystyle:=web.webmessagebodystyle.bare, _ uritemplate:="newprofile/?id={id}&ipaddress={ipaddress}")> _ function newprofile(byval id string, optional byval ipaddress string = "") service.profile

my webservice

namespace restservice <aspnetcompatibilityrequirements(requirementsmode:=aspnetcompatibilityrequirementsmode.allowed)> _ public class service implements iservice 'my code end class end namespace

i enabled tracing in web.config well, here's part of log (so not allow post all):

<e2etraceevent xmlns="http://schemas.microsoft.com/2004/06/e2etraceevent"> <system xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"> <eventid>262155</eventid> <type>3</type> <subtype name="error">0</subtype> <level>2</level> <timecreated systemtime="2014-10-27t19:07:08.0773174z" /> <source name="system.servicemodel" /> <correlation activityid="{f7c83e1b-3e28-4e4f-8978-23f5073be422}" /> <execution processname="w3wp" processid="1428" threadid="19" /> <channel/> <computer>mypc</computer> </system> <applicationdata> <tracedata> <dataitem> <tracerecord xmlns="http://schemas.microsoft.com/2004/10/e2etraceevent/tracerecord" severity="error"> <traceidentifier>http://msdn.microsoft.com/nl-nl/library/system.servicemodel.channels.httpchannelmessagereceivefailed.aspx</traceidentifier> <description>failed lookup channel receive incoming message. either endpoint or soap action not found.</description> <appdomain>/lm/w3svc/1/root-2-130589104148009222</appdomain> <source>system.servicemodel.activation.hostedhttptransportmanager/33997547</source> <extendeddata xmlns="http://schemas.microsoft.com/2006/08/servicemodel/stringtracerecord"> <isrecycling>false</isrecycling> </extendeddata> </tracerecord> </dataitem> </tracedata> </applicationdata> </e2etraceevent> <e2etraceevent xmlns="http://schemas.microsoft.com/2004/06/e2etraceevent"> <system xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"> <eventid>131074</eventid> <type>3</type> <subtype name="error">0</subtype> <level>2</level> <timecreated systemtime="2014-10-27t19:07:08.0803197z" /> <source name="system.servicemodel" /> <correlation activityid="{00000000-0000-0000-0000-000000000000}" /> <execution processname="w3wp" processid="1428" threadid="19" /> <channel/> <computer>mypc</computer> </system> <applicationdata> <tracedata> <dataitem> <tracerecord xmlns="http://schemas.microsoft.com/2004/10/e2etraceevent/tracerecord" severity="error"> <traceidentifier>http://msdn.microsoft.com/nl-nl/library/system.servicemodel.diagnostics.eventlog.aspx</traceidentifier> <description>wrote eventlog.</description> <appdomain>/lm/w3svc/1/root-2-130589104148009222</appdomain> <extendeddata xmlns="http://schemas.microsoft.com/2006/08/servicemodel/dictionarytracerecord"> <categoryid.name>eventlogcategory</categoryid.name> <categoryid.value>5</categoryid.value> <instanceid.name>eventid</instanceid.name> <instanceid.value>3221356547</instanceid.value> <value0>system.servicemodel.activation.hostedhttprequestasyncresult/52951402</value0> <value1>system.web.httpexception (0x80004005): there no channel actively listening @ 'https://www.example.com/service.svc/newprofile/?id=8&amp;amp;ipaddress=25.62.133.109'. caused wrong address uri. ensure address message sent matches address on service listening. ---&amp;gt; system.servicemodel.endpointnotfoundexception: there w

i want service available on both http , https.

i checked web.config , global.asax.vb, i'm not doing https requests, not in iis...what can issue be?

update

ok, removed endpoints , trying figure out provide under address value of endpoint. config below error: the endpoint @ 'http://<pcname>/service.svc' not have binding none messageversion. 'system.servicemodel.description.webhttpbehavior' intended utilize webhttpbinding or similar bindings.

<system.servicemodel> <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" /> <bindings> <webhttpbinding> <binding name="webhttpbindingwithjsonp" crossdomainscriptaccessenabled="true"> <security mode="transport"></security> </binding> </webhttpbinding> <wshttpbinding> <binding name="wshttpbinding" > <security mode="transport"> </security> </binding> </wshttpbinding> </bindings> <client /> <services> <service name="restservice.service"> <endpoint behaviorconfiguration="webhttp" binding="webhttpbinding" contract="restservice.iservice" /> <endpoint behaviorconfiguration="webhttp" binding="wshttpbinding" contract="restservice.iservice" /> <!-- <endpoint address="/service.svc" binding="webhttpbinding" bindingconfiguration="webhttpbindingwithjsonp" contract="restservice.iservice" /> --> <!-- <endpoint behaviorconfiguration="webhttp" binding="webhttpbinding" contract="restservice.iservice" /> <endpoint address="/service.svc" binding="webhttpbinding" bindingconfiguration="webhttpbindingwithjsonp" contract="restservice.iservice" /> --> </service> </services> <behaviors> <servicebehaviors> <behavior name=""> <servicemetadata httpgetenabled="true" httpsgetenabled="true" /> <servicedebug includeexceptiondetailinfaults="true" /> </behavior> </servicebehaviors> <endpointbehaviors> <behavior name="webhttp"> <webhttp /> </behavior> <behavior name="webhttpbehavior"> <webhttp /> </behavior> </endpointbehaviors> </behaviors> </system.servicemodel>

@flo, able create work. have updated <endpoint behaviorconfiguration .. , set <service behaviorconfiguration=.., , worked, mean when nail both http , https version of www.example.com/service.svc/newprofile/?id=8&ipaddress=124.162.13.109, right output. next system.servicemodel part of web.config. please seek this, allow me know, if still not able create work.

<system.servicemodel> <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" /> <bindings> <webhttpbinding> <binding name="binding" crossdomainscriptaccessenabled="true"> <security mode="transport"> <transport clientcredentialtype="none" /> </security> </binding> <binding name="httpbind" crossdomainscriptaccessenabled="true"> </binding> </webhttpbinding> </bindings> <client /> <services> <service name="restservice.service" behaviorconfiguration="servicebehaviour"> <endpoint address="" binding="webhttpbinding" bindingconfiguration="binding" contract="restservice.iservice" behaviorconfiguration="web"> </endpoint> <endpoint address="" binding="webhttpbinding" bindingconfiguration="httpbind" contract="restservice.iservice" behaviorconfiguration="web"> </endpoint> </service> </services> <behaviors> <servicebehaviors> <behavior name="servicebehaviour"> <servicemetadata httpgetenabled="true" httpsgetenabled="true" /> <servicedebug includeexceptiondetailinfaults="true" /> </behavior> <behavior name="web"> <servicemetadata httpgetenabled="true" httpsgetenabled="true" /> <servicedebug includeexceptiondetailinfaults="true" /> </behavior> </servicebehaviors> <endpointbehaviors> <behavior name="web"> <webhttp helpenabled="true" /> </behavior> </endpointbehaviors> </behaviors> </system.servicemodel>

asp.net vb.net web-services wcf ssl

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -