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 CRM (Archived)

The remote server returned an error:(404) Not Found.

(0) ShareShare
ReportReport
Posted on by

I am creating xml object of particular entity record and send to the server.

The code was working fine till yesterday.

Now, i am not able to send the data most of time and getting following error.

0572.error.png

   

*This post is locked for comments

I have the same question (0)
  • MSCRM Guru Profile Picture
    600 on at

    Hey,

    Can you share the code? Hard to help with little to go on...  Is this in Dynamics 365 Online or some version of OnPrem?

    Good luck!

  • Community Member Profile Picture
    on at

    Thanks for reply,
    I am working on Dynamics 365 Online.

    I able to hit my service through the plugin.

    but Service endpoint throw  exception 


    Plugin code:

    WebClient webClient = new WebClient();
    DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(string));
    MemoryStream mem = new MemoryStream();
    ser.WriteObject(mem, order);
    string data = Encoding.UTF8.GetString(mem.ToArray(), 0, (int)mem.Length);
    webClient.Headers["Content-type"] = "application/json";
    webClient.Encoding = Encoding.UTF8;
    serres = webClient.UploadString("xxxxxxxxxxxxxxx/.../PlaceOrder", "POST", data);


    Service Code:
    public string PlaceOrder(string order)
            {
    
                try
                {
                    counter++;
                    HttpWebRequest request = null;
                    string destinationUrl = "api endpoint";
    
                    request = (HttpWebRequest)WebRequest.Create(destinationUrl);
                    byte[] bytes;
                    bytes = System.Text.Encoding.ASCII.GetBytes(order);
                    request.ContentType = "application/xml; encoding='utf-8'";
                    request.ContentLength = bytes.Length;
                    request.Method = "POST";
                    Stream requestStream = request.GetRequestStream();
                    requestStream.Write(bytes, 0, bytes.Length);
                    requestStream.Close();
                    using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
                    {
                        if (response.StatusCode == HttpStatusCode.OK)
                        {
                            Stream responseStream = response.GetResponseStream();
                            string responseStr = new StreamReader(responseStream).ReadToEnd();
                            order = responseStr;                        
                           
                        }
                        else
                        {
                            order = response.ToString();
                        }
                    }
    
                    return order;
                }
                catch (Exception exp)
                {                
                    return exp.Message.ToString();
                }
                
            }



  • Verified answer
    Emre GULCAN Profile Picture
    2,379 on at

    Hi Pawan,

    Your exception is completely clear, 404 Not Found ==> your endpoint not exists (or your server not reachable).

    Can you open your endpoint url with browser or outside your plugin codes (such as console app).

    Other important point, you can not use IP address to call any webservice inside plugin / workflow assembly, D365 doesn't allow this, use domain / subdomain

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans