Asked by:
How to pass data back to MS CRM online from Azure SB with two-way listener?

Question
-
Hi all,
I have already setup the integration between MSCRM Online 2015 and Azure using two-way listener. However, I am unable to retrieve the return string "Success" in MSCRM side, such as System Jobs. Anyone has idea? Thanks.
https://technet.microsoft.com/en-us/library/gg334438.aspx
public string Execute(RemoteExecutionContext context) { Utility.Print(context); return "Success"; }
Best Regards,
Gary
Thursday, April 2, 2015 6:53 AM
All replies
-
Even I return "Success" string from Azure, the System Job log is still empty.
Please advise. Thanks.
Thursday, April 2, 2015 8:06 AM -
Hello,
I believe the code you provided comes from the TwoWayListener project included in Dynamics CRM 2015 SDK.
The Plug-ins project also located in SampleCode\CS\Azure\Plug-ins contains a straightforward example of how the return value should be used:
string response = cloudService.Execute(new EntityReference("serviceendpoint", serviceEndpointId), context); if (!String.IsNullOrEmpty(response)) { tracingService.Trace("Response = {0}", response); }
Does your Azure aware plugin receive the response and write it using the Tracing service?
Please do not hesitate to share your plugin implementation for further investigation.
Wednesday, April 8, 2015 10:11 AM -
Hello,
I believe the code you provided comes from the TwoWayListener project included in Dynamics CRM 2015 SDK.
The Plug-ins project also located in SampleCode\CS\Azure\Plug-ins contains a straightforward example of how the return value should be used:
string response = cloudService.Execute(new EntityReference("serviceendpoint", serviceEndpointId), context); if (!String.IsNullOrEmpty(response)) { tracingService.Trace("Response = {0}", response); }
Does your Azure aware plugin receive the response and write it using the Tracing service?
Please do not hesitate to share your plugin implementation for further investigation.
Hi Thomas,
Should I need to use Azure Plug-ins instead of TwoWayListener? Is it not possible to return value to MSCRM Online using TwoWayListener?
Thursday, April 9, 2015 6:46 AM -
Hello Gary,
From my understanding, Azure integration with Microsoft Dynamics CRM works as follow:
- A registered Azure aware plugin sends the execution context to an Azure service bus
- A listener process the message as they are queued by the Azure service bus
- If the listener is a two way listener, then the listener may return a string response to the plugin
- The plugin receive the response and process it
So you need both an Azure aware plugin and a listener. The Azure aware plugin is responsible for sending the execution context and process the response. In your case, you would want the plugin to write the response using the tracing service.
I think you registered the default Azure aware plugin which only sends the execution context. You need to implement your own Azure aware plugin in order to process the response. the sample Plug-ins project located in SampleCode\CS\Azure\Plug-ins implements exactly what you want to achieve.
I hope this answer will help you.
Thursday, April 9, 2015 7:40 AM