Not able to access cloud service from MVC 4 application
-
Friday, June 15, 2012 7:00 PM
I have a wcf cloud service with web role and published in cloud. I am able to browse this service from my local machine. This service internally send the message to azure service bus queue.
Now i created one MVC 4 application which is consuming this service and sending the data. But while sending the data to cloud service i get the error Access Denied. I am not sure what is the problem here. Please help.
When the same service is hosted locally i am able to publish data to service bus queue through the service.
Regards,
Sanjay
All Replies
-
Sunday, June 17, 2012 2:46 PMModerator
Hi,
First please share detail message of that exception, include trace message, stack. I believe they can help us fix your problem.
You mentioned that the WCF service can send message to ServiceBus queue, but if the MVC 4 application consume the WCF service get "Access denied" error, right? And does they in the same machine? is there any authentication when connect to WCF service? for example, transport or message (certificate, username/password, etc)
Here your can find some samples about ServiceBus queue:
http://servicebus.codeplex.com/
Hope this helps.
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
-
Sunday, June 17, 2012 5:41 PM
Hi,
When i publish the WCF service locally, it is able to send the message to service bus queue but when i publish the service at azure, i am not able to send the message to queue. In this case i consumed the cloud service in MVC 4 application(hosted at same cloud) and got the Access Denied error(Complete Error with stack trace is attached). I have not implemented any authentication. Please let me know if i need to change anything and try.
Here is the error:
{"The one-way operation returned a fault message. The reason for the fault was 'Access is denied.'."}
and the stack trace:
Server stack trace:
at System.ServiceModel.Dispatcher.RequestChannelBinder.ValidateNullReply(Message message)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Send(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at IService1.EmployeeDetails(EmployeeData employeeData)
at Service1Client.EmployeeDetails(EmployeeData employeeData) in C:\Users\Sanjay\Documents\Visual Studio 2010\Projects\EmployeeDetailsApp\EmployeeDetailsApp\Service1.cs:line 384
at EmployeeDetailsApp.Controllers.AccountController.Register(RegisterModel model) in C:\Users\Sanjay\Documents\Visual Studio 2010\Projects\EmployeeDetailsApp\EmployeeDetailsApp\Controllers\AccountController.cs:line 126
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()Regards,
Sanjay
-
Monday, June 18, 2012 6:16 AMModerator
Hi,
Are you sure the application running on the cloud is the same with local? Does the cloud app's service url is right? For example, local service endpoint is http://localhost:XXX/Service1.svc, in cloud app, service endpoint is http://yourname.cloudapp.net:XXX/Service1.svc.
If everything is OK but still get this error, would you like to use RDP to connect Azure VM and write a Console application to connect ServiceBus queue to see if works.
Hope this helps.
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
- Marked As Answer by Arwind - MSFTModerator Thursday, June 21, 2012 5:05 AM

