I was working on a custom service which I needed to activate on HTTP adapter, however was constantly hitting on this error while activating the service
Error - The deployment web site was not found for port
Fix -
The solution was to remove the end slash (\) from the service uri
System Administration > Setup > AIF > Website
Before: http://localhost:85/MicrosoftDynamicsAXAif60\
After: http://localhost:85/MicrosoftDynamicsAXAif60
I followed this blog which helped me to fix the issue
http://axaptapeople.blogspot.com.au/2013/11/ax2012-aif-known-issues.html
Greetings! Welcome to my Dynamics AX 7 and related MS Technologies blog.
Total Pageviews
Search This Blog
Showing posts with label AIF. Show all posts
Showing posts with label AIF. Show all posts
Wednesday, June 24, 2015
Thursday, October 2, 2014
Troubleshoot Dynamics AX 2012 AIF Error File cannot be opened because the submitting user could not be determined
Dear Friends,
Hope you are having a great start to the weekday. I had a great relaxing weekend, No AX for couple of days :).. It's good to catch a break in between as I had been working and testing several integration scenarios using Dynamics AX 2012, CRM, Biztalk and Oracle. There's plenty of posts to come out so make sure to watch out this blog.
Few days ago, while troubleshooting Biztalk Integration with AX 2012 R3, I faced this error
Error:
b. Click to the Port that you would have created. Click ‘Deactivate’ if it is already activated.
c. For the inbound Xml location click ‘Configure’ button. A pop-up with appear with 2 options and check boxes. You need to check the first option ‘Use default owner for Administrators group:’ and then select user from the drop down list. I am assuming that this user is already added as a System Administrator users list in Dynamics AX 2012. Click Ok to save the changes.
Hope you are having a great start to the weekday. I had a great relaxing weekend, No AX for couple of days :).. It's good to catch a break in between as I had been working and testing several integration scenarios using Dynamics AX 2012, CRM, Biztalk and Oracle. There's plenty of posts to come out so make sure to watch out this blog.
Few days ago, while troubleshooting Biztalk Integration with AX 2012 R3, I faced this error
Error:
File
C:\AIFIn\{117634FA-CD67-4F58-B37E-1D92BFFAE050}.xml
cannot be read because the submitting user could not be determined. The default
owner for files created by members of the Administrators group must be set to a
specific windows user or a default file owner should be enabled and specified
in port configuration.
Solution:
Doing some Google search around this error, got me to this link from our fellow AX Blogger http://pyaarey.wordpress.com/2012/02/29/the-file-system-adapter-is-unable-to-read-the-file-fbtsdemo1aifin1-xml-error/
It helped me to solve the issue so, I'm just putting a screenshot around the post so that people can understand how to troubleshoot.
a. Navigate to System Administration => Setup => Services and Application Integration Framework => Inbound Ports.
b. Click to the Port that you would have created. Click ‘Deactivate’ if it is already activated.
c. For the inbound Xml location click ‘Configure’ button. A pop-up with appear with 2 options and check boxes. You need to check the first option ‘Use default owner for Administrators group:’ and then select user from the drop down list. I am assuming that this user is already added as a System Administrator users list in Dynamics AX 2012. Click Ok to save the changes.
Sunday, September 21, 2014
Troubleshooting AX 2012 AIF Error The server has rejected the client credentials
Hello Friends,
Thought to share a recent troubleshooting experience with AX 2012 AIF webservice when consumed through a different domain.
I wrote a Visual Studio Test application to connect to my AIF Service. From within the domain, I can consume the service without any errors. However, when my client program and services are on 2 different domains, I got this error
Error: The server has rejected the client credentials
Solution:
Just before invoking the AIF Service operations, try passing the Windows.ClientCredential through code
client.ClientCredentials.Windows.ClientCredential.Domain = "contoso";
client.ClientCredentials.Windows.ClientCredential.UserName = "Admin";
client.ClientCredentials.Windows.ClientCredential.Password = "pass@word1";
The other solution I tried was by creating a claims user as mentioned in fellow blogger Joris Gruyter's post here http://daxmusings.codecrib.com/2011/11/trusted-intermediary-in-aif-services.html
However, it didn't work in my scenario.
Thought to share a recent troubleshooting experience with AX 2012 AIF webservice when consumed through a different domain.
I wrote a Visual Studio Test application to connect to my AIF Service. From within the domain, I can consume the service without any errors. However, when my client program and services are on 2 different domains, I got this error
Error: The server has rejected the client credentials
Solution:
Just before invoking the AIF Service operations, try passing the Windows.ClientCredential through code
client.ClientCredentials.Windows.ClientCredential.Domain = "contoso";
client.ClientCredentials.Windows.ClientCredential.UserName = "Admin";
client.ClientCredentials.Windows.ClientCredential.Password = "pass@word1";
The other solution I tried was by creating a claims user as mentioned in fellow blogger Joris Gruyter's post here http://daxmusings.codecrib.com/2011/11/trusted-intermediary-in-aif-services.html
However, it didn't work in my scenario.
Thursday, September 19, 2013
AIF Tip - Troubleshooting custom Dynamics AX 2012 AIF Services
Greetings Friends!
It's been a while since I have posted. Have been very busy with work. Thought to do a quick post on how important is to Generate CIL in AX 2012 which I tend to forget often as this was not required in the previous versions of AX!
Scenario
1. Create a new AIF Service
2. Generate and Deploy it
3. Consume .net code
4. Make modifications to the AIF Service
5. Update the AIF Service
.Net code still cant understand the modifications made to AXDClass e.g. updatenow method, hence the old logic is still used the new logic implemented in updateNow method never gets invoked.
Solution
Run Generate Icremental/Full CIL from System Administration > Periodic > Compile into .Net Framework CIL
It's been a while since I have posted. Have been very busy with work. Thought to do a quick post on how important is to Generate CIL in AX 2012 which I tend to forget often as this was not required in the previous versions of AX!
Scenario
1. Create a new AIF Service
2. Generate and Deploy it
3. Consume .net code
4. Make modifications to the AIF Service
5. Update the AIF Service
.Net code still cant understand the modifications made to AXDClass e.g. updatenow method, hence the old logic is still used the new logic implemented in updateNow method never gets invoked.
Solution
Run Generate Icremental/Full CIL from System Administration > Periodic > Compile into .Net Framework CIL
Tuesday, August 20, 2013
Troubleshooting "Cannot Compile WebProxy Error" Consuming Dynamics AX 2012 AIF Service through Sharepoint 2010 BCS (Business Connectivity Service)
[Update# 2]
*********************************************************************************
After some research and troubleshooting, I have come to the conclusion that AIF Web Services as of now are not compatible to be consumed directly by Sharepoint 2010 BCS Services. The workaround would be to write a wrapper/adapter in between AX and Sharepoint 2010 BCS .
Currently, I'm researching and doing a POC on REST Services to be used between Sharepoint 2010 and AX and have tasted some success :). Will write a separate post on the same.
[Update# 1]
*********************************************************************************
Please see the comments on this post for the latest update.
Additionally, During my troubleshooting, I have found that by default AIF Service which is hosted in AOS and uses nettcpbinding doesn't expose metadata to external apps like Sharepoint and Infopath.
I modified the service's config file through MSE to add the mexTcpBinding endpoint as shown below
<endpoint address="net.tcp://localhost/DynamicsAx/Services/MyServiceGroup/mex"
binding="mexTcpBinding" bindingConfiguration="" name="mexEp"
contract="IMetadataExchange" />
Initially, I bumped into a few errors while configuring the service, eventually I was able to activate the service and then tested it through a .Net client. All works here as expected!
However, the Sharepoint BCS interface still gives the same error "Cannot compile web service proxy". I'm thinking now to host my AIF Service in IIS and give it a go. However, as per msdn, only we need to host AIF Services in IIS if we want to expose our service on internet. But, still I will give it a try and come back and update my findings here. If any feedback/comments, feel free to post here. Thanks again.
*********************************************************************************
Greetings Friends!
I have successfully developed a custom AIF Service in Dynamics AX 2012 (CU3 build) to create Vendor Invoice Register Journals. To test my AIF Service, I created a test harness in Visual Studio 2010 (Windows Application) to consume my AIF Service. This all works good!
Now, I'm taking this service to the next level so that I can consume it through our Sharepoint site (Please note this is a standalone enterprise Sharepoint site and not the Dynamics AX 2012 integrated Enterprise Portal one).
I'm using BCS (Business Connectivity Services) in Sharepoint 2010 to talk to Dynamics AX 2012 via webservice. So, when I consume this service from BCS (i.e. I created a new External Content Type via Sharepoint Designer 2010) and then use WebService as the Connection type in BCS. And it comes up with the below error.
Please read this post by Brandon to find a step by step info on the same issue which I'm facing http://instructorbrandon.com/dynamics-ax-aif-tutorial-series-part-3-aif-document-services-and-a-sharepoint-infopath-forms-step-by-step-for-power-users-part-e/
Here in the above blog, he managed to get a workaround by using Enterprise Search which comes out of the box in Dynamics AX 2012, However in my scenario we are not using EP :(

Any ideas, suggestions or comments appreciated? At the moment, I'm thinking of writing a wrapper .Net service between AIF and BCS and then consume the .Net Service from within BCS. But this is a workaround not a good one, I would have liked to directly tie BCS with AIF.
Please follow this forum where I have posted this issue. I will come back and update if I hit upon a solution/workaround
Thanks readers!!
Cheers,
Dilip
*********************************************************************************
After some research and troubleshooting, I have come to the conclusion that AIF Web Services as of now are not compatible to be consumed directly by Sharepoint 2010 BCS Services. The workaround would be to write a wrapper/adapter in between AX and Sharepoint 2010 BCS .
Currently, I'm researching and doing a POC on REST Services to be used between Sharepoint 2010 and AX and have tasted some success :). Will write a separate post on the same.
[Update# 1]
*********************************************************************************
Please see the comments on this post for the latest update.
Additionally, During my troubleshooting, I have found that by default AIF Service which is hosted in AOS and uses nettcpbinding doesn't expose metadata to external apps like Sharepoint and Infopath.
I modified the service's config file through MSE to add the mexTcpBinding endpoint as shown below
<endpoint address="net.tcp://localhost/DynamicsAx/Services/MyServiceGroup/mex"
binding="mexTcpBinding" bindingConfiguration="" name="mexEp"
contract="IMetadataExchange" />
Initially, I bumped into a few errors while configuring the service, eventually I was able to activate the service and then tested it through a .Net client. All works here as expected!
However, the Sharepoint BCS interface still gives the same error "Cannot compile web service proxy". I'm thinking now to host my AIF Service in IIS and give it a go. However, as per msdn, only we need to host AIF Services in IIS if we want to expose our service on internet. But, still I will give it a try and come back and update my findings here. If any feedback/comments, feel free to post here. Thanks again.
*********************************************************************************
Greetings Friends!
I have successfully developed a custom AIF Service in Dynamics AX 2012 (CU3 build) to create Vendor Invoice Register Journals. To test my AIF Service, I created a test harness in Visual Studio 2010 (Windows Application) to consume my AIF Service. This all works good!
Now, I'm taking this service to the next level so that I can consume it through our Sharepoint site (Please note this is a standalone enterprise Sharepoint site and not the Dynamics AX 2012 integrated Enterprise Portal one).
I'm using BCS (Business Connectivity Services) in Sharepoint 2010 to talk to Dynamics AX 2012 via webservice. So, when I consume this service from BCS (i.e. I created a new External Content Type via Sharepoint Designer 2010) and then use WebService as the Connection type in BCS. And it comes up with the below error.
Please read this post by Brandon to find a step by step info on the same issue which I'm facing http://instructorbrandon.com/dynamics-ax-aif-tutorial-series-part-3-aif-document-services-and-a-sharepoint-infopath-forms-step-by-step-for-power-users-part-e/
Here in the above blog, he managed to get a workaround by using Enterprise Search which comes out of the box in Dynamics AX 2012, However in my scenario we are not using EP :(
Any ideas, suggestions or comments appreciated? At the moment, I'm thinking of writing a wrapper .Net service between AIF and BCS and then consume the .Net Service from within BCS. But this is a workaround not a good one, I would have liked to directly tie BCS with AIF.
Please follow this forum where I have posted this issue. I will come back and update if I hit upon a solution/workaround
Thanks readers!!
Cheers,
Dilip
Tuesday, February 19, 2013
Review - Microsoft Dynamics AX 2012 Services Book
Dear Friends,
Greetings!
A few weeks back, I had a brief overview posted about Dynamics AX 2012 Services book.
I took some time to go through the book and I would give it a rating of 4.5/5 as the chapters are structured in a logical way and the language is quite clear and lucid to understand, along with screenshots and code snippets wherever necessary. This book will definitely help any developer on understanding and using AIF Services Framework in Dynamics AX 2012
The book talks about the following key areas:
Greetings!
A few weeks back, I had a brief overview posted about Dynamics AX 2012 Services book.
I took some time to go through the book and I would give it a rating of 4.5/5 as the chapters are structured in a logical way and the language is quite clear and lucid to understand, along with screenshots and code snippets wherever necessary. This book will definitely help any developer on understanding and using AIF Services Framework in Dynamics AX 2012
The book talks about the following key areas:
- Services and SOA Architecture Overview and Concepts
- Whats New (AOS WCF Service Host, WCF Adapters)
- Type of Services (Document Services, Custom Services, System Services, Query Service, Metadata service, User session Service)
- AxBc Classes
- WCF Concepts, ABC's of WCF
- Service Deployment
- Types of Bindings
- Document Services (Step by Step)
- Create Custom Services
- SysOperation Framework, SysOperation vs RunBase Batch
- Multithreading
- WebServices (using VS and X++ Dev tools), Consuming the webservice
- System Services
Tuesday, October 11, 2011
Update - Troubleshooting Dynamics AX 2012 Services Error Creation has been cancelled
Got heaps of exceptions when trying to invoke Dynamics AX 2012 Service from VS.Net
Below, is a snapshot from System Administration > Periodic > Services and Application Integration Framework > Exceptions
Errors:
a. Field 'Language' must be filled in
b. Field 'Currency' must be filled in
c. Item Number 1205 does not exist
d. Creation has been cancelled
Solution:
After some investigation, found that it was required to pass callcontext object explicitly after setting company and language from VS.Net as shown below:
Update: Figured out that we need not pass explicitly company and language information through code via callcontext, if the logged on user belongs to the company "ceu". In my case, the logged in user was pointing to "dat" so changed it to "ceu" in User Options form and it works fine without callcontext.
Below, is a snapshot from System Administration > Periodic > Services and Application Integration Framework > Exceptions
Errors:
a. Field 'Language' must be filled in
b. Field 'Currency' must be filled in
c. Item Number 1205 does not exist
d. Creation has been cancelled
Solution:
After some investigation, found that it was required to pass callcontext object explicitly after setting company and language from VS.Net as shown below:
Update: Figured out that we need not pass explicitly company and language information through code via callcontext, if the logged on user belongs to the company "ceu". In my case, the logged in user was pointing to "dat" so changed it to "ceu" in User Options form and it works fine without callcontext.
Troubleshooting Dynamics AX 2012 Services - Error Reading Value of Type Date from XML
Troubleshooting Consuming Dynamics AX 2012 Services from .Net
Error Reading Value of Type Date from XML
Solution: Once I passed salesTable.ReceiptDateRequested from VS.Net to the service, then this error went away
Error Reading Value of Type Date from XML
Solution: Once I passed salesTable.ReceiptDateRequested from VS.Net to the service, then this error went away
How to Consume Dynamics AX 2012 Services from VS.Net
In this post, I will be covering How to Consume Dynamics AX 2012 Sales Order Service from Visual Studio .Net
A. Firstly, Create a Service Group in AX 2012 (Go to AOT > Service Groups > Create SalesOrderServiceGroup1 - in this case.)
B. Next, drag and drop the SalesSalesOrderService from AOT > Services > to the newly created Service Group in Step A
C. Deploy the SalesOrderServiceGroup1
D. Now, the Service should list in System Administration > Setup > Services and Application Integration Framework > Inbound Ports
E. You should be able to browse the wsdl now.

F. Now Open Visual Studio, File > New Project Create a Windows Application (Windows Form or Console) and Add the above Service in Service References node.
G. Below is a sample sales order input form (I just created a simple UI as the whole purpose here is to show how to consume Dynamics AX 2012 Services from VS.Net), so this UI takes customer, item and qty and creates an order in AX.
H. Below is the sales order view from AX
VS.Net Code:
Below is the .Net code which consumes the service. It's pretty much the same which we have been using with previous versions of Dynamics AX alongwith VS.Net i.e. It constructs the Sales Order Document and Entity Objects, then populates it, finally calling the create method.
Troubleshooting:
http://daxdilip.blogspot.com/2011/10/troubleshooting-dynamics-ax-2012.html
http://daxdilip.blogspot.com/2011/10/troubleshooting-dynamics-ax-2012.html
References:
Thanks to Murray for sharing this presentation which helped me with my demo.
http://www.slideshare.net/murrayfife/creating-and-consuming-web-services-in-dynamics-ax-2012
http://blogs.msdn.com/b/aif/archive/2011/06/15/microsoft-dynamics-ax-2012-services-and-aif-white-papers.aspx
A. Firstly, Create a Service Group in AX 2012 (Go to AOT > Service Groups > Create SalesOrderServiceGroup1 - in this case.)
B. Next, drag and drop the SalesSalesOrderService from AOT > Services > to the newly created Service Group in Step A
C. Deploy the SalesOrderServiceGroup1
D. Now, the Service should list in System Administration > Setup > Services and Application Integration Framework > Inbound Ports
E. You should be able to browse the wsdl now.
F. Now Open Visual Studio, File > New Project Create a Windows Application (Windows Form or Console) and Add the above Service in Service References node.
G. Below is a sample sales order input form (I just created a simple UI as the whole purpose here is to show how to consume Dynamics AX 2012 Services from VS.Net), so this UI takes customer, item and qty and creates an order in AX.
H. Below is the sales order view from AX
VS.Net Code:
Below is the .Net code which consumes the service. It's pretty much the same which we have been using with previous versions of Dynamics AX alongwith VS.Net i.e. It constructs the Sales Order Document and Entity Objects, then populates it, finally calling the create method.
Troubleshooting:
http://daxdilip.blogspot.com/2011/10/troubleshooting-dynamics-ax-2012.html
http://daxdilip.blogspot.com/2011/10/troubleshooting-dynamics-ax-2012.html
References:
Thanks to Murray for sharing this presentation which helped me with my demo.
http://www.slideshare.net/murrayfife/creating-and-consuming-web-services-in-dynamics-ax-2012
http://blogs.msdn.com/b/aif/archive/2011/06/15/microsoft-dynamics-ax-2012-services-and-aif-white-papers.aspx
Tuesday, April 12, 2011
Contd...Scaling out AIF Services via Virtual IP Load Balancer
As promised, I'm back blogging and I will cover this post on the AIF Load Balancer Issue which I was able to sort just a couple of days before we went LIVE.
Couple of weeks back, I had posted the issue about AIF Load Balancer here - http://daxdilip.blogspot.com/2011/02/question-how-to-scale-out-aif.html
Following are the sequence of steps carried out to make it work:
a. Had to reinstall Business Connector on the AOS boxes
b. The AX Client Configuration on all the 6 AOS Servers had to be modified
c. IIS Authentication for Default Website and Microsoft Dynamics AX AIF Websites had to be Enabled.
d. Registry on each of the boxes had to be verified to make sure it points to the correct AX Config
e. Initially for testing the services on each of the box, added business connector setting manually to web.config for Dynamics AX AIF Web Services
f. Dynamics AX AIF Shares on some of the boxes were not properly configured. Had to correct it
g. Tested the services from each of the 6 AOS/AIF boxes
Once the services were up and running and tested successfully from each of the 6 AOS boxes, then the Load Balancer automatically worked without any issues. From the whole exercise, I can tell now that the Load Balancer initially was failing because out of the 6 AOS boxes, just one of them was working and 5 of them were having issues.
Couple of weeks back, I had posted the issue about AIF Load Balancer here - http://daxdilip.blogspot.com/2011/02/question-how-to-scale-out-aif.html
Following are the sequence of steps carried out to make it work:
a. Had to reinstall Business Connector on the AOS boxes
b. The AX Client Configuration on all the 6 AOS Servers had to be modified
c. IIS Authentication for Default Website and Microsoft Dynamics AX AIF Websites had to be Enabled.
d. Registry on each of the boxes had to be verified to make sure it points to the correct AX Config
e. Initially for testing the services on each of the box, added business connector setting manually to web.config for Dynamics AX AIF Web Services
f. Dynamics AX AIF Shares on some of the boxes were not properly configured. Had to correct it
g. Tested the services from each of the 6 AOS/AIF boxes
Once the services were up and running and tested successfully from each of the 6 AOS boxes, then the Load Balancer automatically worked without any issues. From the whole exercise, I can tell now that the Load Balancer initially was failing because out of the 6 AOS boxes, just one of them was working and 5 of them were having issues.
Wednesday, February 23, 2011
Question - How to Scale out AIF WebServices via Load Balancer
We have a load-balanced environment where we have 6 AOSServers in a clustered environment each hosting AIF Webservices on IIS.
The Load Balancer is basically a virtual IP which routes the requests to the 6 AOS Servers depending on the load. Now, when we try to consume the AIF Services hosted on the 6 boxes through the Load Balancer, the request doesn't go through, but when we try to consume the AIF Services directly from one of the 6 boxes, it works fine.
How do we make the request work through the load balancer? Anyone has any ideas or experienced this before, Please post your comments. Thanks.
P.S - Googled it, and this link at the end talks about the inherent limitation which AIF WebSercvice has as it has 1:1 relationship with the IIS website http://www.eggheadcafe.com/software/aspnet/32946372/aif-web-services-ax2009--scaling-out.aspx
The Load Balancer is basically a virtual IP which routes the requests to the 6 AOS Servers depending on the load. Now, when we try to consume the AIF Services hosted on the 6 boxes through the Load Balancer, the request doesn't go through, but when we try to consume the AIF Services directly from one of the 6 boxes, it works fine.
How do we make the request work through the load balancer? Anyone has any ideas or experienced this before, Please post your comments. Thanks.
P.S - Googled it, and this link at the end talks about the inherent limitation which AIF WebSercvice has as it has 1:1 relationship with the IIS website http://www.eggheadcafe.com/software/aspnet/32946372/aif-web-services-ax2009--scaling-out.aspx
Sunday, January 23, 2011
How to: Configure Dynamics AX AIF Services to listen for SSL Requests (https)
This post covers my experience on integrating Commerce Server Services with AIF Web Services across 2 domains. It was a bit challenging setup especially configuring the communication between AIF and Commerce Server over https, Troubleshooting WCF Bindings was the major component in this whole piece.
Note, in our infrastructure topology we have Dynamics AX 2009 SP 1 (Rollup 6), IIS 7.5 and Commerce Server 2009.
So, in brief these were the following steps carried out to make the integration work:
a. Import the Certificate and Configure IIS to listen for https requests
b. Troubleshooting TSL SSL Error
c. Troubleshooting AIF Authentication windows error
d. Troubleshooting binding web.config (bindings "Transport")
Now, Let's get into the details:
How to: Import Certificate and Configure IIS for SSL
http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx
http://www.digicert.com/ssl-support/pfx-import-export-iis-7.htm
In my case, I already had the certificates ready supplied by the internal support team, so had to follow the Import Certificate and Configure website steps in the above link.
Once the IIS, is configured to listen to HTTPS, then one should be able to browse the AIF Services successfully through browser, note it will prompt for Certificate, accept it and move ahead.
Troubleshooting TSL SSL Error
Trying to invoke the AIF Services through the Commerce Server Client interface gives this error " Could not establish trust relationship for the SSL/TLS secure channel with authority ". This was fixed by invoking an explicit remoteCallback validation for the certificate in the client code.
///
/// Remotes the certificate validate.
///
. private static bool RemoteCertificateValidate(
object sender, X509Certificate cert,
. X509Chain chain, SslPolicyErrors error)
{
return true;
}
Troubleshooting AIF Authentication windows error
Moving forward, encounterd this error "The Application Integration Framework Web service cannot determine the Windows login of the user calling the Web service"
This was logged in the Event viewer of AOS box, atleast had a sigh of relief to see that the communication reached till AOS box.
This is the core problem which we faced and the reason is AIF Web Services are built with a tighter windows user authentication as it doesn't understand Certificate mode of authentication and this error is thrown from the Microsoft AIF Intergration Framework dll.
I tried couple of workarounds by creating small demo applications and configurations and presented it to our Solution Team
i. Firstly, changed the binding to basicHttpBinding on the AIF Server and Created a small app on the Commerce Server client box and this works fine and it can communicate without any problems with AIF Web Services. The downside is it's not much secure. But basicHttpBinding is much faster than wsHttpBinding.
ii. Installed and Configured Microsoft Dynamics AX .Net Business Connector on the Commerce Server Client box and created a small app which can communicate to AX via the .Net Business Connector. This works fine but I won't be recommending it as we need to rewrite the AIF Logic which AIF Framework provides out of the box and the other downside to this approach is maintainability issues as we need to maintain .Net BC on Commerce Server box (i.e. the Commerce Server code will have a tight coupling with AX .Net BC Code, and also upgrades to .Net BC means we would need to take the Commerce Server Web Sites down)
iii.To host intermediary Non-AIF Services on the same box where AIF Services resides. This will act as wrapper services for AIF Services. So, the Commerce Server client will be invoking the Non-Aif Services and this will inturn invoke the AIF Web Services, there won't be a direct or live connection between Commerce Server and AIF. Any communication between these 2 apps will be handled by this broker or intermediary web service. The downside is performance may hamper a bit as there is an extra layer.
We chose to go with basicHttpBinding with Certificates installed on server and client and explicitly passing the Business Connectory Proxy Credentials in the code before invoking the service.
Troubleshooting binding web.config (bindings "Transport")
This is the final version of how the server-side and client-side bindings look. I tried various combinations on the security and transport mode before arriving at this one.
References:
Florian in his blog has an interesting article on securing AIF Services cross domain which works with IIS 6.0 and Windows Server 2003.
http://floditt.blogspot.com/2010/06/cross-domain-access-to-aif-webservices.html
Note, in our infrastructure topology we have Dynamics AX 2009 SP 1 (Rollup 6), IIS 7.5 and Commerce Server 2009.
So, in brief these were the following steps carried out to make the integration work:
a. Import the Certificate and Configure IIS to listen for https requests
b. Troubleshooting TSL SSL Error
c. Troubleshooting AIF Authentication windows error
d. Troubleshooting binding web.config (bindings "Transport")
Now, Let's get into the details:
How to: Import Certificate and Configure IIS for SSL
http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx
http://www.digicert.com/ssl-support/pfx-import-export-iis-7.htm
In my case, I already had the certificates ready supplied by the internal support team, so had to follow the Import Certificate and Configure website steps in the above link.
Once the IIS, is configured to listen to HTTPS, then one should be able to browse the AIF Services successfully through browser, note it will prompt for Certificate, accept it and move ahead.
Troubleshooting TSL SSL Error
Trying to invoke the AIF Services through the Commerce Server Client interface gives this error " Could not establish trust relationship for the SSL/TLS secure channel with authority ". This was fixed by invoking an explicit remoteCallback validation for the certificate in the client code.
///
/// Remotes the certificate validate.
///
. private static bool RemoteCertificateValidate(
object sender, X509Certificate cert,
. X509Chain chain, SslPolicyErrors error)
{
return true;
}
Troubleshooting AIF Authentication windows error
Moving forward, encounterd this error "The Application Integration Framework Web service cannot determine the Windows login of the user calling the Web service"
This was logged in the Event viewer of AOS box, atleast had a sigh of relief to see that the communication reached till AOS box.
This is the core problem which we faced and the reason is AIF Web Services are built with a tighter windows user authentication as it doesn't understand Certificate mode of authentication and this error is thrown from the Microsoft AIF Intergration Framework dll.
I tried couple of workarounds by creating small demo applications and configurations and presented it to our Solution Team
i. Firstly, changed the binding to basicHttpBinding on the AIF Server and Created a small app on the Commerce Server client box and this works fine and it can communicate without any problems with AIF Web Services. The downside is it's not much secure. But basicHttpBinding is much faster than wsHttpBinding.
ii. Installed and Configured Microsoft Dynamics AX .Net Business Connector on the Commerce Server Client box and created a small app which can communicate to AX via the .Net Business Connector. This works fine but I won't be recommending it as we need to rewrite the AIF Logic which AIF Framework provides out of the box and the other downside to this approach is maintainability issues as we need to maintain .Net BC on Commerce Server box (i.e. the Commerce Server code will have a tight coupling with AX .Net BC Code, and also upgrades to .Net BC means we would need to take the Commerce Server Web Sites down)
iii.To host intermediary Non-AIF Services on the same box where AIF Services resides. This will act as wrapper services for AIF Services. So, the Commerce Server client will be invoking the Non-Aif Services and this will inturn invoke the AIF Web Services, there won't be a direct or live connection between Commerce Server and AIF. Any communication between these 2 apps will be handled by this broker or intermediary web service. The downside is performance may hamper a bit as there is an extra layer.
We chose to go with basicHttpBinding with Certificates installed on server and client and explicitly passing the Business Connectory Proxy Credentials in the code before invoking the service.
Troubleshooting binding web.config (bindings "Transport")
This is the final version of how the server-side and client-side bindings look. I tried various combinations on the security and transport mode before arriving at this one.
References:
Florian in his blog has an interesting article on securing AIF Services cross domain which works with IIS 6.0 and Windows Server 2003.
http://floditt.blogspot.com/2010/06/cross-domain-access-to-aif-webservices.html
Wednesday, December 29, 2010
AIF Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.
A small tip when you are working on Dynamics AX AIF Services running on VPC
A background - I have a very simple AIF .Net Client App which has been very handy for me to test AIF Services on any environment. This client app consumes the AIF Customer Service to create customer records in AX.
Issue
Recently, when I was trying to generate the proxy for one of the AIF Service which was running on a VPC I ran into this error below (Note the client app project was on my host machine and I was opening the VS project via the shared drive)
"Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section."
Solution
Copied the Visual Studio Client App Project into the VPC, Built it and re-generated the proxy for the service and now it works
A background - I have a very simple AIF .Net Client App which has been very handy for me to test AIF Services on any environment. This client app consumes the AIF Customer Service to create customer records in AX.
Issue
Recently, when I was trying to generate the proxy for one of the AIF Service which was running on a VPC I ran into this error below (Note the client app project was on my host machine and I was opening the VS project via the shared drive)
"Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section."
Solution
Copied the Visual Studio Client App Project into the VPC, Built it and re-generated the proxy for the service and now it works
Saturday, December 4, 2010
Fiddler - Good tool to check EP web page, custom websites, performance and AIF Web services
Recently, I was evaluating some tools for troubleshooting performance related to EP web pages.
I just bumped upon this site to find some great tools for testing performance of webpages, websites, sharepoint sites etc.
http://blogs.msdn.com/b/sanjaynarang/archive/2009/04/18/sharepoint-performance-stress-load-testing.aspx
Out of the links in the browser add-ons, I evaluated Fiddler http://www.fiddler2.com/Fiddler2/firstrun.asp and it's quite handy, after installation it sits quietly in the browser window and then each page you load, it will show you the statistics in terms of how much time each functionality took to load, like web controls, web menus etc.
Good handy tool for any website debugging, Also with AIF Web Services, it shows you the xml sent between calls.
I just bumped upon this site to find some great tools for testing performance of webpages, websites, sharepoint sites etc.
http://blogs.msdn.com/b/sanjaynarang/archive/2009/04/18/sharepoint-performance-stress-load-testing.aspx
Out of the links in the browser add-ons, I evaluated Fiddler http://www.fiddler2.com/Fiddler2/firstrun.asp and it's quite handy, after installation it sits quietly in the browser window and then each page you load, it will show you the statistics in terms of how much time each functionality took to load, like web controls, web menus etc.
Good handy tool for any website debugging, Also with AIF Web Services, it shows you the xml sent between calls.
Friday, November 26, 2010
Tip How to Trace a Call to an AIF Web Service
These days, having a very busy schedule as I'm troubleshooting AIF Web Service calls across domains. I will be soon writing a blog post on that. Finally, we were successful in consuming our AIF Services across domains.
I found this tip from MSDN quite handy when we are tracing a web service call from an external App to AX. Read on...
http://msdn.microsoft.com/en-US/library/cc967372.aspx
I found this tip from MSDN quite handy when we are tracing a web service call from an external App to AX. Read on...
http://msdn.microsoft.com/en-US/library/cc967372.aspx
Sunday, October 3, 2010
AIF read Error executing code: Insufficient memory to run script
Built a custom AIF Service and which was getting invoked from a Commerce Server .Net web service and whenever the read operation on the service was invoked, it goes to non responding state for more than 2 minutes and then gets into the exception block throwing the below error "Insufficient memory to run the script"
Thanks to the EMEA blog which pointed to the right direction http://blogs.msdn.com/b/emeadaxsupport/archive/2009/06/15/error-executing-code-insufficient-memory-to-run-script.aspx
Initially, I added the maxbuffersize to the AOS registry setting but that didn't help, then adding the maxbuffersize to the .Net BC configuration in the registry did the trick and this error got resolved
Thanks to the EMEA blog which pointed to the right direction http://blogs.msdn.com/b/emeadaxsupport/archive/2009/06/15/error-executing-code-insufficient-memory-to-run-script.aspx
Initially, I added the maxbuffersize to the AOS registry setting but that didn't help, then adding the maxbuffersize to the .Net BC configuration in the registry did the trick and this error got resolved
Wednesday, July 21, 2010
Troubleshooting Dynamics AX 2009 AIF, WCF, IIS on Windows Server 2008 R2
Issue: We installed AIF on Windows Server 2008 R2 running 64 bit, but was unable to browse the website as it was throwing HTTP – 403 Error and the application pool was getting stopped by itself.
Checked the application pool service account and tried restarting the application pool. Restarted IIS but still the application pool stops when we browse the website.
Also, IIS was unable to recognise the .svc extension.
Troubleshooting Steps:
a. Firstly, .svc extension was not getting recognized by IIS, So had to run the servicemodelreg utility which registers WCF (.svc mime type and related handlers into IIS)
http://msdn.microsoft.com/en-us/library/ms732012.aspx
b. Then, the next error which I got was aspnetcompatibility, which got resolved by turning off the aspnetcompatibility flag in web.config
c. Then, encountered this error, and it got resolved by giving permission for the business connector account to read/write to %windir%/temp folder
d. Finally, in order to access the webservice from a different machine, had to go turn on the anonymous access at DynamicsAXAIF website.
Checked the application pool service account and tried restarting the application pool. Restarted IIS but still the application pool stops when we browse the website.
Also, IIS was unable to recognise the .svc extension.
Troubleshooting Steps:
a. Firstly, .svc extension was not getting recognized by IIS, So had to run the servicemodelreg utility which registers WCF (.svc mime type and related handlers into IIS)
http://msdn.microsoft.com/en-us/library/ms732012.aspx
b. Then, the next error which I got was aspnetcompatibility, which got resolved by turning off the aspnetcompatibility flag in web.config
c. Then, encountered this error, and it got resolved by giving permission for the business connector account to read/write to %windir%/temp folder
d. Finally, in order to access the webservice from a different machine, had to go turn on the anonymous access at DynamicsAXAIF website.
Thursday, July 8, 2010
Troubleshooting AIF Fault Errors X++ Exception has occured
Overview For our project, we were developing bunch of AIF Web Services to be consumed by external applications such as Commerce Server and Custom ASP.Net web apps.
Issue We initially tried to generate some of the standard out of the box web services for creating customer, vendor etc. The generation was successful but when consuming these web services through a Test harness .Net Windows App, We encountered the following two errors in Event Viewer
Event Log 1
Microsoft Dynamics AX Business Connector Session 9.
An X++ exception has occurred.
Request Failed. See the Exception Log for details.
Event Log 2:
The description for Event ID 0 from source Dynamics Application Integration Server cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
An error occurred while Web service request http://wdmaxaosdev01vm.retail.ad.cmltd.net.au/MicrosoftDynamicsAXAif50/liqtrlrservice.svc and action http://tempuri.org/LIQTRLRService/create were being processed. Error details:
.
Request Failed. See the Exception Log for details.
**Exception:**
Message: Stack trace: at Microsoft.Dynamics.BusinessConnectorNet.Axapta.CallStaticClassMethod(String className, String methodName, Object[] paramList)
Request Failed. See the Exception Log for details.
at Microsoft.Dynamics.IntegrationFramework.Service.WcfAxAdapter.SubmitMessageToAx()
The specified resource type cannot be found in the image file
Solution
There was no track of any X++ exception messages in the Basic > Periodic > Application Integration Framework > Exceptions Form.
After some time of troubleshooting, got to know that the .Net Business Connector Configuration was missing on the AOS Server where AIF was installed. Creating a .Net Business Connector Configuration by going to Control Panel > Administration Tools > Client Configuration Utility resolved the issue.
You can find some related information about AIF in my previous post
http://daxdilip.blogspot.com/2010/05/aif-links.html
Issue We initially tried to generate some of the standard out of the box web services for creating customer, vendor etc. The generation was successful but when consuming these web services through a Test harness .Net Windows App, We encountered the following two errors in Event Viewer
Event Log 1
Microsoft Dynamics AX Business Connector Session 9.
An X++ exception has occurred.
Event Log 2:
The description for Event ID 0 from source Dynamics Application Integration Server cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
An error occurred while Web service request http://wdmaxaosdev01vm.retail.ad.cmltd.net.au/MicrosoftDynamicsAXAif50/liqtrlrservice.svc and action http://tempuri.org/LIQTRLRService/create were being processed. Error details:
**Exception:**
Message:
at Microsoft.Dynamics.IntegrationFramework.Service.WcfAxAdapter.SubmitMessageToAx()
The specified resource type cannot be found in the image file
Solution
There was no track of any X++ exception messages in the Basic > Periodic > Application Integration Framework > Exceptions Form.
After some time of troubleshooting, got to know that the .Net Business Connector Configuration was missing on the AOS Server where AIF was installed. Creating a .Net Business Connector Configuration by going to Control Panel > Administration Tools > Client Configuration Utility resolved the issue.
You can find some related information about AIF in my previous post
http://daxdilip.blogspot.com/2010/05/aif-links.html
Sunday, May 16, 2010
AIF Links...
Troubleshoot AIF http://technet.microsoft.com/en-us/library/aa548693.aspx
Consuming AIF Web Service is VS 2008
http://www.eggheadcafe.com/software/aspnet/33917648/consuming-aif-web-service.aspx
AIF Error Access to Service https://community.dynamics.com/forums/t/18134.aspx
Dynamics AX - AIF WebService for AxdSales Order
http://paruvella.spaces.live.com/Blog/cns!F2EC589E221A4DB0!133.entry
How to: Call an AIF Web Service from C#
http://msdn.microsoft.com/en-US/library/cc652581(v=AX.50).aspx
AIF Integration using web services
https://community.dynamics.com/forums/p/30337/59298.aspx
AIF Find/Read in Dynamics AX
https://community.dynamics.com/blogs/axsantoshr/comments/51105.aspx
Dynamics AX integration using AIF http://blogs.msdn.com/aif/
Creating Custom Dynamics AX Services
http://blogs.msdn.com/aif/archive/2008/12/16/creating-custom-dynamics-ax-services.aspx
Consuming AIF Web Service is VS 2008
http://www.eggheadcafe.com/software/aspnet/33917648/consuming-aif-web-service.aspx
AIF Error Access to Service https://community.dynamics.com/forums/t/18134.aspx
Dynamics AX - AIF WebService for AxdSales Order
http://paruvella.spaces.live.com/Blog/cns!F2EC589E221A4DB0!133.entry
How to: Call an AIF Web Service from C#
http://msdn.microsoft.com/en-US/library/cc652581(v=AX.50).aspx
AIF Integration using web services
https://community.dynamics.com/forums/p/30337/59298.aspx
AIF Find/Read in Dynamics AX
https://community.dynamics.com/blogs/axsantoshr/comments/51105.aspx
Dynamics AX integration using AIF http://blogs.msdn.com/aif/
Creating Custom Dynamics AX Services
http://blogs.msdn.com/aif/archive/2008/12/16/creating-custom-dynamics-ax-services.aspx
Dynamics AX 2009 AIF - Error Access to Service
Last week, I was involved in creating a custom webservice using AIF (Dynamics AX 2009). Last time when I worked on AIF development, that was with AX 4.0 ,which then had the limitations for update operation and which got resolved in one of the service pack released later.
I created this custom query and then ran the AxD Wizard inorder to generate my custom services. The service got created successfully which I had to consume in my .Net test harness application ( a simple .Net Windows client app to test my service by passing the required parameters). As expected, my first attempt never works without giving me an error ;-), I spent some time digging into this checking in Windows Event Viewer and .Net Stack Trace without any luck. Later on, it striked me to go and check into the Exception raised in AIF in AX.
I navigated to Basic => Periodic => Application Integration Framework => Exceptions and got this error description "The User does not have access to the service" though it was not a proper descriptive one, it gave me some insights where to debug..
I put the breakpoint in the below class AifRequestProcessor (verifyRequestIsAllowed method) and found the actual issue was that the new service created by me does not have a security key assigned to it. Once the Security key was assigned this helped in resolving the error.
Thought posting some AIF links/blogs which might be useful ..
Troubleshoot AIF
http://technet.microsoft.com/en-us/library/aa548693.aspx
Consuming AIF Web Service is VS 2008 http://www.eggheadcafe.com/software/aspnet/33917648/consuming-aif-web-service.aspx
AIF Error Access to Service https://community.dynamics.com/forums/t/18134.aspx
Dynamics AX - AIF WebService for AxdSales Order http://paruvella.spaces.live.com/Blog/cns!F2EC589E221A4DB0!133.entry
How to: Call an AIF Web Service from C# http://msdn.microsoft.com/en-US/library/cc652581(v=AX.50).aspx
AIF Integration using web services https://community.dynamics.com/forums/p/30337/59298.aspx
AIF Find/Read in Dynamics AX https://community.dynamics.com/blogs/axsantoshr/comments/51105.aspx
Dynamics AX integration using AIF http://blogs.msdn.com/aif/
Creating Custom Dynamics AX Services http://blogs.msdn.com/aif/archive/2008/12/16/creating-custom-dynamics-ax-services.aspx
I created this custom query and then ran the AxD Wizard inorder to generate my custom services. The service got created successfully which I had to consume in my .Net test harness application ( a simple .Net Windows client app to test my service by passing the required parameters). As expected, my first attempt never works without giving me an error ;-), I spent some time digging into this checking in Windows Event Viewer and .Net Stack Trace without any luck. Later on, it striked me to go and check into the Exception raised in AIF in AX.
I navigated to Basic => Periodic => Application Integration Framework => Exceptions and got this error description "The User does not have access to the service" though it was not a proper descriptive one, it gave me some insights where to debug..
I put the breakpoint in the below class AifRequestProcessor (verifyRequestIsAllowed method) and found the actual issue was that the new service created by me does not have a security key assigned to it. Once the Security key was assigned this helped in resolving the error.
Thought posting some AIF links/blogs which might be useful ..
Troubleshoot AIF
http://technet.microsoft.com/en-us/library/aa548693.aspx
Consuming AIF Web Service is VS 2008 http://www.eggheadcafe.com/software/aspnet/33917648/consuming-aif-web-service.aspx
AIF Error Access to Service https://community.dynamics.com/forums/t/18134.aspx
Dynamics AX - AIF WebService for AxdSales Order http://paruvella.spaces.live.com/Blog/cns!F2EC589E221A4DB0!133.entry
How to: Call an AIF Web Service from C# http://msdn.microsoft.com/en-US/library/cc652581(v=AX.50).aspx
AIF Integration using web services https://community.dynamics.com/forums/p/30337/59298.aspx
AIF Find/Read in Dynamics AX https://community.dynamics.com/blogs/axsantoshr/comments/51105.aspx
Dynamics AX integration using AIF http://blogs.msdn.com/aif/
Creating Custom Dynamics AX Services http://blogs.msdn.com/aif/archive/2008/12/16/creating-custom-dynamics-ax-services.aspx
Subscribe to:
Posts (Atom)






