Soap Service Authentication

I am testing connecting to the SOAP Web Service via a .NET application and all attempted requests get a 405 Method Not Found response. I think this may be because i am using basic authentication which is no longer an option for the SOAP service?

The guide suggests setting up OAUTH authentication however this is not an option for me since the sage x3 instance is not public facing.

Can anyone confirm if it is the case basic authentication will not work and if there is a way to use OAUTH without making the sage instance public facing?

Parents
  • What version of X3 are you on, and what version of .net are you using?  X3 uses basic authentication for the SOAP web services since version 8.  I believe the way to call X3 web services from SOAP is difference from .net Core, but if you are using a standard Console/WinForms/Web application, it should work with basic authentication.

  • in reply to Denise Hartman

    Hi Denise,

    do you know wich is the way to call X3 web service SOAP from .net core?

    Thanks for all!

  • in reply to Carles Homs Ferrer

    Hi ,

    I have an old example (10 years old) in C# based on sales order example (SOH object):

    // XML Header to be included in all xml input strings
            private static string XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
    
            // Public name of the web service
            private static string WEB_SERVICE_NAME = "SOH";
    
            public Orders()
            {
                InitializeComponent();
    
                // Initialise connection values
                callContext = new CAdxCallContext();
                webService = new CAdxWebServiceXmlCCService();
                paramKey = new CAdxParamKeyValue[1];
                resultXML = new CAdxResultXml();
    
                callContext.codeLang = "BRI";          // Connection language
                callContext.codeUser = "admin";        // X3 user
                callContext.password = "";             // X3 password
                callContext.poolAlias = "WS_DEMOBRI";  // Connection pool name
            }
    
            /// <summary>
            /// This is called when the Read button is clicked.
            /// The program uses the field values to construct input XML
            /// and calls the read() method.
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void Read_Click(object sender, EventArgs e)
            {
                // Complete call context depending on flags
                if (DisplayTraceFile.Checked)
                    callContext.requestConfig = "adxwss.trace.on=on&adxwss.trace.size=16384&adonix.trace.on=on&adonix.trace.level=3&adonix.trace.size=8";
                else
                    callContext.requestConfig = "adxwss.trace.on=off&adxwss.trace.size=16384&adonix.trace.on=off&adonix.trace.level=3&adonix.trace.size=8";
    
                // Prepare paramKeyValue
                paramKey[0] = new CAdxParamKeyValue();
                paramKey[0].key = "1";  // Other method: paramKey[0].key = "SOHNUM";
                paramKey[0].value = SOHNUM.Text;
                // When more than one field in the object key, complete as follows:
                // paramKey[1] = new CAdxParamKeyValue();
                // paramKey[1].Key = "2";
                // paramKey[1].value = ...
    
                // Call web service
                resultXML = webService.read(callContext, WEB_SERVICE_NAME, paramKey);
    
                displayMessages(resultXML);
    
                if (resultXML.status == 0)
                {
                    Status.Text = "Status: NOT OK";
                }
                else
                {
                    Status.Text = "Status: OK";
                    displayData(resultXML);
                }
    
            }

Reply
  • in reply to Carles Homs Ferrer

    Hi ,

    I have an old example (10 years old) in C# based on sales order example (SOH object):

    // XML Header to be included in all xml input strings
            private static string XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
    
            // Public name of the web service
            private static string WEB_SERVICE_NAME = "SOH";
    
            public Orders()
            {
                InitializeComponent();
    
                // Initialise connection values
                callContext = new CAdxCallContext();
                webService = new CAdxWebServiceXmlCCService();
                paramKey = new CAdxParamKeyValue[1];
                resultXML = new CAdxResultXml();
    
                callContext.codeLang = "BRI";          // Connection language
                callContext.codeUser = "admin";        // X3 user
                callContext.password = "";             // X3 password
                callContext.poolAlias = "WS_DEMOBRI";  // Connection pool name
            }
    
            /// <summary>
            /// This is called when the Read button is clicked.
            /// The program uses the field values to construct input XML
            /// and calls the read() method.
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void Read_Click(object sender, EventArgs e)
            {
                // Complete call context depending on flags
                if (DisplayTraceFile.Checked)
                    callContext.requestConfig = "adxwss.trace.on=on&adxwss.trace.size=16384&adonix.trace.on=on&adonix.trace.level=3&adonix.trace.size=8";
                else
                    callContext.requestConfig = "adxwss.trace.on=off&adxwss.trace.size=16384&adonix.trace.on=off&adonix.trace.level=3&adonix.trace.size=8";
    
                // Prepare paramKeyValue
                paramKey[0] = new CAdxParamKeyValue();
                paramKey[0].key = "1";  // Other method: paramKey[0].key = "SOHNUM";
                paramKey[0].value = SOHNUM.Text;
                // When more than one field in the object key, complete as follows:
                // paramKey[1] = new CAdxParamKeyValue();
                // paramKey[1].Key = "2";
                // paramKey[1].value = ...
    
                // Call web service
                resultXML = webService.read(callContext, WEB_SERVICE_NAME, paramKey);
    
                displayMessages(resultXML);
    
                if (resultXML.status == 0)
                {
                    Status.Text = "Status: NOT OK";
                }
                else
                {
                    Status.Text = "Status: OK";
                    displayData(resultXML);
                }
    
            }

Children