Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

WSDL service issue: The class xxxxx does not contain this function

(0) ShareShare
ReportReport
Posted on by 10

I'm trying to connect to a web service (WSDL) to rate shipments and return the least cost carrier.

I've gone through the steps of Tools/Development tools/.../Add Service Reference.

The URL is correct, and the service was created with the reference name I selected (RaterService)

I've restarted the AOS on our DEV box to allow it to add the reference DLL and app.config to the C:\users\...\ServiceReferences\ folder.

Based on what I can find on the web concerning this, in the app.config there, I needed to check for an 'Endpoint Configuration'

<endpoint address="https://<webaddress>/RaterService.asmx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding"
contract="RaterService.WcfClient.ISoapRaterService" name="BasicHttpBinding" />

Which leads me to believe I need to use 'BasicHttpBinding' as the endpoint in my code, below.

I've written a class to leverage the service, and the X++ code prompter shows the GetRate method in a dropdown as I type, then shows me tooltip text for the list of parameters passed:

(code snippet below) 

// Create the SCAC request.
soapClient = new RaterService.ISoapRaterServiceClient("BasicHttpBinding");
response = new RaterService.SoapRateResult();
response = soapClient.GetRate("<hex GUID here>","<company code>",_shipAcct, _consAcct,wghts,fcls,_palletCount,_isHaz,_dlvTerms);

So far, so good.

Yet, when I click Save/Compile, I get the following error:

The class RaterService.ISoapRaterServiceClient does not contain this function.

Can't figure out what I am doing wrong. The web class has the function shown IN it, and the code prompter shows that it sees it. Yet the compiler doesn't.

If this was a runtime issue I could at least debug, but this is a compile-time issue. Any help would be appreciated.

  • Chris Solaas Profile Picture
    10 on at
    RE: WSDL service issue: The class xxxxx does not contain this function

    Thanks, Martin. Almost every time I've had an issue in AX, and I've wandered the net looking for a solution, it's come from you.

    The situation above might need a little clarification. We have a 3rd party Logistics partner that we did business with years ago, and this WSDL was theirs, and worked perfectly then. Several years ago, we went with another 3PL, and turned off the call to the WSDL, though all the code and even the Service Reference were all in place.

    Fast forward to recent times, we are back with this 3PL, and are trying to reactivate their WSDL. But the WSDL isn't working. The following things have changed, and required work to correct:

    1. We've upgraded our AOS servers to OS 2012 R2 in order to get 'more current' and continue to receive updates, in prep for a move to D365

    2. In the upgrade, we created brand new OS 2012 VM Servers, and the DLL for this service was not migrated across, as it wasn't needed at the time, and we'd forgotten about it. (Still have a 2008 R2 test server I could retrieve DLL etc from)

    3. The WSDL URL and method names had changed slightly. Instead of http it was https, and a different subnet and folder.

    4. The WSDL requires a security GUID (in the parms passed) and our old GUID is likely not valid anymore.

    NOTE:

    The GUID seems to me to be the most likely smoking gun for the trouble I'm having, but if the WSDL will register, and the DLL is created on the local DEV AOS users/axaosservice/.../Services/RaterService folder, and the X++ Editor prompts the methods and parms perfectly, I'm surprised an invalid GUID would not allow a compile.

    I've read through the material on endpoints, and drilled through to explore additional material there on the WSDL functionality, though I helped wire in the original install years ago. The mind gets rusty and dusty in areas it's not exercised.

    I've requested a new valid GUID, and if the compile suddenly 'works' I'll be sure to post that here.

  • Martin Dráb Profile Picture
    231,772 Most Valuable Professional on at
    RE: WSDL service issue: The class xxxxx does not contain this function

    At which line does it fail? The one with GetRate()? If so, verify that you have the right number of parameters and their types.

    What you pass to the ISoapRaterServiceClient's constructor is wrong. The binding isn't the endpoint to call - it describes how the call should be done, such as what authentication mechanism should be used. I recommend reading some basics about WCF (e.g. Endpoints: Addresses, Bindings, and Contracts); your job will be easier when you have some idea about the components. You could pass the endpoint URL to the constructor, but it shouldn't be needed - both the URL and the binding should be taken from the configuration line.

    Also, you can throw away the line with response = new RaterService.SoapRateResult(). It does nothing useful and the value is immediately overwritten on the next line.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,892 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,772 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans