rami
11/16/2015 2:44:07 AM
Hi.
How can an Open RIA Domain Service be hosted without IIS?
I tried to do the following:
01.
public
class
SelfHostedDomainService : DomainServiceHost
02.
{
04.
05.
private
static
readonly
Uri BaseAddressUri =
new
Uri(DomainServiceBaseAddress);
06.
07.
public
SelfHostedDomainService()
08.
:
base
(
typeof
(ApplicationDomainService), BaseAddressUri)
09.
{
10.
// add the service endpoints
11.
this
.Description.Behaviors.RemoveAll<AspNetCompatibilityRequirementsAttribute>();
12.
this
.Description.Behaviors.OfType<ServiceMetadataBehavior>().First().HttpGetEnabled =
true
;
13.
14.
var svcDescription = DomainServiceDescription.GetDescription(
typeof
(ApplicationDomainService));
15.
var endpoints =
new
SoapXmlEndpointFactory().CreateEndpoints(svcDescription,
this
);
16.
17.
this
.Description.Endpoints.Clear();
18.
19.
foreach
(var endpoint
in
endpoints)
20.
{
21.
this
.Description.Endpoints.Add(endpoint);
22.
}
23.
}
24.
}
Test code:
using
(
new
SelfHostedDomainService())
{
while
(
true
)
{
Thread.Sleep(1000);
}
}
And then trying to access https://localhost/Application/Application-RIAServices-Web-ApplicationDomainService.svc?SingleWsdl produces a 400 error (bad request)
Thank you.
This content has not been rated yet.
15
Reputation
1
Total posts