I'm trying to use https://github.com/abelsilva/swaggerwcf
But having issues using it with our WCF methods
An example is something like this:
public ETemplate GetETemplate(int eTemplateId)
We exposed the svc via a webHttpBinding with enableWebScript set in the behavior
When we normally use REST to access it from jQuery we would use this in the Post
{"eTemplateId": "26000"}
But from the example data generated from SwaggerWcf we are getting simply an integer passed in the POST like this
26000
Below is how I've decorated the method on the Interface, i think this is correct because the WebMessageBodyStyle is correctly set to Wrapped and not Bare.
Am I missing something simple?
[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped, Method = "POST",
RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Could you please give more information about your issue. Something seems off. I don't think the Request Format will create errors in swagger implementation. Try to download the project swaggerator. https://github.com/superstator/Swaggeratr That's the initial version of SwaggerWCF were the branch converts in SwaggerWCF. You will find them some useful examples of the initial integration. Generally speaking it won't change much.
In Swaggerator you will find definitions like this one for post methods.
Try to check that example implementation and please post more details about the issue you have. Otherwise, it is complicated to give more help.
I just create a fork. Because, I found some issues in the deploy. https://github.com/gabrielacosta/swaggerwcf If you download that branch. The code is working and maybe it can give a better perspective.