NetworkCredential credential = new NetworkCredential(@"<username>", @"<password>", SoftPro.Select.Client.Constants.SelectDomain);
SelectServer server = new SelectServer(null, new Uri(@"http://localHost:80/SelectServer"), credential);
// Create the order tracking client
SoftPro.OrderTracking.Client.OrderTracking ot = server.GetService<SoftPro.OrderTracking.Client.OrderTracking>();
// Create the specification for the existing order.
OrderQuerySpec spec = new OrderQuerySpec()
{
BaseOrderNumber = @"MyOrderNumber",
Prefix = @"Pre",
Suffix = @"Suf"
};
// Open the order
using (IOrder order = ot.GetOrder(spec, true))
{
try
{
// TODO: Manipulate the order
}
finally
{
// This MUST be called to release any locks on the order
ot.CloseOrder(order);
}
}
I have created a custom user and password, and specified this in the call to create the Network credential.
That error occurs when our Rules Engine does not load any business rules from the targeted assemblies. The assemblies we reflect upon to gather the rule definitions are identified by the Select Server - there is a "BusinessRuleAssemblies" attribute on the Integration service. Please provide the attribute values for your Integration service by running the SPS utility:
The assemblies listing from SPS looks to be correct. In addition, the rules assembly file must be in the same directory as the executing assembly, so be sure that the SoftPro.BusienssRules.Core.dll file is in the same location as the Select Server client.
Thanks Mark it was missing the file. I have it set to Copy Local, but for some reason it still wasn't in the output directory (this is a small Winform demo program).
However, I still can't get the order, and I'm wondering if I have a data configuration issue with my local SP database. The error message I'm getting now is: "Could not find the data value requested: \"AdditionalCharges\"" I'm running build 2.2.20912.77. Nothing in the event log.
Be sure all the assemblies are in the same directory. Probably the best way to assure this is to have your custom binaries dropped into our SoftPro installation directory so that all the dependencies may be resolved. There are all sorts of auxiliary files beyond the DLLs that contribute to the framework Select runs under - so even if your binaries compile and the .NET assembly references are resolved, you could be missing out on some critical XML configuration data, for example.
Message = "Could not find the data value requested: \"AdditionalCharges\""
Source = "SoftPro.BusinessObjects.Base"
StackTrace = " at SoftPro.BusinessObjects.Base.BusinessObjectBase.GetDataValue(String dataItemName)\r\n at SoftPro.BusinessObjects.Base.Engine.WalkPathToLeafObjects(PathStep[] path, IBusinessObject startContext, IBusinessObject[]& foundObjects, List`1& valsEncounter...
I'm working on a proof-of-concept application, so this isn't a show-stopper, but I could see it as a problem in the future when we start implementing our Order notification event handler.
I need to re-open this thread, since I'm now working on our Order Notification Event Handler. I'm running into the same issue I was before, not being able to get the Business Rules loaded. The error message is simply: "Failed to load the SoftPro business rules for order."
I ran the sps command, and I notice this that the BusinessRuleAssemblies attribute is not listed.
The BusinessRuleAssemblies service attribute you noted has been deprecated. When the application starts, Select will look in the application directory for any files matching the pattern *.rules. Any files found must contain a line-delimited listing of assemblies (without file extensions) that will be reflected upon, from which Select will attempt to discover business rules. We provide one default file named SoftPro.rules that defines one rules assembly (SoftPro.BusinessRules.Core). If you are providing your own set of business rule assemblies, then you should provide your own rules file that identifies your custom rule assemblies.
Note that the rules file and the targeted rules assembly must both exist in the Select.exe application directory.
LoadOrderActivity:: Error: Could not find the data value requested: "AdditionalCharges",
Stack Trace:
at SoftPro.BusinessObjects.Base.BusinessObjectBase.GetDataValue(String dataItemName) at SoftPro.BusinessObjects.Base.Engine.WalkPathToLeafObjects(PathStep[] path, IBusinessObject startContext, IBusinessObject[]& foundObjects, List`1& valsEncountered, Int32& maxChildrenFound) at SoftPro.BusinessObjects.Base.Engine.GetDependencyValues(DataItemReference dataItem, IBusinessObject start, List`1& depen