.NET Framework Bookmark and Share   
 index > Windows Communication Foundation > calling WCf service after replacing localhost with ip address
 

calling WCf service after replacing localhost with ip address

Hello,

Please help me on this issue,

I have created a WCF server and trying to use this in C# asp .net website available on same machine using Add service reference.

However in SCF service we.config It has default endpoint address with 'localhost'. I just want to replace this with IP address of machine so that client app from diff machine can also call this service.

Here is my Webservice config file..

------------------------------------------------------

<system.serviceModel>



<services>
<service behaviorConfiguration="PriceServer.Service1Behavior"
name="PriceServer.PriceService">
<endpoint address="http://localhost:50161/PriceService.svc" behaviorConfiguration=""
binding="mexHttpBinding" bindingConfiguration="" contract="PriceServer.IPriceService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
</service>
</services>
<behaviors>

<serviceBehaviors>

<behavior name="PriceServer.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>


</behavior>
</serviceBehaviors>


<!-- Adding to enable the calling from client side-->

<endpointBehaviors>
<behavior name="ServiceAspNetAjaxBehavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
</behaviors>

<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<!-- Adding to enable the calling from client side-->

<!-- </behaviors>-->

</system.serviceModel>

thanks
  • Moved byJohn SaundersMVPThursday, September 17, 2009 3:13 PMwcf q (From:ASMX Web Services and XML Serialization)
  •  
SamG301
Hi,

Yes, actually if you are domain user, this section will be automatically replace by yourmachinenamewhen a client try to consume the service, I tried it.

I am using iis7.0. for hosting. However you still can configure your machine ip address to your endpoint straight away.

Thanks
Binze
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Bin-ze Zhao

Hi,
You can replace the localhots directly with IP address.
The configration is same as publish a website.
if you have applyed a domain name ,i.e :www.wcftest.com.
you also can bind it directly with your server.

Regards


Frank Xu Lei--谦卑若愚,好学若?
专注?NET平台下分布式应用系统开发和企业应用系统集成
Focus on Distributed Applications Development and EAI based on .NET
欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
Frank Xu Lei
Hi,

Yes, actually if you are domain user, this section will be automatically replace by yourmachinenamewhen a client try to consume the service, I tried it.

I am using iis7.0. for hosting. However you still can configure your machine ip address to your endpoint straight away.

Thanks
Binze
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Bin-ze Zhao

Hi,
You can replace the localhots directly with IP address.
The configration is same as publish a website.
if you have applyed a domain name ,i.e :www.wcftest.com.
you also can bind it directly with your server.

Regards


Frank Xu Lei--谦卑若愚,好学若?
专注?NET平台下分布式应用系统开发和企业应用系统集成
Focus on Distributed Applications Development and EAI based on .NET
欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
Frank Xu Lei

You can use google to search for other answers

Custom Search

More Threads

• WCF & database on same server?
• does not support .Net Framing
• Chunking channel with WS reliable sessions
• Getting 401.1 Error Accessing XSDs Using Custom Service Account
• How to specify shared secret for SymmetricSecurityBindingElement
• Custom Username and Password Authentication in transport level WCF 3.5
• Help with config files
• WCF Source Available Now
• WCF SSL works in one network but not the other?
• WCF serialization architecture question, not creating multiple instances of existing business objects