Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear instuction WebServiceHost / Self Host #201

Open
jtlimson opened this issue Mar 12, 2020 · 3 comments
Open

Unclear instuction WebServiceHost / Self Host #201

jtlimson opened this issue Mar 12, 2020 · 3 comments

Comments

@jtlimson
Copy link

jtlimson commented Mar 12, 2020

Not an issue but a clarification.

How do you implement self-hosted exactly?

Add an endpoint to your App.config file.

is this in a new file called App.config? I notice that fresh WCF project doesn't have App.config

<services>
  <service name="SwaggerWcf.SwaggerWcfEndpoint">
    <endpoint address="http://localhost/docs" binding="webHttpBinding" contract="SwaggerWcf.ISwaggerWcfEndpoint" />
  </service>
</services>

And create a WebServiceHost

Create a WebServiceHost

var swaggerHost = new WebServiceHost(typeof(SwaggerWcfEndpoint));
swaggerHost.Open();

where do you put this line above?

@justin0522
Copy link
Contributor

there is a sample project
./src/SwaggerWcf.Test.Service

@jtlimson
Copy link
Author

jtlimson commented Mar 16, 2020

there is a sample project
./src/SwaggerWcf.Test.Service

Thank you Justin. I already checked and tried the sample project before posting this. but I don't think Self Hosted was implemented on it.

Also in the test project. The core wcf gives error something like.

does not have a Binding with the None MessageVersion.  'System.ServiceModel.Description.WebHttpBehavior' is only intended for use with WebHttpBinding or similar bindings.

I'm not sure if that's a normal behavior.

The api-docs works as expected in swagger though.

@justin0522
Copy link
Contributor

I submitted a sample project, I hope this will help you.
https://github.com/justin0522/swaggerwcf_issues_201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants