Jump to content

Graeme Faulkner

Members
  • Posts

    12
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Graeme Faulkner

  1. I am using the Export Web Service (AOWSEXPORT) to export data from export templates. I can filter the result by updated date using the following:

    UPDDAT > gdat$({DateTime.Now.AddDays(-1):d,M,yy}

    I cannot find the equivalent for date / time

    I have tried using getdattime with same format as the UPDDATTIM field it is exported however this does not seem to work:

    UPDDATTIM > gdattime$('2022-09-15T06:27:09Z')

     

  2. I can successfully get a list of customers using the "SOAP generic web services" screen with the following values

    Query
       Language Code = ENG
       Pool Alias = ADC
       Public name = BPC
       Object keys = none
       List size = 100

    When invoke a similar request for ITM I get the error "X3 subprogram (AWEB:RECUPHDAT) that reads web services [ITM] timestamp returned the status [Unknown web service (0)] and timestamp []."

    Query
       Language Code = ENG
       Pool Alias = ADC
       Public name = ITM
       Object keys = none
       List size = 100

    Both BPC and ITM are listed in "import/export templates" and are enabled for "Export"

  3. I am testing connecting to the SOAP Web Service via a .NET application and all attempted requests get a 405 Method Not Found response. 

    The guide suggests setting up OAUTH authentication however since the x3 instance is not public facing I have added basic authentication to the request header.

    I am using version 12 (IDDN.FR.001.120009.xxx.2016) on a demo VM.

    I can successfully get a list of customers using the "SOAP generic web services" screen with the following values

    Query
       Language Code = ENG
       Pool Alias = ADC
       Public name = BPC
       Object keys = none
       List size = 100

    When called using the code below, I always get the error: 'The request failed with HTTP status 405: Method Not Allowed.'

    static string _x3WSUr1 = "https://x3erpv12sqlvm.local:8443/soap-wsdl/syracuse/collaboration/syracuse/CAdxWebServiceXmlCC?wsdl";
    static CAdxWebServiceXmlCCService _x3WebService = new CAdxWebServiceXmlCCServiceBasicAuth();
    static CAdxCallContext _callContext = new CAdxCallContext();
    static CAdxResultXml _resultXML = new CAdxResultXml();
    
    static void Main(string[] args)
    {
    	_callContext.codeLang = "ENG";
    	_callContext.poolAlias = "ADC";
    	_callContext.requestConfig = "adxwss.trace.on=off&adxwss.trace.size=16384&adonix.trace.on=off&adonix.trace.level=3&adonix.trace.size=nadxwss.optreturn=1SON&adxwss.beautify=true";
    	_x3WebService.Url = _x3WSUr1;
    	_x3WebService.Credentials = new NetworkCredential("...", "...");
    	_x3WebService.PreAuthenticate = true;
    	_x3WebService.Timeout = 6000000;
    
    	ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; // fix for trust relationship error
    
    	CAdxParamKeyValue[] objectKeys = new CAdxParamKeyValue[1];
    
    	_resultXML = _x3WebService.query(
    		callContext: _callContext,
    		publicName: "BPC",
    		objectKeys: objectKeys,
    		listSize: 100);
    }
    
    }
    public class CAdxWebServiceXmlCCServiceBasicAuth : CAdxWebServiceXmlCCService
    {
      protected override WebRequest GetWebRequest(Uri uri)
      {
          HttpWebRequest webRequest = (HttpWebRequest)base.GetWebRequest(uri);
          NetworkCredential credentials = Credentials as NetworkCredential;
    
          if (credentials != null)
          {
              string authInfo = "";
              if (credentials.Domain != null && credentials.Domain.Length > 0)
              {
                  authInfo = string.Format(@"{0}\{1}:{2}", credentials.Domain, credentials.UserName, credentials.Password);
              }
              else
              {
                  authInfo = string.Format(@"{0}:{1}", credentials.UserName, credentials.Password);
              }
              authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
              webRequest.Headers["Authorization"] = "Basic " + authInfo;
          }
    
          return webRequest;
      }
    }

     

×
×
  • Create New...