This discussion is archived
1 Reply Latest reply: Nov 12, 2013 4:45 AM by Marco Snels (AortaBI)(NL) RSS

Endeca.Data.ConnectionException: Could not connect to Endeca Server/MDEX Engine. I am using MDEX 6.4.1. Getting a 404 Error.

539a677d-86fd-43e7-9987-6fa107791ee7 Newbie
Currently Being Moderated

Hi,

I am new to Endeca. We have an Endeca DEV server, MDEX 6.4.1. Forge is running fine. I am able to connect to the Orange App and getting the products. http://devmachine:8006/endeca_jspref/controller.jsp  (with servername and Port: 15001)

Even tried to connect to get an existing record GetProduct("256782") and still getting the same 404 error. "{"Error reading from the connection.The remote server returned an error: (404) Not Found."}". I could not get why it could not connect to the Server.

Please find below the sample code in C#, I am using to connect and get the records. I tried Web Service approach an could connect too but did not have a cle on how to implement the typeahead with web services. Please find sample code below. It would be great if someone can assist me.

 

===============

 

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Configuration;

using Endeca.Data;

using Endeca.Data.Provider.PresentationApi;

using Endeca.Web;

using Endeca.Web.Url;

using System.Web;

using Endeca.Navigation;

using Endeca.Data.Content.Navigation;

using System.Xml.XPath;

using GroceryNav;

using System.Collections;

//using Endeca.EndecaMdex;

//using Endeca.EndecaDBT;

 

 

namespace Endeca

{

    class Program

    {

        public const string ServerName = "devmachine";

        static void Main(string[] args)

        {

 

 

            string sSearchTerm = string.Empty;

            //EndecaNavDTO objEndecaNav = new EndecaNavDTO();

            PresentationApiConnection objConnection = new PresentationApiConnection(ServerName, 15001);

            //PresentationApiConnection objConnection = new PresentationApiConnection("localhost", 15000);

 

 

            ArrayList arr = SearchTypeAhead("wine");

            //var record = GetProduct("250000068");

        }

 

 

        public static ArrayList SearchTypeAhead(string q)

        {

 

 

            ArrayList objResultArray = new ArrayList();

            CompoundDimensionSearchResult objResult = PerformCompoundDimensionSearch(q);

 

 

            foreach (DimensionValueCollection objDimValCollection in objResult.CompoundDimensionValues)

            {

                for (int iCount = 0; iCount < objDimValCollection.Count; iCount++)

                {

 

 

                    Endeca.Data.DimensionValue dval = objDimValCollection[iCount];

                    var vtypeaheadResult = new

                    {

                        text = dval.DisplayName,

                        urlParams = dval.DisplayName

                    };

                    objResultArray.Add(vtypeaheadResult);

                }

            }

 

 

            return objResultArray;

        }

 

 

        public static CompoundDimensionSearchResult PerformCompoundDimensionSearch(string sQuery)

        {

            PresentationApiConnection objConnection = new PresentationApiConnection(ServerName, 15001);

 

 

            CompoundDimensionSearchCommand objDimensionSearch = new CompoundDimensionSearchCommand(objConnection);

            objDimensionSearch.DimensionValuesPerDimension = 4;

            objDimensionSearch.SearchTerms = sQuery + "*";

            CompoundDimensionSearchResult objDimSearchResult = objDimensionSearch.Execute();

 

 

            return objDimSearchResult;

        }

 

 

        public static Record GetProduct(string sProductKey)

        {

            PresentationApiConnection objConnection = new PresentationApiConnection(ServerName, 15001);

 

 

            //Instantiate record details command, we need it to generate SEO Urls for records

            RecordDetailsCommand recCmd = new RecordDetailsCommand(objConnection);

            recCmd.ID = "rec";

            recCmd.Identifier = sProductKey;

            Record objRecord = recCmd.Execute();

 

 

            return objRecord;

 

 

        }

 

 

    }

 

 

 

 

}

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points