// Create the server object. Note the use of the constant to define custom login.
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 new order number.
OrderCreationSpec spec = new OrderCreationSpec()
{
BaseOrderNumber = @"MyOrderNumber",
Prefix = @"Pre",
Suffix = @"Suf"
}
using ( IOrder order = ot.CreateOrder(spec) )
....
How to set profile when creating a order through API?
Moderator: Phil Barton
How to set profile when creating a order through API?
How can I set the profile when creating an order? Thanks.
Re: How to set profile when creating a order through API?
The profile used is the one associated with the user with which the network credential instance is created.
Can you be more specific about what you are trying to achieve?
Can you be more specific about what you are trying to achieve?
Re: How to set profile when creating a order through API?
When creating a instance of "SelectServer", it has a "CurrentProfile" as readonly. I want to know how I can change the Profile dynamically to create order for different profile, let say the user account has multiple profiles associated.
I tried to subscribe the SelectServer.ChooseProfile event but the event was never raised.
Thanks.
Kevin
I tried to subscribe the SelectServer.ChooseProfile event but the event was never raised.
Thanks.
Kevin
Re: How to set profile when creating a order through API?
The OrderCreationSpec class passed in as an argument to OrderTracking.CreateOrder(spec) lets you specify the OwningProfileID upon order creation. Equivalently, once an order is created, you can change its associated profile through the IOrder.OwningProfileID property.
Down the road, we plan to provide a ProfileManagement API with which you will be able to inspect the profiles associated with a trustee. For the time being, you can retrieve the profile IDs you need directly from the database.
Down the road, we plan to provide a ProfileManagement API with which you will be able to inspect the profiles associated with a trustee. For the time being, you can retrieve the profile IDs you need directly from the database.
Re: How to set profile when creating a order through API?
What about when templates are attached to a profile. We use unique profiles for each brach. Each of these profiles has unique templates associated with them. We would like to create an order using the API, assign it to a profile, and make sure that the templates are executed when the order is created.
Robert