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)

Error calling WCF Web Service from Web App in same AX instance

(0) ShareShare
ReportReport
Posted on by 1,085

Hello,

I have a really weird problem with my ASP.NET MVC Web Application which calls Web Service (custom service) in same AX instance. So both Web Application and Custom Services are running in same AX instance.

If I run my Web Application in my workstation under Visual Studio and call there AX's Custom Services they work perfectly. But If I install Web Application into AX's IIS and then call those Custom Services  I get error like below:

No connection could be made because the target machine actively refused it 182.17.64.162:8201

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 182.17.64.162:8201

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SocketException (0x274d): No connection could be made because the target machine actively refused it 182.17.64.162:8201]

  System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +273

  System.Net.Sockets.Socket.Connect(EndPoint remoteEP) +162

  System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout) +685

[EndpointNotFoundException: Could not connect to net.tcp://sfsolar3:8201/DynamicsAx/Services/TETWebServicesForWebUIServiceGroup. The connection attempt lasted for a time span of 00:00:03.0063006. TCP error code 10061: No connection could be made because the target machine actively refused it 182.17.64.162:8201. ]

So, connection from Web Application into Custom Service are refused even if they run in same AX instance.

I have added net.tcp to my Web Applications protocols so there are two protocols http and tcp.net but it didn't help.

What could cause this kind of behavior, what to do to get rid of it and get those two different parts to run in same AX instance?

Best Regards,

Michael

 

 

 

*This post is locked for comments

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

    The error says that endpoint net.tcp://sfsolar3:8201/DynamicsAx/Services/TETWebServicesForWebUIServiceGroup was not found. Can you verify that it is correct? Can you connect to this endpoint by other applications, e.g. WCF Test Client; from the machine with IIS? What if you use IP or a loopback address (if it's on the same machine)?

    By the way, the biggest difference between your two cases is that it runs under your account in Visual Studio and under an application pool account on IIS, which may have completely different permissions. Also the configuration may be different.

    Unfortunately it's a very generic error, so it's hard to say what exactly goes wrong.

  • Michael_Land Profile Picture
    1,085 on at

    Thanks Martin for your answer.

    I will test Custom Service also using WCF Test Client in AX environment and from my workstation.

    I made a own pool in IIS for this Web App calling these Custom services, but what could be the different permissions and where to set them? Creating pool in IIS is so simple versus setting permissions in AX.

    I e.g. set WCF settings with AX Configuration but that didn't help.

    Br

    Michael

  • Michael_Land Profile Picture
    1,085 on at

    Hello Martin,

    I tested Custom Services in AX-host using WCF Test Client and Services works well. So running from Workstation and also in AX-host when using WCF Test Client.

    So, is that a WebApp or Pool problem...

    Br

    Michael

  • Michael_Land Profile Picture
    1,085 on at

    Okey, now I got error also from WCF Test Client when I tried to add Service into WCF Test Client using AX-host's IP-address in Service URL. Then error message was:

    "Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata."

    So, adding URL

    182.17.64.162/.../TETWebServicesForWebUIServiceGroup gave Metadata error.

    Using

    http://sfsolar3:8201/DynamicsAx/Services/TETWebServicesForWebUIServiceGroup  worked

    Any sense, Is it possible to define Endpoints to Custom Services?

    Br

    Michael

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