Perfil de Santosh KumarSantosh Kumar Paruvella'...BlogListasLibro de visitasMás ![]() | Ayuda |
|
|
04 junio Dynamics Ax in Outlook Part – IIIThis example is continuation of my previous blog entries of Dynamics Ax in Outlook Part – I and II. Ø In this example I am going to illustrate, how to displaying the Customer creation form with in Outlook. As in Outlook – Inbox is displayed.
Ø It’s not like a separate form, which I had shown in Dynamics Ax in Outlook Part – I blog entry. In that one, the Form is displayed as a separate object as per the standard options menu click events of Outlook.
Ø Here in this example the Customer creation form will be displayed as Inbox. i.e. within Outlook.
Development steps:
Ø Find the initial development steps which are there in this blog entry http://paruvella.spaces.live.com/blog/cns!F2EC589E221A4DB0!193.entry, till 5th steps are same for this application also. [Named the project as DynamicsAxCustomer – OutlookFolder]
Ø After completion of the first 5 steps Add Customer Service as a Service reference, to this project.
Ø Instead of .Net Windows Form, developed the User control, with similar appearance to the Form of the above blog entry.
Ø User control named as Customer.cs. Provide some GUID (e.g.74b7d27f-6cd3-4745-9ff5-ca5767c69723) for this user control.
Ø The Customer user control, registering as a Com Interop object with the registry. Using that GUID, the control will be registered in the registry.
Ø For registering this control, used an OutlookUtility.dll, this dll is developed by creating a new project called OutlookUtility. This OutlookUtility class library is developed by referring the Microsoft MSDN office integration articles. (Complete solution is attached with this article).
Ø That com object embedding in the html file and that same html file is attached to the newly created folder in MS –Outlook –Inbox, named as Customer Creation.
Ø The html file will be saved with GUID which mentioned in User Control (Customer.cs) Source code of the HTML File:
<html><body rightmargin = '0' leftmargin ='0' topmargin ='0' bottommargin = '0'> <object classid='clsid:74b7d27f-6cd3-4745-9ff5-ca5767c69723' ID='Customer' VIEWASTEXT width='100%' height='100%'/> </body></html> The newly created folder and user control which is embedded in html file can be viewed in Outlook the following figure. Ø Find the complete project for this example under the following link. Note: This same project can also use for previous articles, Dynamics Ax in Outlook. 01 junio Dynamics Ax –AIF –Web Services –Service end point error
Error: Could not find default endpoint element that references contract 'CustomerService.CustomerService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
I had come across this error, while accessing the Dynamics Ax – AIF – Customer service from .Net windows user control. Work around, to solve the above error: Reference from #MSDN
using System.ServiceModel;
//Configures the security settings of a basicHttpBinding binding. System.ServiceModel.BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly); binding.Name = "BasicHttpBinding_CustomerService"; binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard; binding.Security.Mode = BasicHttpSecurityMode.Message;
BasicHttpSecurity mySecurity = binding.Security; mySecurity.Transport.ClientCredentialType = HttpClientCredentialType.Windows; mySecurity.Mode = BasicHttpSecurityMode.TransportCredentialOnly; mySecurity.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
HttpTransportSecurity transSec = mySecurity.Transport;
EndpointAddress endpointAddress = new EndpointAddress("http://ban-srv-ax.digimakerbengaluru.com/MicrosoftDynamicsAXAif50/customerservice.svc");
//Calling the Ax Service by passing the Binding and endPoint Address object, becuase, while calling this //web service from user control we are not able to find the endpoint address of the service. //i.e. It's not able to read out the exact endpoint address from config file. CustomerServiceClient myCustomerService = new CustomerServiceClient(binding, endpointAddress);
EntityKey[] custAcc = myCustomerService.create(cust); MessageBox.Show("Created the customer and CustomerId is:" + custAcc[0].KeyData[0].Value, "Customer");
This is work around. In case we are able to access the CustomerService from IIS, but we are not able to create the proxy object for accessing the service in C# project. |
|
|