Thursday, February 22. 2007Using SOAP via a .NET in Dynamics AXComments
Display comments as
(Linear | Threaded)
Hello, Bonjour Dominique, Le Français n’est acun problème, mais mon Français est terrible! Désolé pour mon mauvais Français… J’ai téléchargé mon C# code et vous pouvez trouver à . J’ai également ajouté le URL à l’article. La seule modification est la méthode "check()". Dynamics AX ne peut pas accepter des exceptions de .NET correctement, donc "catch" ne fait rien et s’il y a une erreur, une rangée vide est retournée. In case my French is too terrible, here it is in English: My code is uploaded at the above URL. The only modification is the "check()" call. Dynamics AX cannot properly handle .NET exceptions, so the "catch" statement is empty so if there’s an error it simply returns an empty array. Merci, et un joyeux noël à vous aussi! – SimonHello, I haven’t found any answer Hi Dominique, The VAT number is linked to other things such as sales orders and purchase orders (and ultimately invoices) and can have significant tax authority consequences if an invoice was produced and then the VAT number is changed. For future reporting of past invoice events to tax authorities, you would want to know the legal name and originating country for that VAT number at the time of the invoice, rather than the present name/country of a customer/vendor record. DAX does similar things in the system; for example, have a look at the tables related to customer or vendor invoices and you’ll see how important these relationships are for back-dated reporting. This is the main reason for this that I can see, so I hope this makes sense! As far as user security goes, there’s no reason why you can’t remove access to the VAT table and replace the VAT number field with an edit method that does some magic to conceal it from the user. Cheers, – SimonThanks for the answer. Thanks again. Dominique Hi Dominique, Another reason may simply be database normalisation. The VAT numbers are used in many, many tables, and a heavy dose of normalisation is common in OLTP database design. Normalising this makes sense, for example when maintaining a list of valid VAT numbers the relation back to TaxVATNumTable from other tables is always verified by the user interface. In our case, we also store the VIES validity we acquired against the VAT number records within TaxVATNumTable, giving it a clearer purpose. I suppose you could consider TaxVATNumTable to be quite similar to the AddressZipCode table in some respects. Cheers, – Simonregarding this concept/technique, i created a custom dll, strong key’d, installed on AOS. All the clients are now getting a "failed loading assembly…." Does the DLL need to be deployed to all clients in order to utilize this technique of using a .net dll? Hi Gary, When using a CLR (.Net) assembly, you either must install it within the GAC on each AOS or within the GAC of all clients that will use the code. The decision is up to you, depending on what your circumstances, and depends only on the tier your code is executing within. For something like this simple VAT/Tax number validation routine, it makes no sense to have the burden of rolling out the assembly to all clients, so the assembly resides only on the AOS servers. The difference within the X++ side of the code is that the class is configured to explicitly execute on the server. The situation for static methods is slightly different though, because you will want to add the "server" keyword to the method’s definition too, otherwise it may still execute on the same tier it was called from. If the clients are still receiving the message, use the debugger to make sure the code calling or even referencing the assembly is actually being executed on the server tier instead of the client tier. Normally you can see this quickly by way of the little icons next to the methods in the stack trace pane. Good luck! – SimonHi, Is it actually possible to create a client in Axapta for a WebService which has some ComplexTypes in the Request / Response ? I’m trying to find more information on that, but didn’t have any luck so far :-( Regards, Stefaan Hi Stefaan, Sorry for taking so long to get back to you. Good question, and I’m sorry to say that I haven’t really had that much experience with ComplexTypes defined in a web service for Dynamics AX. However, I would imagine that the procedure would be mostly the same – if you generate code based on the WSDL you should then be able to use it as an assembly in Dynamics AX. The trick would be mapping data-types into those Dynamics AX can use. I’m unsure about Dynamics AX 2009 (version 5) as we haven’t started the a migration project yet, but Dynamics AX 4.0 has very immature CLR interoperability. In particular, the use some data types through a CLR API cause a high number of page faults (leading me to think that there’s a lot of memory copying going on), and some data types cannot be supported at all through CLR. To this end, I would suggest extending the generated C# code to include wrappers that simplify access to the data returned from the web service. A a simplistic example, Dynamics AX 4.0 does not handle any of the generics very well. For example, a generic list object will need to be converted into an array before Dynamics AX can use it. Ultimately, if this solution doesn’t work then you can try reversing the concept; Don’t forget that Dynamics AX 4.0 comes with a few Business Connector licenses as standard, and you can use the ".Net Connector" to write your own code to handle the web service, which uses an easy API within X++ to push the data into Dynamics AX. This of course depends on how your web service needs to work, though (push vs. pull paradigms). If you do find a solution, please let me know. Good luck! Cheers, – Simon |
Calendar
Stuff for saleCreative Commons |
|||||||||||||||||||||||||||||||||||||||||||||||||
Just under a month ago, we completed an upgrade of our Axapta 3.0 SP5 KR3 system to Dynamics AX 4.0 SP1. For those who don't know, Microsoft Dynamics AX is the new name for Microsoft Business Solutions Axapta. During the upgrade, we ran into many probl
Tracked: May 06, 02:33