Skip to main content
Home Forums Silverlight Programming Accessing Web Services with Silverlight Consuming WCF Services Hosted in HTTPS Environment
9 replies. Latest Post by muradmohdzain on March 9, 2009.
(0)
muradmoh...
Member
40 points
5 Posts
03-03-2009 8:41 PM |
Hi Guys,
I need your help on this. I have a silverlight + WCF project. My WCF services hosted in HTTPS IIS server (example: https://XX.XX.XX.XX/MinisterServiceHost/MinisterProfileService.svc). When i put that url to my local browser its working fine. means that the service is running. The problem now is that when i try to Add Service Reference in my silverlight project. It throwing error saying something about metadata cannot be resolved.
here is my wcf configuration at the hosting server :-
<
</
There was an error downloading 'https://XX.XX.XX.XX/MinisterServiceHost/MinisterProfileService.svc'.The request failed with HTTP status 403: Forbidden.Metadata contains a reference that cannot be resolved: 'https://XX.XX.XX.XX/MinisterServiceHost/MinisterProfileService.svc'.The HTTP request was forbidden with client authentication scheme 'Anonymous'.The remote server returned an error: (403) Forbidden.If the service is defined in the current solution, try building the solution and adding the service reference again.
Any solution on this?
rajeshku...
168 points
51 Posts
03-04-2009 5:59 AM |
Hi,
I believe Silverlight supports only "basicHttpBinding". Hope you can access HTTPS with the below declaration in the config file
HarshBar...
Star
9908 points
1,719 Posts
03-04-2009 6:13 AM |
As mentioned by rajesh you need to change security mode.
You can check this link also for reference.
http://silverlight.net/forums/t/13275.aspx
Apart from that there is video in msdn site for https acess you can search for that also.(I don't tremember url)
MarkMonster
Contributor
5220 points
1,046 Posts
03-04-2009 7:12 AM |
I have the feeling you're also missing a mexHttpBinding url.
03-04-2009 8:27 PM |
rajeshkumar.a@gmail.com: Hi, I believe Silverlight supports only "basicHttpBinding". Hope you can access HTTPS with the below declaration in the config file <security mode="Transport" />
Yes it is. I know about that. But that one is for the client config. My case is for the server config. If I configure my service config file at the server using basicHttpBinding, it won't work at all. There is another error will throw. That config file works perfectly. But one problem is that i cannot use the mexBinding. Another error will throw. The error that i mentioned in my first post is when i try to create client proxy using visual studio project (Add Service Reference). Let say my config file is like that (first post), how do i want to put in my mexHttpsBinding for my service? I have tried to put the mexbinding things, but an error will throw saying something about HttpGetUrl bla bla bla ... If I use basicHttpBinding, an error will throw saying something about security mode 'None' not match with IIS "ssl, ssl negotiate, ssl bla bla bla ....
come on guys, how difficult it is to configure wcf in https environment. Someone out there can solved this. I'm counting on you. :)
to be honest, that config file working fine. i can see the service in my browser.
03-04-2009 8:31 PM |
MarkMonster:I have the feeling you're also missing a mexHttpBinding url.
i noticed about this. Actually i have tried to put the mex binding, but it won;t work at all. My service will throw error. thats why i take it out and suddenly magical thing happened that my service running perfectly. :)
since that my service run in https environment, i used mexHttpsBinding
errazudin
2 points
1 Posts
03-05-2009 12:43 AM |
Hi, That 'magical' thing.. is it explainable here? Love to hear that.. if you don't mind :)
03-05-2009 1:49 AM |
What's basically is the case is the following.
In the old days (WebServices) we didn't have to worry about metadata. We could simply use ServiceName.asmx for the service and ServiceName.asmx?wsdl for the metadata.
In the new day (WCF) we will have to worry about this metadat. This is because each different protocol you want the Service to run on needs to be added. The MetaDataExchange is also a different protocol. For Https this will be mexHttpsBinding.
03-05-2009 2:52 AM |
MarkMonster: What's basically is the case is the following. In the old days (WebServices) we didn't have to worry about metadata. We could simply use ServiceName.asmx for the service and ServiceName.asmx?wsdl for the metadata. In the new day (WCF) we will have to worry about this metadat. This is because each different protocol you want the Service to run on needs to be added. The MetaDataExchange is also a different protocol. For Https this will be mexHttpsBinding.
well, to test for another solution, i created ASMX web service, hosted it in the same https environment. Guess what? the same error triggered.
Frankly, everything works fine in HTTP environment. There must be a way how to solve this problem. I will not give up until i got the solution. Fight till the end of your blood. :)
03-09-2009 8:23 PM |
There's not much articles talking about wcf hosted in https environment. Most of success 'stories' talking about wcf in http. Well i guess that is quite simple for any deployment. Searching on the net not much returning a good results.