API’s fail after SoftPro SDK update
Posted: Fri Jan 29, 2021 2:47 pm
API’s fail after SoftPro SDK update
Previous dll(s) version: 4.3.50811.25
Current dll(s) version: 4.3.60210.108
Main Exception:
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at SoftPro.ClientModel.Server.CreateService(IServiceContainer container, Type serviceType)
at System.ComponentModel.Design.ServiceContainer.GetService(Type serviceType)
at SoftPro.ClientModel.Server.GetService(Type serviceType, Boolean ensureAuthenticated)
at SoftPro.Select.Client.SelectServer.GetService(Type serviceType)
at SoftPro.Select.Client.SelectServer.GetService[T]()
at ClaySys.Tryon.SPIntegration.DAL.OrderDAL.GetOrderStatus(String orderID) in [path]\ClaySys.Tryon.SPIntegration\DAL\OrderDAL.cs:line 98
at ClaySys.Tryon.SPIntegration.OrderService.GetOrderStatus(String orderId) in [path]\ClaySys.Tryon.SPIntegration\Order.svc.cs:line 37
InnerException:
Message: The type initializer for 'SoftPro.Select.Client.Formula.FormulaCompilationConfiguration' threw an exception.
Source: SoftPro.OrderTracking.Client
StackTrace:
at SoftPro.OrderTracking.Client.Orders.OrderStoreProvider..ctor(IServiceProvider site, Uri uri, Boolean profilerEnabled)
at SoftPro.OrderTracking.Client.Orders.OrderStore..ctor(IServiceProvider site)
InnerException:
Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source: mscorlib
StackTrace:
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at SoftPro.Select.Client.Formula.FormulaCompilationConfiguration.AddPreconfiguredProviders()
at SoftPro.Select.Client.Formula.FormulaCompilationConfiguration..ctor()
at SoftPro.Select.Client.Formula.FormulaCompilationConfiguration..cctor()
Sample Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:GetOrderStatus>
<tem:orderId>DEV201XXXXXX3</tem:orderId>
</tem:GetOrderStatus>
</soapenv:Body>
</soapenv:Envelope>
Sample Method/Code:
public string GetOrderStatus(string orderID)
{
// Getting UserName & Password from config file
string strUserName = ConfigurationManager.AppSettings["UserName"];
string strPwd = ConfigurationManager.AppSettings["Password"];
string strDomain = ConfigurationManager.AppSettings["Domain"];
string SoftProUri = ConfigurationManager.AppSettings["SoftProUri"];
NetworkCredential creds = new NetworkCredential(strUserName, strPwd, strDomain);
using (SelectServer serverObject = new SelectServer(new Uri(SoftProUri), creds))
{
string reason;
if (!serverObject.TryAuthenticate(out reason))
{
throw new Exception(reason);
}
// Search orders for matching order number.
IOrderStore orderStoreObject = serverObject.GetService<IOrderStore>(); //ERROR THROWN FROM HERE
IOrderInfo search = orderStoreObject.Orders.Where(t => t.Number == orderID).FirstOrDefault();
if (search != null)
{
return search.OrderStatus.ToString();
}
return null;
}
}
NB: The service "SoftPro Select Server" runs in the same dev machine and is using the latest dll’s (4.3.60210.108).
Previous dll(s) version: 4.3.50811.25
Current dll(s) version: 4.3.60210.108
Main Exception:
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at SoftPro.ClientModel.Server.CreateService(IServiceContainer container, Type serviceType)
at System.ComponentModel.Design.ServiceContainer.GetService(Type serviceType)
at SoftPro.ClientModel.Server.GetService(Type serviceType, Boolean ensureAuthenticated)
at SoftPro.Select.Client.SelectServer.GetService(Type serviceType)
at SoftPro.Select.Client.SelectServer.GetService[T]()
at ClaySys.Tryon.SPIntegration.DAL.OrderDAL.GetOrderStatus(String orderID) in [path]\ClaySys.Tryon.SPIntegration\DAL\OrderDAL.cs:line 98
at ClaySys.Tryon.SPIntegration.OrderService.GetOrderStatus(String orderId) in [path]\ClaySys.Tryon.SPIntegration\Order.svc.cs:line 37
InnerException:
Message: The type initializer for 'SoftPro.Select.Client.Formula.FormulaCompilationConfiguration' threw an exception.
Source: SoftPro.OrderTracking.Client
StackTrace:
at SoftPro.OrderTracking.Client.Orders.OrderStoreProvider..ctor(IServiceProvider site, Uri uri, Boolean profilerEnabled)
at SoftPro.OrderTracking.Client.Orders.OrderStore..ctor(IServiceProvider site)
InnerException:
Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source: mscorlib
StackTrace:
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at SoftPro.Select.Client.Formula.FormulaCompilationConfiguration.AddPreconfiguredProviders()
at SoftPro.Select.Client.Formula.FormulaCompilationConfiguration..ctor()
at SoftPro.Select.Client.Formula.FormulaCompilationConfiguration..cctor()
Sample Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:GetOrderStatus>
<tem:orderId>DEV201XXXXXX3</tem:orderId>
</tem:GetOrderStatus>
</soapenv:Body>
</soapenv:Envelope>
Sample Method/Code:
public string GetOrderStatus(string orderID)
{
// Getting UserName & Password from config file
string strUserName = ConfigurationManager.AppSettings["UserName"];
string strPwd = ConfigurationManager.AppSettings["Password"];
string strDomain = ConfigurationManager.AppSettings["Domain"];
string SoftProUri = ConfigurationManager.AppSettings["SoftProUri"];
NetworkCredential creds = new NetworkCredential(strUserName, strPwd, strDomain);
using (SelectServer serverObject = new SelectServer(new Uri(SoftProUri), creds))
{
string reason;
if (!serverObject.TryAuthenticate(out reason))
{
throw new Exception(reason);
}
// Search orders for matching order number.
IOrderStore orderStoreObject = serverObject.GetService<IOrderStore>(); //ERROR THROWN FROM HERE
IOrderInfo search = orderStoreObject.Orders.Where(t => t.Number == orderID).FirstOrDefault();
if (search != null)
{
return search.OrderStatus.ToString();
}
return null;
}
}
NB: The service "SoftPro Select Server" runs in the same dev machine and is using the latest dll’s (4.3.60210.108).