Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Consum web service in Ax 2009

415 views
Skip to first unread message

Tam

unread,
Sep 2, 2010, 7:30:03 AM9/2/10
to
Hi everyone
I want to use an external web service in Dynamics Ax 2009 but got this
exceptions:

Message --> Exception has been thrown by the target of an invocation.
Source --> mscorlib
Stack --> at System.RuntimeMethodHandle._InvokeMethodFast(Object target,
Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target,
Object[] arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at ClrBridgeImpl.InvokeClrInstanceMethod(ClrBridgeImpl* ,
ObjectWrapper* objectWrapper, Char* pszMethodName, Int32 argsLength,
ObjectWrapper** arguments, Boolean* argsAreByRef, Boolean* isException)
Message --> Type 'System.ServiceModel.Channels.ReceivedFault' in assembly
'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' is not marked as serializable.
Source --> Microsoft.Dynamics.IntegrationFramework
Stack --> at
Microsoft.Dynamics.IntegrationFramework.WebService.AppDomainRemotingProxy.ExecuteMethod(String methodName, Object[] args)
at
Samh.Webservice.SamWebServicePortClient.setQuarterlySale(String strAccessKey,
Int32 intSupplierCVR, Int32 intMemberCVR, Int32 intYear, Int32 intQuarter,
Single dblAmount)

I followed the White Paper Consuming Web Services in Microsoft Dynamics AX
2009
and restarted the AOS service after the Web Reference was created, still
errors.

My colleague called the web service by his .Net application it works fine.

Any idea to solve this issue? Any help will be appreciated.

Regards
Tam

Huzaifa Gain

unread,
Sep 2, 2010, 10:04:03 AM9/2/10
to
See if Biz connector is working fine or not ..

Tam

unread,
Sep 3, 2010, 9:14:03 AM9/3/10
to
I think Biz Connector doesn't need to be available when you're using web ref.

I tried to create a new web ref to microsoft
http://terraserver-usa.com/TerraServices2.asmx web service. It worked fine.
The method I invoked returned a string.

The one that throws exception return an array. Could that be the reason?

Axel Kühn

unread,
Sep 6, 2010, 5:56:03 AM9/6/10
to
Hi Tam,

there are some limitations for webservice used as service references in
Dynamics AX 2009.

Please see this article:
http://floditt.blogspot.com/2010/07/limitations-of-dynamics-ax-service.html

Somethines it is better to write a nes .net assembly which handles the
webservice calls and exposes a working "interface" for AX. This is also
described in the article.

But if you are working with an array as result, this could also be the
problem.
There are some differnces in the usage of .net arrays and x++ arrays.

Please take a look at this discussion, where you can find an example on how
to use .net arrays as result form a webservice call.
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?&lang=&cr=&guid=&sloc=en-us&dg=microsoft.public.axapta.programming&p=1&tid=a5106c60-9c14-4e88-b269-9c5bed8027b8

Hope this helps you.
--
Sincerely yours
Axel Kühn (visit my Dynamics AX blog at: http://blog.ak-home.net)

0 new messages