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)

Ax2012 - Anyone got success retrieving HTTP WSDL webservices from NON-VisualStudio tool?

(0) ShareShare
ReportReport
Posted on by 685

Hi all.

Has anyone succeeded in testing any Ax2012 http web services with SOAPui or similar?

I got an Ax2012 installation, with the TestEmployee example of MSDN running and working OK. In order to test this service from outside the intranet, I've installed Web Services in ISS.

 

When accessing with explorer:

http:/IP:8103/MicrosoftDynamicsAXAif60/EmployeeTestServiceGroupHTTP/xppservice.svc?wsdl gives me the WSDL document with schema.

http://IP:8103/MicrosoftDynamicsAXAif60/EmployeeTestServiceGroupHTTP/xppservice.svc the server gives me a message stating that a service was created and that I can use svcutil to create a class to use it in C# or VB.

In both cases, system asks me for user, domain and password.

 

When accessing from other systems, per example, SOAPui program, or an Android http client:

http:/IP:8103/MicrosoftDynamicsAXAif60/EmployeeTestServiceGroupHTTP/xppservice.svc?wsdl gives me the WSDL document with schema. Note that I give user, domain and password in each method and I can access this wsdl document.

 

So, I should have no problem in trying the getEmployee method. No success.

The raw text sent is:

POST http://IP:8103/MicrosoftDynamicsAXAif60/EmployeeTestServiceGroupHTTP/xppservice.svc HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://tempuri.org/EmployeeServiceTest/getEmployee"

And server resturns:

TTP/1.1 500 Internal Server Error
Content-Length: 777
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
Persistent-Auth: true
X-Powered-By: ASP.NET
Date: Thu, 03 May 2012 13:14:02 GMT

I've tried several ways of authentication, format headers, XML templates...

Can anyone provide some working example that uses HTTP and *DO NOT USE* .net?

*This post is locked for comments

I have the same question (0)
  • Raúl Llorente Peña Profile Picture
    685 on at

    New updates about this issue:

    Tried the example from Walkthrough: Exchanging documents by using the HTTP adapter [AX 2012] link: msdn.microsoft.com/.../hh496418.aspx.

    Surprise, the example in VS2010 gives same error:

    The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

    Google time!!

    Finally, in the subfolder of the web service of AIF, I set <serviceDebug includeExceptionDetailInFaults="True" /> in web.config file.

    Try again the web service from VS2010. Now the message changed to (from VS2010 and SoapUI):

    Error message: Call to SSPI failed; see inner exception

    A bit more of googling...

    And I fall in Troubleshoot services and AIF [AX 2012] link: technet.microsoft.com/.../aa548693.aspx

    "Error message: Call to SSPI failed; see inner exception

    You can encounter this error message when you call a Microsoft Dynamics AX web service if Internet Information Services (IIS) is installed on a separate computer from the Application Object Server (AOS). In this case, if you view the inner exception, the message contains, "Target Principal Name is incorrect." You can also encounter this issue when the AOS account is a user account on the domain.

    To resolve this issue, use the Active Directory Domain Services management tool named Setspn.exe. Use the following command-line syntax:

    setspn -U -A host/Name_of_AOS Domain_name\AOS_service_user_name

    For more information about the Setspn tool, see Setspn Overview on the TechNet website."

    Yes, this Ax2012 environment is distributed between 4 servers: SQL server, TS+VS+AxClient, AOS, and web (EP, Web Services, Help server, and so on). All servers are W2K8 R2 64 bits.

    So, use the setspn as mentioned, and VS2010 example WORKS!!

    But now, when trying to use this same (or similar) Ax2012 web service from SoapUI, IIS returns this error (translated as well as possible for me):

    HTTP/1.1 500 Internal Server Error

    Content-Length: 4041

    Content-Type: text/xml; charset=utf-8

    Server: Microsoft-IIS/7.5

    Persistent-Auth: true

    X-Powered-By: ASP.NET

    Date: Thu, 03 May 2012 20:41:56 GMT

    This channel can no longer be used to send messages as the output session was auto-closed due to a server-initiated shutdown. Either disable auto-close by setting the DispatchRuntime.AutomaticInputSessionShutdown to false, or consider modifying the shutdown protocol with the remote server.

    Any suggestion to continue with this?

  • Raúl Llorente Peña Profile Picture
    685 on at

    OK, went to SoapUI preferences, HTTP Settings, and enabled "Closes the HTTP connection after each SOAP request".

    Now message from IIS is:

    HTTP/1.1 401 Unauthorized

    Content-Type: text/html

    Server: Microsoft-IIS/7.5

    WWW-Authenticate: Negotiate

    WWW-Authenticate: NTLM

    X-Powered-By: ASP.NET

    Date: Thu, 03 May 2012 21:07:37 GMT

    Connection: close

    Content-Length: 1311

    401 - Unauthorized: Access is denied due to invalid credentials.

    You do not have permission to view this directory or page using the credentials that you supplied

    Any tip?.

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    We recently ran into the SSPI error with authentication. We were consuming the native WCF system services running on the AOS, and consuming in a .NET project.

    The setup was the AOS server hosting the services was named X123. It also has a CNAME dns record called SERVER123. When we connected to the WCF using X123, we got the SSPI error. When we used the IP address or the CNAME, it would authenticate properly.

    Using the setSPN for Kerberos fixed the issue with the actual computer name.

    We have some speculations around why it may be skipping Kerberos when using CNAME or IP, but not sure entirely.

  • Raúl Llorente Peña Profile Picture
    685 on at

    Can you try to test that WCF with SoapUI or similar? From inside and outside the windows domain of servers, if possible.

  • Suggested answer
    Mohammed Khatib Profile Picture
    430 on at

    Hello all,

    I was facing such a problem when I was using Help Server component of Microsoft Dynamics AX 2012,

    the main problem for this that the ASP.NET 2.0 is still the main .NET framework for IIS, you need to publish the Microsoft .NET framework 4.0, to make it the default Framework on your machine.

    To do that follow these steps:

    1- Open Cmd

    2- Type cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

    3- type aspnet_regiis /iru

    4- Type IISRESET

    Hope your problem will be solved.

    Thanks

    Regards,

    Mohammed Khatib

  • Suggested answer
    Soren Andersen Profile Picture
    530 on at

    Probably not the best solution - but the following should work.

    Make sure your service binding is BasicHttpBinding on the server side.

    Enable anonymous access on the website.

    Attach your website to an application pool running under af specific user account. which of course should be enabled in Ax.

  • Community Member Profile Picture
    on at

    Hi,

    The setspn is not liking the context, is this what is needed?

    Example, server name is AX2012 and aos account is svcaos

    setspn -U -A host/AX2012 contoso\svcaos

    Thanks!

  • Verified answer
    Raúl Llorente Peña Profile Picture
    685 on at

    Finally I succeeded in retrieve XML from Ax2012 in SOAPUI.

    SoapUI 4.5.1 claims to be compatible with NTLMv2, but it fails in retrieving WSDL. Analyzing with Wireshark, it appears that SoapUI doesn't handle IIS server NTLM requests very well.

    After googling, decided to install Burp Suite as proxy for SoapUI. Now Burp manages all the NTLM protocol handshake instead of SoapUI. It works!!

    There are several important point:s:

    1.- No problem in retrieving WSDL with SoapUI 4.5.0. But simple requests always failed. That's why I upgraded SoapUI from 4.5.0 to 4.5.1. And 4.5.1 seems to be even worse than 4.5.0 in NTLM handshake.

    2.- When trying to execute (by now) simple requests, response was an XLM stating "Failed to logon to Microsoft Dynamics AX". If you look event viewer in AOS box and see (in Application section) something like this:

    Event Id: 110

    Origin: Dynamics Server XX

    Object Server 03:  An error has occurred in the services framework.  Method: AifMessageInspector::AfterReceiveRequest.  Error: System.ServiceModel.FaultException: Failed to logon to Microsoft Dynamics AX.

      at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.InitializeSession()

      at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.InitializeContext()

      at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.Attach(OperationContext owner)

      at System.ServiceModel.ExtensionCollection`1.InsertItem(Int32 index, IExtension`1 item)

      at System.Collections.Generic.SynchronizedCollection`1.Add(T item)

      at Microsoft.Dynamics.Ax.Services.AifMessageInspector.AfterReceiveRequest(Message& request, IClientChannel channel, InstanceContext instanceContext)

    This is probably a bug of Ax. After trying several googled solutions, upgraded Application from Ax 2012 CU2 to Ax 2012 FP, regenerated web services and it now works!!

    3.- Connections don't seem very stable. Several error responses can arise with exactly the same request before succeed.

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