Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Having trouble successfully deploying WCF service to public web site

36 views
Skip to first unread message

kier...@yahoo.com

unread,
Feb 7, 2008, 9:03:38 PM2/7/08
to
I'm fairly new to deploying WCF web services and am running into
problems deploying my WCF service to a public web site. I want this
web service to be accessible by clients outside my domain.

The problem I'm running into first off is that the WSDL contains the
server's name instead of the web site's name. The WSDL elements and
attributes listed below contain "http://<server_internal_name>/..."
instead of "http://<web_site_name>/...":
* xsd:import schemaLocation
* soap12:address location/@location
* wsa10:Address

The second manifestation of the problem is that when I create a client
app in VS 2008 and then add a service reference to this service (using
the Add Service Reference option in the Solution Explorer), the
endpoint address also contains the server's name instead of the web
site name. One other thing that I notice is that when I try to add the
reference to the web service, the MetadataSource address in the svcmap
file refers to the "/mex" address instead of pointing to the wsdl
(which looks like "...?wsdl").

I have tried to fix this by adding <baseaddresses>/<add
baseaddress="..." /></baseaddresses> entries into the web.config for
the web service. Also added <identity><dns value="..." /></identity>
entries in an attempt to fix this. I'm hoping that all is wrong is
that I'm missing some configuration values.

Can somebody tell me what I'm doing wrong? Thanks!

rbeke...@gmail.com

unread,
Mar 13, 2008, 5:09:45 PM3/13/08
to
Have the same problem, the only solution I found for now is to replace
the server name with the domain name in the wsdl and xsd files!

Tiago Halm

unread,
Mar 13, 2008, 6:09:47 PM3/13/08
to
If hosting in IIS, just set the hostheader of the website to the public
hostname. The generated WSDL/XSDs will contain the hostname with which it
was accessed.

Tiago Halm

<kier...@yahoo.com> wrote in message
news:c8010220-6b19-4d32...@d21g2000prf.googlegroups.com...

gar...@yahoo.com

unread,
Apr 21, 2008, 3:54:29 AM4/21/08
to
Set the httpGetUrl or the httpsGetUrl (depending on which protocol you
are using) to an empty string.

<serviceMetadata httpsGetEnabled="true" httpsGetUrl="" />

kkao77

unread,
May 1, 2008, 2:12:04 AM5/1/08
to
can you show me in more detail? I have same problem where on the page
it's https://service.premilance.com/Company.svc, but the svcutil tells
me to get it from https://pserver1/Company.svc?wsdl which is
incorrect.. I have no clue how to fix it and i'm struggling for two
days already :(


On Mar 13, 3:09 pm, "Tiago Halm" <th...@nospam.hotmail.com> wrote:
> If hosting in IIS, just set the hostheader of the website to the public
> hostname. The generated WSDL/XSDs will contain the hostname with which it
> was accessed.
>
> Tiago Halm
>

> <kiern...@yahoo.com> wrote in message

tiago...@gmail.com

unread,
May 6, 2008, 1:13:49 PM5/6/08
to
On May 1, 7:12 am, kkao77 <kka...@gmail.com> wrote:
> can you show me in more detail?  I have same problem where on the page
> it'shttps://service.premilance.com/Company.svc, but the svcutil tells
> me to get it fromhttps://pserver1/Company.svc?wsdlwhich is
> > > Can somebody tell me what I'm doing wrong? Thanks!- Hide quoted text -
>
> - Show quoted text -

Since you have a server certificate in IIS, you cannot set the host
header name via the UI, so IIRC you need to use adsutil.vbs for that.
Its useful to read this blog and view the webcast on setting Host
Headers with SSL in IIS 6.0.
http://agramont.net/blogs/conrad/archive/2006/06/26/21.aspx

Tiago Halm


Message has been deleted

Madhead

unread,
Jun 7, 2008, 7:47:47 AM6/7/08
to
Thanks for this post this fixes the problem for me. And here is the
detail in a nice easy to find place.

To list all the sites in IIS
C:\Inetpub\AdminScripts>adsutil.vbs enum /p w3svc

[/w3svc/1]
[/w3svc/922169312] <-the site that you want to secure using a
hostheader
[/w3svc/AppPools]
[/w3svc/Filters]
[/w3svc/Info]

C:\Inetpub\AdminScripts>adsutil.vbs get /w3svc/922169312/
serverbindings
serverbindings : (LIST) (1 Items)
":80:host.header.com"

C:\Inetpub\AdminScripts>adsutil.vbs get /w3svc/922169312/
securebindings
securebindings : (LIST) (1 Items)
":443:"

C:\Inetpub\AdminScripts>adsutil.vbs set /w3svc/922169312/
securebindings ":443:host.header.com"
securebindings : (LIST) ":443:host.header.com"

Again many thanks just the right solution
Andy

Ash Shah

unread,
Sep 8, 2011, 10:19:44 AM9/8/11
to
Hi all
Solved!

My Scenario:
1.WCF hosted on IIS
2.Self Assigned SSL
3.WCF Basic Profile with "TransportWithMessageCredential" i.e on top of SSL security, we wanted an additional username and password cred to be provided by the client.

Problem:
when generation from a client approval site, I was getting
https://myservername/Service.svc instead of
https://gingerhead.com/Service.svc

Solution : It all in the config file. This is my setting
=======================================================
<endpoint address=""
binding="basicHttpBinding"
contract="WcfService.IService"
bindingConfiguration="My_basicHttpBinding" />

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

=========================================================
<serviceMetadata
httpGetEnabled="false"
httpsGetEnabled="true"
httpsGetUrl="https://gingerhead.com/Service.svc/wsdl"/>
=========================================================
<binding name="My_basicHttpBinding" >
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
========================================================

Enjoy...by the way incase any one was wondering..it took me four days to workout this.... long time huh....so if you are spending a long time with this don't worry!!!!
>> On Thursday, March 13, 2008 6:09 PM Tiago Halm wrote:

>> If hosting in IIS, just set the hostheader of the website to the public
>> hostname. The generated WSDL/XSDs will contain the hostname with which it
>> was accessed.
>>
>> Tiago Halm


>>> On Saturday, March 15, 2008 11:51 AM rbekerejia wrote:

>>> Have the same problem, the only solution I found for now is to replace
>>> the server name with the domain name in the wsdl and xsd files!


>>>>> On Thursday, May 01, 2008 11:50 PM kkao77 wrote:

>>>>> can you show me in more detail? I have same problem where on the page
>>>>> it's https://service.premilance.com/Company.svc, but the svcutil tells
>>>>> me to get it from https://pserver1/Company.svc?wsdl which is
>>>>> incorrect.. I have no clue how to fix it and i'm struggling for two
>>>>> days already :(
>>>>>
>>>>>
>>>>> On Mar 13, 3:09 pm, "Tiago Halm" <th...@nospam.hotmail.com> wrote:


>>>>>> On Thursday, May 08, 2008 7:49 AM tiago.hal wrote:

>>>>>> On May 1, 7:12=A0am, kkao77 <kka...@gmail.com> wrote:
>>>>>> t
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Since you have a server certificate in IIS, you cannot set the host
>>>>>> header name via the UI, so IIRC you need to use adsutil.vbs for that.
>>>>>> Its useful to read this blog and view the webcast on setting Host
>>>>>> Headers with SSL in IIS 6.0.
>>>>>> http://agramont.net/blogs/conrad/archive/2006/06/26/21.aspx
>>>>>>
>>>>>> Tiago Halm


>>>>>>> On Sunday, June 08, 2008 3:51 AM Madhead wrote:

>>>>>>> Thanks for this post this fixes the problem for me. And here is the
>>>>>>> detail in a nice easy to find place.
>>>>>>>
>>>>>>> To list all the sites in IIS
>>>>>>> C:\Inetpub\AdminScripts>adsutil.vbs enum /p w3svc
>>>>>>>
>>>>>>> [/w3svc/1]
>>>>>>> [/w3svc/922169312] <-the site that you want to secure using a
>>>>>>> hostheader
>>>>>>> [/w3svc/AppPools]
>>>>>>> [/w3svc/Filters]
>>>>>>> [/w3svc/Info]
>>>>>>>
>>>>>>> C:\Inetpub\AdminScripts>adsutil.vbs get /w3svc/922169312/
>>>>>>> serverbindings
>>>>>>> serverbindings : (LIST) (1 Items)
>>>>>>> ":80:testddi.doverport.co.uk"
>>>>>>>
>>>>>>> C:\Inetpub\AdminScripts>adsutil.vbs get /w3svc/922169312/
>>>>>>> securebindings
>>>>>>> securebindings : (LIST) (1 Items)
>>>>>>> ":443:"
>>>>>>>
>>>>>>> C:\Inetpub\AdminScripts>adsutil.vbs set /w3svc/922169312/
>>>>>>> securebindings ":443:host.header.com"
>>>>>>> securebindings : (LIST) ":443:host.header.com"
>>>>>>>
>>>>>>> Again many thanks just the right solution
>>>>>>> Andy
>>>>>>>
>>>>>>>
>>>>>>> On May 6, 6:13=A0pm, tiago.h...@gmail.com wrote:
>>>>>>>
>>>>>>> c
>>>>>>> it
>>>>>>> ..
>>>>>>>
>>>>>>> nt
>>>>>>> ng
>>>>>>> he
>>>>>>> ap
>>>>>>> or
>>>>>>> y>
>>>>>>> -
>>>>>>> 06/26/21.aspx


>>>>>>>> On Sunday, June 08, 2008 3:51 AM Madhead wrote:

>>>>>>>> Thanks for this post this fixes the problem for me. And here is the
>>>>>>>> detail in a nice easy to find place.
>>>>>>>>
>>>>>>>> To list all the sites in IIS
>>>>>>>> C:\Inetpub\AdminScripts>adsutil.vbs enum /p w3svc
>>>>>>>>
>>>>>>>> [/w3svc/1]
>>>>>>>> [/w3svc/922169312] <-the site that you want to secure using a
>>>>>>>> hostheader
>>>>>>>> [/w3svc/AppPools]
>>>>>>>> [/w3svc/Filters]
>>>>>>>> [/w3svc/Info]
>>>>>>>>
>>>>>>>> C:\Inetpub\AdminScripts>adsutil.vbs get /w3svc/922169312/
>>>>>>>> serverbindings
>>>>>>>> serverbindings : (LIST) (1 Items)
>>>>>>>> ":80:host.header.com"
>>>>>>>>
>>>>>>>> C:\Inetpub\AdminScripts>adsutil.vbs get /w3svc/922169312/
>>>>>>>> securebindings
>>>>>>>> securebindings : (LIST) (1 Items)
>>>>>>>> ":443:"
>>>>>>>>
>>>>>>>> C:\Inetpub\AdminScripts>adsutil.vbs set /w3svc/922169312/
>>>>>>>> securebindings ":443:host.header.com"
>>>>>>>> securebindings : (LIST) ":443:host.header.com"
>>>>>>>>
>>>>>>>> Again many thanks just the right solution
>>>>>>>> Andy
>>>>>>>> On May 6, 6:13=A0pm, tiago.h...@gmail.com wrote:
>>>>>>>>
>>>>>>>> c
>>>>>>>> it
>>>>>>>> ..
>>>>>>>>
>>>>>>>> nt
>>>>>>>> ng
>>>>>>>> he
>>>>>>>> ap
>>>>>>>> or
>>>>>>>> y>
>>>>>>>> -
>>>>>>>> 06/26/21.aspx



Mr. Fanrastic

unread,
Jul 5, 2012, 2:11:20 PM7/5/12
to
I had a similar problem with an old asmx web service, where the hostname was taking the place of the domain name. Despite having the correct configuration in IIS (correct IP, correct host header, correct SSL config), it would always give the hostname in place of the domain name. In this case we were also using a separate App Pool that ran under a custom identity, but I don't know if that had any bearing on the issue. The environment was Windows 2003 Server with IIS 6.0.

Finally, I deleted the website in IIS and recreated it with the same settings, and then it worked! No idea why I had to go that far, but it's another solution for people to try.
0 new messages