locked
Not working on Client side RRS feed

  • Question

  •  

    Dear all.

    I write a java script code, calling a web service, the code work probably when i run the CRM on the server side, but when i try it from the client side nothing happened and no error.

     

     

    This is the code in quote product

     

    var d = new Date();

    var sd = d.getDate() + d.getTime();

     

     

    if ( crmForm.FormType == 1 )

    {

    var url = "http://autotech-crm:1122/CarStatus/Service1.asmx/checkCarStatus";

                var msg = "";

     

                try

                {                                                          

                            var oXmlHTTP = new ActiveXObject("Msxml2.XMLHTTP");

                            oXmlHTTP.Open("POST", url, false);

                            oXmlHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")

                           

                            var prdId = crmForm.all.productid.DataValue[0].id;

                            //alert( prdId );

                            var obj = "obj=" + prdId + "&tm=" + sd+ "&op=quote"; 

                            oXmlHTTP.Send(obj);   

                                                                           

                            var result = "";  

     

                            if ((oXmlHTTP.responseXML.xml) != null

                                        && (oXmlHTTP.responseXML.xml.toString().length > 0))

                            {

                                        result = oXmlHTTP.responseXML.selectSingleNode("string").text;

    //alert(result);

                            }

                           

                            msg = result;

                            //alert(msg);

                }

                catch(e)

                {

                            msg = "There was an error with your submission. Please try again. Error:" + e.message;

    //alert(msg);

                } 

     

                if(msg.length > 0)

                {

                            alert(msg);

                            event.returnValue = false;

                }

    }

     

     

     

    please any advice

    Best regards.

     

    Thursday, January 24, 2008 10:38 AM

Answers

All replies

  • Check your URL http://autotech-crm:1122

     

    is it client machine URL,

     

    Regards,

    Imran

     

    Thursday, January 24, 2008 10:48 AM
    Moderator
  • Dear Imran ,

    this is the name of the server , and the port of the web site on the IIS where the application found.

     

    Thursday, January 24, 2008 11:28 AM
  • Hi Ala,

     

    It might be a security issue, check the permission on IIS of 'http://autotech-crm:1122/CarStatus/Service1.asmx/checkCarStatus',

     

    Regards,

    Jim

    Thursday, January 24, 2008 4:32 PM
    Moderator