web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Ax 2012 Service is not accepting System.Object coming from .Net framework

(0) ShareShare
ReportReport
Posted on by 1,020

Hi All,

I have an issue in calling AX service from .Net framework. We are creating an inbound AIF service in AX 2012 and calling the Webservice from .Net to send an object. This object is made from a .net class that deserializes an XML and converts into Object. Object has data but when we are sending this to Ax service method as input parameter, error is thrown on .net side itself before making a call to AX service method.

The AX service method has same datatype of System.Object to accept the object from .Net.

Can Any one help on this to call the object from .net to Ax 2012 service.

Looking for your valuable support.

Thanks in advance!

Ramakrishna T.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    First of all, why don't you use a specific type? You need it for serialization.

    Also, you didn't give us details of the error.

  • RamaKrishna Tanneeru Profile Picture
    1,020 on at

    Hi Martin,

    Thanks for the response

    The error is shown below:

    "There was an error while trying to serialize parameter http://tempuri.org:objPayLoad. The InnerException message was 'Type 'XXXXXXX.YYYYY' with data contract name 'YYYYY:schemas.datacontract.org/.../XXXXXX&; is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'.  Please see InnerException for more details. "

    I tried an approach after looking into the above error, I used a datacontract class with parm method that returns the object of type System.Object but No luck.

    Could you please help me on this regard to call the object of type System.Object (universal Object) from .net to Ax 2012 service.

    Or let me know an approach to address this issue.

    Looking for your valuable help.

    Thanks in advance

    Ramakrishna T.

  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    Again, why are you trying to use System.Object instead of your specific type? And what type are you sending? Is it serializable?

  • RamaKrishna Tanneeru Profile Picture
    1,020 on at

    Actually .net is sending an object "which is dynamic" that contains data retrieved from deserialization of XML. This object needs to be sent to AX.  So in order to have a sync between AX and .net ( calling the Ax service method) I took System.Object.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans