Link to home
Start Free TrialLog in
Avatar of Marc Davis
Marc DavisFlag for United States of America

asked on

WCF REST Service with POST

I am attempting to resolve an issue WCF Rest Service and I am able to step through debug in one way:

I am able to step-through by calling on the URL specifying the method on the URL:

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/GetMember/{strTest}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string GetMember(string strTest);

Open in new window


But what I really needed is more like an object in the RequestBody. So, I originally had:

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "/GetMember",  RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        GetTestMemberRes GetMember(GetTestMemberReq TestMemberReq);

Open in new window


I am getting this:
User generated image
And it does not even hit the breakpoint.

When I do the first operation contract I had to change the signature of the method. But when I do that and use the GET as well as update the URITemplate it works and I hit the break point but when I change it to a POST and use the object GetTestMemberReq. I get the above?

If the first one is working my config changes should be good.

I am using C#, .NET 4.0, and VS 2017.

Any information as to what I might be doing incorrectly.

Very much appreciated.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Personally I use postman as referenced by käµfm³d 👽
Avatar of Marc Davis

ASKER

käµfm³d 👽 and Daviod, ok gotchya on that. Makes sense because I was thinking there could to a crazy amount the address bar which had my shaking my head.

Ok relation to the tools. Would SOAPUI suffice to your knowledge? I'm not against Fiddler or Postman or anything like that it's just I am hamstrung on what is installed. Do not have the localadmin access nor have the ability to install anything.  It's the GPO. GPO's, serve a purpose, but the purpose and impact needs to be really managed well to not hinder.

That said, I do have SOAPUI installed...would that suffice I know it has the REST aspects in it. Or wouldn't event the F12 aspects of like Chrome work for this?
I haven't done it myself, but it looks like SoapUI supports testing REST services.

I think Postman used to not be an installer, but I know it is now. You also might be able to find a portable version.
Actually, I just tried SOAPUI. Works as expected with what I am working with right now! Thanks!
Thank you both for the time and attention. Very, very much appreciated.