emi_sastra
asked on
WEB SERVICE AT SILVERLIGHT PROJECT
Hi All,
I have a project that use web service.
Should I host the project to run it ?
Thank you.
I have a project that use web service.
Should I host the project to run it ?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Follow the example in code project will take care of it, No need to worry about Virtual directory in the development phase.
ASKER
I have a project that use web service and I don't have virtual directory for it.
It seems not work well.
I just want to know if I have to create a virtual directory or not to run the web service ?
It seems not work well.
I just want to know if I have to create a virtual directory or not to run the web service ?
I use to consume service in silverlight application with out VD.
check the below info to get more information
Open the file "ServiceReferences.ClientC onfig" in the silverlight application and see which URL it's pointing and check whethr the servcie is accessable
Open the "Web.config" in the Servcie application and search for the Servciehost details in config file and check whether the URL is same in both the files.
check the below info to get more information
Open the file "ServiceReferences.ClientC
Open the "Web.config" in the Servcie application and search for the Servciehost details in config file and check whether the URL is same in both the files.
ASKER
Please see below code :
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IBo nous" maxBufferSize="2147483647"
maxReceivedMessageSize="21 47483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/BonousSystem/Bonous.svc"
binding="basicHttpBinding" bindingConfiguration="Basi cHttpBindi ng_IBonous "
contract="BonousService.IB onous" name="BasicHttpBinding_IBo nous" />
</client>
</system.serviceModel>
</configuration>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IBo
maxReceivedMessageSize="21
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/BonousSystem/Bonous.svc"
binding="basicHttpBinding"
contract="BonousService.IB
</client>
</system.serviceModel>
</configuration>
Your are tryign to access the servciem which is not histed in IIS as we disabled the option in the previous thread.
If you run the Website, it will run with
http://localhost:<<portnumber>>/BonousSyst em , so append the port to the SL ServiceReferences.ClientCo nfig config file.
Similary in the Web.cong file of the webapplication change the URL with the port number.
Once done the above change and run the application.
Check the codeproject sample to fix the issue permanetly and no need to do this manually changes in future
If you run the Website, it will run with
http://localhost:<<portnumber>>/BonousSyst
Similary in the Web.cong file of the webapplication change the URL with the port number.
Once done the above change and run the application.
Check the codeproject sample to fix the issue permanetly and no need to do this manually changes in future
ASKER
What is the port number ?
ASKER
http://localhost:13616/HRAppTestPage.aspx#/Home
and
file:///D:/EMI%20NEW/APLIK ASI%20WEB/ BonousSyst em/BonousS ystem/Bono usSystem/B in/Debug/B onousSyste mTestPage. html
Why one has port and another one is not ?
Thank you.
and
file:///D:/EMI%20NEW/APLIK
Why one has port and another one is not ?
Thank you.
If we have IIS and hosted teh project in IIS, it will use the default port number to host the application, If the IIS is not installed Visual Studio have been come up with the default Web server take a look in to the MSDN for more info and when it be used
http://msdn.microsoft.com/en-us/library/58wxa9w5.aspx
In this case , we are usign the VS built in server to host the project and which use the available port instead of default port.
when you launch the application you can see an "asp" web server in you windows quick launch tab on right side corner.
to over come all this this, We need to follow the Silverlight application uses the dynamic URL build.which will be the case even in PROD. Means if the SL application doesn't go with the dynamic service url bild it will fail as the URL in the "servciereference.clientco nfig" will be pointing to the development.
If you take a look into the deployment step of SL will give more idea
http://learn.iis.net/page.aspx/262/configuring-iis-for-silverlight-applications/
http://www.codeproject.com/Articles/152778/Deploying-Silverlight-with-WCF-Services
will give understanding of the PORT and the dynamic WCF url build for SL application
http://msdn.microsoft.com/en-us/library/58wxa9w5.aspx
In this case , we are usign the VS built in server to host the project and which use the available port instead of default port.
when you launch the application you can see an "asp" web server in you windows quick launch tab on right side corner.
to over come all this this, We need to follow the Silverlight application uses the dynamic URL build.which will be the case even in PROD. Means if the SL application doesn't go with the dynamic service url bild it will fail as the URL in the "servciereference.clientco
If you take a look into the deployment step of SL will give more idea
http://learn.iis.net/page.aspx/262/configuring-iis-for-silverlight-applications/
http://www.codeproject.com/Articles/152778/Deploying-Silverlight-with-WCF-Services
will give understanding of the PORT and the dynamic WCF url build for SL application
ASKER
Ok.
In my case what should I do.
<endpoint address="http://localhost/BonousSystem/Bonous.svc"
What to change and to what ?
Thank you.
In my case what should I do.
<endpoint address="http://localhost/BonousSystem/Bonous.svc"
What to change and to what ?
Thank you.
In you previous comment, you have give the port as 13616, Just add that to the servcieend points in both the config file
<endpoint address="http://localhost:13616/BonousSystem/Bonous.svc">
<endpoint address="http://localhost:13616/BonousSystem/Bonous.svc">
ASKER
Below are the web config.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
<connectionStrings>
<add name="DB_ConnectionString" connectionString="Data Source=XXX\SQLEXPRESS;Init ial Catalog=INF_MLM;Integrated Security=True" providerName="System.Data. SqlClient" />
</connectionStrings>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFa ults="fals e" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnable d="true" />
</system.serviceModel>
</configuration>
Thank you.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
<connectionStrings>
<add name="DB_ConnectionString"
</connectionStrings>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFa
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment
</system.serviceModel>
</configuration>
Thank you.
ASKER
There is no endpoint at the web config ?
ASKER
Could it be any problem ?
ASKER
Please see below warning.
WEB-SERVICE-WARNING.PNG
WEB-SERVICE-WARNING.PNG
give Yes and try
ASKER
I am so sorry, just back again.
Thank you very much for your help.
Thank you very much for your help.
ASKER