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)

Add service reference: Use of unassigned out parameter 'XX'

(0) ShareShare
ReportReport
Posted on by

Hi there

I'm currently integrating a web service to AX 2009. When I try to add a service reference in AOT, I got some messages saying:

[Drive:\]...\AppData\Local\Temp\DynamicsAxSvcReferences\<MyWebServiceName>\<WebServiceMainCls.cs(36,25) : error CS0269: Use of unassigned out parameter <Parameter>

But when I use Visual Studio, all works fine. I don't know how to fix. Any Ideas:

The service is public, so you can try it too: https://ws.im.post.ch/3.0?wsdl

Thank you for answers.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Tommy Skaue Profile Picture
    Moderator on at

    You might have an unsupported scenario with this webservice. If that is the case, then you need to consider creating a wrapper class for the webservice, and consume the wrapper class within AX.

  • Community Member Profile Picture
    on at

    Hmm, and how i find out, if I have such an unsupported scenario?

    I know about the possiblity of a wrapper class, but if possible, of course I don't want solve it inside AX ...

  • Tommy Skaue Profile Picture
    Moderator on at

    I don't think you will be able to use the method "PeekMessage" and "GetMessage" without using a wrapper class. I don't think AX .Net interop support such a scenario at the current version. I remember having issues with using an out variable of a custom type from within AX.

  • Community Member Profile Picture
    on at

    So, these two operations are the trouble base?

    Well, these two operations I don't need. But is there a way to add the service reference anyway??

  • Verified answer
    Tommy Skaue Profile Picture
    Moderator on at

    Here is what you can try. I can not guarantee it will work, so good luck!

    Add a breakpoint in the method AifServiceReferenceManager.generate()
      

    Now add the reference as normal. 

    When the code hits the breakpoint, head over to the temporary files holding the c# code and remove both "PeekMessage" and "GetMessage" from the source of both PortClient.cs and WcfSoapClient.cs. Use a text editor like notepad for this. Path should be something like
    C:\Users\AOS_SERVICE_ACCOUNT\AppData\Local\Temp\DynamicsAxSvcReferences\NAMESPACE 

    Now let the program continue and it will compile the dll ok and add the reference for you. 

    I tested it just now:
      

  • Community Member Profile Picture
    on at

    Hi Tommy

    Thank you for that Idea - this seems to work. I have now some minor .NET/WCF troubles to solve before I can do serious tests.

    But I will write, if all runs fine or if there are any other issues.

    Thank you again!

  • Tommy Skaue Profile Picture
    Moderator on at

    Good stuff! :-)

    Please remember to mark the answer. ^_^

  • Community Member Profile Picture
    on at

    Well, that works!

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