Avatar of Marc Davis
Marc Davis
Flag 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:

        [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:

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

Open in new window

I am getting this:
Results of test
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.

Avatar of undefined
Last Comment
Marc Davis

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
David Johnson, CD

Personally I use postman as referenced by käµfm³d 👽
Marc Davis

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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Marc Davis

Actually, I just tried SOAPUI. Works as expected with what I am working with right now! Thanks!
Marc Davis

Thank you both for the time and attention. Very, very much appreciated.