tag:blogger.com,1999:blog-5472436831307966815.post8974314382231995305..comments2024-03-20T00:30:07.883-06:00Comments on Daniel Cai's Blog: Config-less WCF Service Endpoint Binding for CRM 2011 On-PremiseDaniel Caihttp://www.blogger.com/profile/05461949321689249420noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-5472436831307966815.post-5853477942786182015-03-13T06:29:10.706-06:002015-03-13T06:29:10.706-06:00I understand well about configuring my endpoint bi...I understand well about configuring my endpoint bindings in code and all. I have an issue now, where I referenced a WCF service into my Custom Workflow activity. All is well until I deploy the workflow and try to run in from CRM. I get the following error ----Type 'Microsoft.Crm.Extensibility.InprocessServiceProxy' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.--- Any ideas?, it seems to not be able to serialize the objects properly. I have looked everywhere on the web but no luck at all.Anonymoushttps://www.blogger.com/profile/11578831923815463035noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-78546547236078817252012-05-17T08:00:10.101-06:002012-05-17T08:00:10.101-06:00@shag, I haven't done the same so I am not sur...@shag, I haven't done the same so I am not sure what the exact problem is. I suspect that there is infrastructure limitation with Azure Worker role, which probably prohibits service calls to external network (from Azure point of view, your on-premise CRM is an external application to them). You can possibly ask in an Azure forum to see if this is a known issue. <br /><br />Again, I don't have an environment to verify this, so the information may not help. I would apologize if that's the case.Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-20627129568638718712012-05-17T07:52:21.261-06:002012-05-17T07:52:21.261-06:00Hey Daniel,
I have checked my CRM 2011 on-premise...Hey Daniel,<br /><br />I have checked my CRM 2011 on-premise is working properly..even if i will put the CRM crud operation code in web role of azure,it works fine but when i tried the same in worker role.It throws the above error..Shekharhttps://www.blogger.com/profile/05899798149265545268noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-44561758065728505942012-05-17T07:20:58.475-06:002012-05-17T07:20:58.475-06:00@shag, it is most likely that your CRM application...@shag, it is most likely that your CRM application is not accessible from external network. You can try to access your on-premise CRM from public network to see if it is actually accessible.Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-39426761031766024512012-05-17T05:39:44.819-06:002012-05-17T05:39:44.819-06:00Hi Daniel,
i have developed one .net application ...Hi Daniel,<br /><br />i have developed one .net application which i was already hosted on windows azure.this application performs Create,Delete,Read,Update operation with CRM 2011 online.It is working perfect, but from the same application when i tried to connect to CRM 2011 on-premise.It throws an error like "Metadata contains a reference that cannot be resolved: ".please help meShekharhttps://www.blogger.com/profile/05899798149265545268noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-16720456758831474782012-02-14T02:46:57.124-07:002012-02-14T02:46:57.124-07:00Hi Daniel,
Thanks for the suggestion, I will do t...Hi Daniel,<br /><br />Thanks for the suggestion, I will do that.Mihai Osvathttps://www.blogger.com/profile/12246062424743963761noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-21089884254643958622012-02-13T11:23:06.343-07:002012-02-13T11:23:06.343-07:00@Mihai, one simple solution to get around this iss...@Mihai, one simple solution to get around this issue is to not reuse the service proxy object, instead you instantiate a new one every time you make the service call. It adds some small overhead, but it should be OK. The instantiation process should probably include the device credential as well.Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-48014842788425854112012-02-13T02:25:52.475-07:002012-02-13T02:25:52.475-07:00Hi Daniel, thanks for the suggestion, but could yo...Hi Daniel, thanks for the suggestion, but could you please exemplify ? <br /><br />I'm simply creating a new OrganizationServiceProxy(organizationUri, homeRealm, creds, devCreds) (with parameters read from the web.config), after that, the OrganizationService, OrganizationServiceContext, where should I add this ticket token ?<br /><br />Thank you.Mihai Osvathttps://www.blogger.com/profile/12246062424743963761noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-70446951907511978302012-02-12T08:53:16.947-07:002012-02-12T08:53:16.947-07:00@Mihai, for CRM Onine, there is a ticket token inv...@Mihai, for CRM Onine, there is a ticket token involved, which expires every few hours. <br /><br />BTW, your problem doesn't seem to be related to this post. ;-)Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-13554935402626681112012-02-12T08:46:33.986-07:002012-02-12T08:46:33.986-07:00Hi Daniel,
Not sure if my problem is related to b...Hi Daniel,<br /><br />Not sure if my problem is related to binding (although it seems so...)<br /><br />I have an Umbraco website, stored on Windows Azure, which connects to a CRM 2011 Online, for membership authentication. In the web.config of Umbraco, I just store the url of the CRM organization, username and password (also the device id). Everything seemed to work fine, but after a while, I got errors like:<br /><br />"MessageSecurityException <br />Exception message: An unsecured or incorrectly secured fault was received from the other party. <br /><br />Server stack trace: <br /> at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)<br /> at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)<br /> at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)<br /> at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)<br /> at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)<br /><br />If I restart the IIS on Windows Azure (by RDC), everything works ok for a while ...Mihai Osvathttps://www.blogger.com/profile/12246062424743963761noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-35937347879502503292012-02-02T10:40:51.244-07:002012-02-02T10:40:51.244-07:00@rudgr, I added a bit more code to the second snip...@rudgr, I added a bit more code to the second snippet, so that you can specify login credentials for the organization service. Not sure if that's the cause of your problem.Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-82247338719264980322012-02-01T18:05:55.885-07:002012-02-01T18:05:55.885-07:00Hi rudgr, I am not sure about the cause of the exc...Hi rudgr, I am not sure about the cause of the exception. To verify my code, I have just tried another time, and it has worked for me. By any chance, you have configured IFD on your CRM server? The code snippet won't work for IFD, which I mentioned in the post. Not sure if that's the case.Daniel Caihttps://www.blogger.com/profile/05461949321689249420noreply@blogger.comtag:blogger.com,1999:blog-5472436831307966815.post-58467759959883128452012-02-01T04:56:57.484-07:002012-02-01T04:56:57.484-07:00Thanks for the great post, I tried your code, but ...Thanks for the great post, I tried your code, but keep getting the exception below?<br /><br />Security Support Provider Interface (SSPI) authentication failed. The server may not be running in an account with identity 'host/dotcrm'. If the server is running in a service account (Network Service for example), specify the account's ServicePrincipalName as the identity in the EndpointAddress for the server. If the server is running in a user account, specify the account's UserPrincipalName as the identity in the EndpointAddress for the server.rudgrhttps://www.blogger.com/profile/13926970938791565710noreply@blogger.com