API’s fail after SoftPro SDK update

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
binoj.v
Posts: 2
Joined: Mon Jan 25, 2021 7:16 pm

API’s fail after SoftPro SDK update

Post by binoj.v »

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).
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: API’s fail after SoftPro SDK update

Post by BobRichards »

You need to drill down and get the information from the LoaderExceptions. It will give you the names of the executable it could not find. This topic give more information on the process.
Bob Richards, Senior Software Developer, SoftPro
binoj.v
Posts: 2
Joined: Mon Jan 25, 2021 7:16 pm

Re: API’s fail after SoftPro SDK update

Post by binoj.v »

Thanks for the response Bob. I wasn't aware of LoaderException. The details in that exception pointed that IronPython library was missing from the system and the locations where it was searching for this particular dll. Hence, even though not needed in project I am working on, I referenced it via nuget and it worked fine there-on.
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: API’s fail after SoftPro SDK update

Post by BobRichards »

Great! I'm glad you are up and running. As you determined, the Python DLL is used in our "FormulaCompilationConfiguration" class. I wish .NET could bubble up the name of unfound dependencies to an Event Log message with the DLL name(s) - but I also wish I had a million dollars (sigh).
Bob Richards, Senior Software Developer, SoftPro
Post Reply