Thursday, October 28, 2010

Webfarm and Servername

If your WCf service is hosted with a commercial hosting provider which may or many not be using a web farm, you may find that when you browse to your service that it shows a different address for the svcutil.exe than the dns address and when you download the wsdl/svcutil that this wsdl/svcutil is referencing the internal server name instead of your domain name.

For example, if you purchased a domain name called aliayman.com and your hosting company is storing and hosting your files on an internal server called HostingCompanyServer01. Now let's imagine you created a web service called MyService.svc.

Now when you browse to http://aliayman.com/MyService.svc

you will see your service information but you will notice the line that contain the svcutil.exe is telling you to get the wsdl from

svcutil.exe http://HostingCompanyServer01/Myservice.svc

this is a problem because you can not access this server name, you can access aliayman.com but you can not access this specific host name.

Also, when you try to reference this service in your code you will find that your reference is pointing to HostingCompanyServer01 instead of aliayman.com

You have to solutions to this problem.

Solution 1: after you create the reference search your code for HostingCompanyServer01 and change it to aliayman.com and at least your program will be able to deal with the web service. You will find HostingCompanyServer01 in *.wsdl and *.svcinfo files.

Solution 2: which is the best solution is to change the binding of the IIS installed on HostingCompanyServer01. This is off course if you have access to this IIS. to view the binding find your site identifier number (let's assume it is 1) and issue these commands to view your binding. (notice your site identifier 1 is used before ServerBinding and SecureBinding below)

cscript.exe //nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs get W3SVC/1/ServerBindings

cscript.exe //nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs get W3SVC/1/SecureBindings

then issue these commands to correct the binding

cscript.exe //nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs set W3SVC/1/ServerBindings "80:aliayman.com"

cscript.exe //nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs set W3SVC/1/SecureBindings "443:aliayman.com"

Then restart your application pool

I found these advices about the binding in this blog post

12 comments:

Anonymous said...

Oh my goodness! Amazing article dude! Thanks, However I am going through problems with your RSS.

I don't know why I can't join it. Is there anybody else
having similar RSS problems? Anyone that knows the solution
will you kindly respond? Thanks!!

My web blog ... http://danon-jewellery.livejournal.com

Anonymous said...

Please let me know if you're looking for a writer for your weblog. You have some really great articles and I believe I would be a good asset. If you ever want to take some of the load off, I'd love to write some content for your blog in exchange for a link back
to mine. Please blast me an e-mail if interested.
Regards!

my web-site - xerox 8560 part numbers

Anonymous said...

hi there my label tong in khmer(cambodia) digital and circuit are my favor but i can
not make it that now it so wish to attempt as well,
might some one inform me the best ways to make PCB .
.. ple send out image and information of them to my email,
thanks ...

Visit my homepage :: galilee.ezpt.kr

Anonymous said...

Hi to all,
Thanks to HP, that I rejoice to inform that I download
Hp Laser Airplane 1018 vehicle drivers to my system works, perfectly.
Formerly I had an issue that it wont print everything.
now it will be handled though HP vehicle drivers.

My webpage - xerox phaser 8560 yellow ink

Anonymous said...

Oh my goodness! Amazing article dude! Thank you so much, However I am having problems with your RSS.

I don't understand the reason why I am unable to subscribe to it. Is there anybody getting identical RSS problems? Anyone that knows the answer can you kindly respond? Thanks!!

Here is my web blog :: xerox 8560mfp\/d

Anonymous said...

Outstanding. This acquired my Lexmark e210 working. It is constantly an obstacle in
Home windows to get this printer working, this is the 3rd motorist I have actually had to utilize over times.


Here is my web site ... xerox phaser 8560

Anonymous said...

you are so hot.

Look into my blog post :: xerox phaser 8560dn

Anonymous said...

Hello, the whole thing is going nicely here and ofcourse every one is sharing data, that's genuinely excellent, keep up writing.

Feel free to surf to my web site; best web host (www.ukbesthosting.info)

Anonymous said...

Hey there! This is my 1st comment here so I just wanted to
give a quick shout out and tell you I really enjoy reading your articles.
Can you suggest any other blogs/websites/forums that go over the same subjects?

Thanks a lot!

my site - LG 42LS5600 LED TV

Anonymous said...

Thanks for the nice tips. It will definitely let me
and i'm in a very steps involved in building my website.

Feel free to visit my web blog ... danon jewellery uk

Anonymous said...

Hello there,
I am planning to publish brochures in
colour and was wondering how it would certainly be for 200.

I am a bit puzzled with the frame over,
a good friend of mine send it to me and I was speculating if you
wish deliver me more information on copy costs and all that you do.

Sev.

Visit my website: xerox phaser 8560 solid ink

Anonymous said...

e cigarette health, e cig, smokeless cigarettes, electronic cigarettes, electronic cigarette reviews, e cigarette