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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

(0) ShareShare
ReportReport
Posted on by 547

I am trying to connect from CRM Plugin to External SOAP API. It gives me error.

I am using Isolation Mode as None. When I connect the same API using Console APP it works fine. I executed the Console APP from Server and it connects and responds Fine.

I googled a bit got some leads but probably I lack capability to understand/ pinpoint the issue.

Code Snippet below

 

WebRequest request = WebRequest.Create("URL");                  

                    request.Method = "GET";

                    request.Credentials = new NetworkCredential("USERNAME", "PASSWORD");

                    WebResponse response = request.GetResponse();

                    HttpWebResponse webresponse = (HttpWebResponse)response;
                    if (webresponse.StatusCode == HttpStatusCode.OK)
                    {
                        tracing.Trace($" Resposne is correct i.e OK");

                    }

When I debug using Plugin Registration Tool, Tool breaks up and exits.


Error from Tracing:

 

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond


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

       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
       --- End of inner exception stack trace ---
       at System.Net.HttpWebRequest.GetResponse()

 

CRM Version 1612 (8.2.2.112) (DB 8.2.2.112)
* .Net Framework 4.5.2

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    This is happening because CRM is restricting to connect with that API.

    In console, you are doing it on your local machine. Please connect with your network team to resolve this issue.

  • chikhaleankush Profile Picture
    547 on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    I am afraid there is any dedicated Network Team except IT Admin. I guess I will have to address the issue myself.

    Could you please lead me closer to the problem which in turn could help me resolve issue.

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    Check the firewall of your CRM server and try to browse web API from server.

    If you can access it then no issue.

    IT Admins are best guy to resolve your issue.

  • chikhaleankush Profile Picture
    547 on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    I tried connecting Web API via IE and it was successfully connected.

    Will try to find some more Information from IT

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    Ok.

    Have you merged DLLs of third party?

    Use ILmerge tool to merge dll.

  • chikhaleankush Profile Picture
    547 on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    No I have no external DLL's Merged and hence No need for ILmerge. Simple HTTPClient connect I am trying to use.

  • Suggested answer
    Temmy Wahyu Raharjo Profile Picture
    2,914 on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    Usually I will create console application and deploy it into the CRM front end server to testing my code can run first. If on that front end you can debug, just debug it.

  • chikhaleankush Profile Picture
    547 on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    I already did that.

    "When I connect the same API using Console APP it works fine. I executed the Console APP from Server and it connects and responds Fine."

  • RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    Hi,

    Did you verify if you are able to connect to the api from your CRM server?

  • chikhaleankush Profile Picture
    547 on at
    RE: CRM OnPrem--> Plugin--> Connect to External (SOAP) Webservice Error with connection

    You Mean by Server on which On Prem CRM is hosted. Yes I did tried it from there and it worked.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans