Below, are the bullet points I needed to do in order for it to work.
First of all, I want to thank Rajesh for pointing me in the right direction as far as IEnumberable vs List in a WCF method.
The error message I was receiving did not point me in the right direction. It was basically a "catch all" type of message. In addion, I had tracing set up on my service, but the trace logs wee never written to the production hosting service because it is
a shared server --- they simply don't allow a trace log to be generated on a shared server.If this trace log was generated, I'm sure I would have been able to ascertain the problem much sooner.
I still don't know why I can return an IEnumerable object via my local web server either through Cassini or IIS as opposed to not being able to do it in a production environment--- at least with the environment with my web hosting service.
Below code works fine on local machine with Cassini & Local IIS, butnot
in production environment
Below code works fine on local machine with Cassini, Local IIS, and production environment. Note the additon of using aList object. For whatever reason, it appears that WCF does not know what to do with an IEnumerable object in order to pass it back to the client. Still don't know why it worked on my local machine...
In order for my client to function correctly for my View, I still needed to use an IEnumerable object which functions just fine when received back from the above code.
Client Controller Code
IEnumerable categoryList = db.GetCategories();
That all basically takes care of the coding aspect of it. Trying to get the security aspect of it to function was another hurdle. After doing much research and knowing that I can't even appear to get into the web service with the error I was receivng, I had to make the following code additions in my Controller method because it is now known that my hosting service needed security tokens passed into the web service.
Below, are the bullet points I needed to do in order for it to work.
First of all, I want to thank Rajesh for pointing me in the right direction as far as IEnumberable vs List in a WCF method.
The error message I was receiving did not point me in the right direction. It was basically a "catch all" type of message. In addion, I had tracing set up on my service, but the trace logs wee never written to the production hosting service because it is a shared server --- they simply don't allow a trace log to be generated on a shared server.If this trace log was generated, I'm sure I would have been able to ascertain the problem much sooner.
I still don't know why I can return an IEnumerable object via my local web server either through Cassini or IIS as opposed to not being able to do it in a production environment--- at least with the environment with my web hosting service.
Below code works fine on local machine with Cassini & Local IIS, butnot in production environment
Below code works fine on local machine with Cassini, Local IIS, and production environment. Note the additon of using aList object. For whatever reason, it appears that WCF does not know what to do with an IEnumerable object in order to pass it back to the client. Still don't know why it worked on my local machine...
In order for my client to function correctly for my View, I still needed to use an IEnumerable object which functions just fine when received back from the above code.
That all basically takes care of the coding aspect of it. Trying to get the security aspect of it to function was another hurdle. After doing much research and knowing that I can't even appear to get into the web service with the error I was receivng, I had to make the following code additions in my Controller method because it is now known that my hosting service needed security tokens passed into the web service.
I hope this will seriously help all those poor souls out there from suffering the pain I had to go through in order to find the solution. It's a shame that when the original error came out, that Microsoft does not have a thread out there on the web to change
an IEnumberable to a List.
They should also have concrete examples of using the different permutations of the binding node in conjunction with specific hosting environments along with any code that needs to be used with these permutations.
Thanks,
Bill Yeager
MCP.Net, BCIP
Marked as answer by peter pi - msft on Mar 05, 2012 07:44 AM
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 11, 2012 02:58 PM|LINK
Finally got it to work....
Below, are the bullet points I needed to do in order for it to work.
Below code works fine on local machine with Cassini & Local IIS, butnot in production environment
Below code works fine on local machine with Cassini, Local IIS, and production environment. Note the additon of using aList object. For whatever reason, it appears that WCF does not know what to do with an IEnumerable object in order to pass it back to the client. Still don't know why it worked on my local machine...
Interface code
In order for my client to function correctly for my View, I still needed to use an IEnumerable object which functions just fine when received back from the above code.
Client Controller Code
That all basically takes care of the coding aspect of it. Trying to get the security aspect of it to function was another hurdle. After doing much research and knowing that I can't even appear to get into the web service with the error I was receivng, I had to make the following code additions in my Controller method because it is now known that my hosting service needed security tokens passed into the web service.
Config security node
Finally got it to work....
Below, are the bullet points I needed to do in order for it to work.
Below code works fine on local machine with Cassini & Local IIS, butnot in production environment
Below code works fine on local machine with Cassini, Local IIS, and production environment. Note the additon of using aList object. For whatever reason, it appears that WCF does not know what to do with an IEnumerable object in order to pass it back to the client. Still don't know why it worked on my local machine...
Interface code
In order for my client to function correctly for my View, I still needed to use an IEnumerable object which functions just fine when received back from the above code.
Client Controller Code
That all basically takes care of the coding aspect of it. Trying to get the security aspect of it to function was another hurdle. After doing much research and knowing that I can't even appear to get into the web service with the error I was receivng, I had to make the following code additions in my Controller method because it is now known that my hosting service needed security tokens passed into the web service.
Config security node
I hope this will seriously help all those poor souls out there from suffering the pain I had to go through in order to find the solution. It's a shame that when the original error came out, that Microsoft does not have a thread out there on the web to change an IEnumberable to a List.
They should also have concrete examples of using the different permutations of the binding node in conjunction with specific hosting environments along with any code that needs to be used with these permutations.
Bill Yeager
MCP.Net, BCIP