Jump to content

Soap Service Method Not Found


 Share

Recommended Posts

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;
  }
}

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...