Total Pageviews

Search This Blog

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



5 comments:

tommy.skaue said...

Have you ensured that the service is permitted to load data from AX, and have you also made sure your SharePoint user is allowed to load data from the External Content Type?

Here is a guide and a PowerShell script: http://www.c-sharpcorner.com/uploadfile/anavijai/set-permissions-to-external-content-type-using-powershell/

Dilip said...

Thanks Tommy for your inputs. Have already taken care of the security aspect.

krishhDAX said...

Hi Dilip,

Could you please generate proxy using svcutil of the service.svc, is metadateExchange endpoint defined for that endpoint,if not please define that and try to create proxy using svcutil tool and see the object that it created and compile it and see, I am suspecting that the proxygeneration is failing in this scenario. because for shareporint metadataexchange should be enabled for endpoint. I am suspecting that was the issue, we integrated with AIF service endpoint with the CRM,we didnt get any issue.

Dilip said...

Thanks Krishna for your help. Yes, I defined the metadata exchange modified the config to include mextcpbinding, now I'm able to generate the AIF Service without any error, but while consuming the service in Sharepoint, I still get the original error. Any tips?

Microsoft Dynamics said...


This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It?s the old what goes around comes around routine. Did you acquired lots of links and I see lots of trackbacks??
Dynamics crm training