locked
wsHTTPBinding: Returning boolean makes parameters null RRS feed

  • Question

  • User2043281626 posted

    Hello,

    I created a sample WCF service and I have a method defined on my service contract that takes 2 parameters; both strings and returns a boolean. During testing I found that both parameters are null and this seems to be because I am returning a boolean value on the method. I also noticed that during compilation I get the following warning message; "The parameter to the compiler is invalid". This message occurs twice and I am assuming its in reference to the paramaters not being valid because of my return type. If I remove the return type; boolean, and don't return anything the values are not null. Is there some way I can work around this issue? I need to be able to return a flag, such as as a boolean; true or false, for this method. Is this in some way related to "One-Way" operations?

    Any help will be greatly appreciated!

    Tuesday, July 16, 2013 9:25 AM

Answers

  • User2043281626 posted

    I figured out the issue. It was the character '\' that I was passing in the parameters. Removing this character allowed for the parameters not to be null. I guess '\' couldn't be deserialized and that was causing the issue. The reason I had '\' in there in the first place is because one of the parameters was "domain + '\' + username".

    Thank you for the help though.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 17, 2013 8:58 AM

All replies

  • User-488622176 posted

    I doubt this has anything to do with your code, but more with the command line options passed to the compiler. Can you post your code just to make sure?

    Did you try to create a new project in vs.net and copy the class to that project?

    Wednesday, July 17, 2013 7:31 AM
  • User2043281626 posted

    I figured out the issue. It was the character '\' that I was passing in the parameters. Removing this character allowed for the parameters not to be null. I guess '\' couldn't be deserialized and that was causing the issue. The reason I had '\' in there in the first place is because one of the parameters was "domain + '\' + username".

    Thank you for the help though.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 17, 2013 8:58 AM