Discussions

Ask a Question
ANSWERED

iMIS cart.AddItem() throws error

We think this has to do with a shipping method and/or payment method or "something" in the cart AddItem process that is required, but not present. However - code has been running fine for years. Someone DID remove Shipping Methods, and we see that Payment Details on the Cart_Home page is missing. The item gets added, but no pricing is there either. cart.AddItem("PRODUCTCODE", Convert.ToDecimal(quantity)); //pseudo The failure occurs in the Asi.Client.ServiceModel dll v20.2.49.5903 Any idea how to trace down this error. I can manipulate the cart further and see which objects are present at the time of the call. Here is the stack trace: Error: Service Error: Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ServiceModel.FaultException: Error: Service Error: Object reference not set to an instance of an object. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [FaultException: Error: Service Error: Object reference not set to an instance of an object. ] Asi.Soa.ClientServices.CartManager.AddLine(OrderLineData line, Uri websiteEditUrl) +497 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity, Uri websiteEditUrl, String sourceCode, String shipToPartyId, String orderLineNote) +755 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity, Uri websiteEditUrl, String sourceCode, String shipToPartyId) +97 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity, Uri websiteEditUrl, String sourceCode) +88 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity, Uri websiteEditUrl) +79 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity) +67 USPTA_InsurancePurchase.USPTA_InsurancePurchaseDisplay.btnCheckout_Click(Object sender, EventArgs e) in c:\Users\ascension\Source\Repos\uspta\USPTA_InsurancePurchase\USPTA_InsurancePurchase\USPTA_InsurancePurchaseDisplay.ascx.cs:553 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11765069 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1665

AddItem throws Object Not Set to Instance of Item

I have an older version of iMIS. Something changed in iMIS and now our custom cart code throws an Object not Set to instance of item... we suspect it may be payment methods or shipping method. Here is stack trace on cart.AddItem() Server Error in '/processor' Application. Error: Service Error: Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ServiceModel.FaultException: Error: Service Error: Object reference not set to an instance of an object. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [FaultException: Error: Service Error: Object reference not set to an instance of an object. ] Asi.Soa.ClientServices.CartManager.AddLine(OrderLineData line, Uri websiteEditUrl) +497 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity, Uri websiteEditUrl, String sourceCode, String shipToPartyId, String orderLineNote) +755 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity, Uri websiteEditUrl, String sourceCode, String shipToPartyId) +97 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity, Uri websiteEditUrl, String sourceCode) +88 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity, Uri websiteEditUrl) +79 Asi.Soa.ClientServices.CartManager.AddItem(String itemId, Decimal quantity) +67 USPTA_InsurancePurchase.USPTA_InsurancePurchaseDisplay.btnCheckout_Click(Object sender, EventArgs e) in c:\Users\ascension\Source\Repos\uspta\USPTA_InsurancePurchase\USPTA_InsurancePurchase\USPTA_InsurancePurchaseDisplay.ascx.cs:553 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11765069 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1665
ANSWERED

Can we get a CURL test for POST to /TOKEN?

We have a third party (mobile app) testing against the exposed iMIS REST API. They are sending this CURL: curl -H "content-type: application/x-www-form-urlencoded" -d '{"grant_type":"password","username":"XXXXXXX","password":"XXXXX}' -v 'https://ourclientdomainiscorrect/Asi.Scheduler_USAB/Token' They receive this error: {"error":"unsupported_grant_type"} Does anyone see a problem with the CURL or could we get a proper CURL to send over to them that assuredly is good to receive the TOKEN? A lot of people use CURL to test. Asking them to switch to Postman is a non-starter. Jack Donahue

OAuth 2.0 - Cross Site access to REST

From my experience the only way to retrieve an OAuth token from REST, from an external client is to use authentication details of a user that is in the RemoteService role when posting. POST: https://MyImisDomain/Asi.Scheduler/token Otherwise, if I remove the user from this role, even for MANAGER, I see the error { "error": "invalid_grant", "error_description": "Not authorized for Services." } Is this correct, do I always have to use the RemoteAccess role or I have I missed something? What rights does the RemoteAccess role grant? From my brief testing it appears to grant access to other unrelated party's data. Is there a way to use REST, cross site, where regular public user authentication can be used and the ClaimsMapping / Templates are honoured?
ANSWERED

"There is no service defined for UserSecurity"

Trying to use the ValidateUser API function and getting this error: 2020-07-10 09:36:44,503 [24] ERROR SQLTC1\TST01:iMIS_TEST [(null)] - Error occured at Uri: https://{{IMISURL}}/Asi.Scheduler_iMIS0/api/UserSecurity/_execute Asi.Soa.Core.Exceptions.ServiceNotFoundException: There is no service defined for UserSecurity at Asi.Scheduler.Controllers.CommonServiceController.GetServiceContextForEntity(String entityName) at Asi.Scheduler.Controllers.CommonServiceController.Execute(String entityName, ExecuteRequestBase request) { "$type": "Asi.Soa.Core.DataContracts.GenericExecuteRequest, Asi.Contracts", "EntityTypeName": "UserSecurity", "OperationName": "ValidateUser", "Parameters": { "$type": "System.Collections.ObjectModel.Collection`1[[System.Object, mscorlib]], mscorlib", "$values": [ "[email protected]", "TESTPASSWORD" ] }, "UseJson": false, "ParameterTypeNames": { "$type": "System.Collections.ObjectModel.Collection`1[[System.String, mscorlib]], mscorlib", "$values": [ "System.String", "System.String" ] } }
ANSWERED

Can I write to the communication log via REST?

I believe someone said last week at Innovations that there was an endpoint to write to the communication log via REST. Is that a thing? I'd like to be able to say something like "I sent an email to ID 101 (or ContactKey ABC12...) at 3:45am with this content". Nothing different than what's being logged. Thanks.

REST IQA Result: Proper paging OFFSET

Not sure if my initial question made it through, but ... I am running IQA through REST The initial request is form, giving me the **FIRST** 500 records http://my.instance.com/api/iqa?queryname=$/My/IQA&limit=500 I now want the next 500/100/... records using this form : http://my.instance.com/api/iqa?queryname=$/My/IQA&limit=500?offset=500 However I continue to get the **FIRST** 500 records. Any help would be appreciated -- Thanks
ANSWERED

Sorting the data of a table using REST API Call?

Hi ASI, How can we sort the data we get, so that it is sorted by some other fields in the table like Date or Amount Also, iMIS usually sends 100 results via REST, can we increase this no. I know we can do offset, but is there a way to increase it somehow? Endpoint: http://{{URL}}/api/Name_CEU

When we have issues with SOA where do we go for answers?

Is the SOA supported by ASI? Can they answer questions such as: SOA throws an error ""SecurityFault: An error occurred. Please contact the administrator." -- Where do we go to get answers with this sort of vague message?
ANSWERED

Updating a multi-instance user defined table (GET and PUT request REST API) created through Panel Editor not iMIS Desktop

I have a client who's REST API calls where working in iMIS Version 20.2.46. Now they have upgraded to iMIS 2017 SP M and the previous API calls are just not working anymore. i.e. GET request from multi-instance user defined table https://{url}/Asi.Scheduler_iMIS/api/StudentGrades/20303,2 used to work Now only https://{url}/Asi.Scheduler_iMIS/api/StudentGrades?ContactKey=2015287&Ordinal=2 returns this one unique record. The PUT request used to work now it simple states 405 { "$type": "System.Web.Http.HttpError, System.Web.Http", "Message": "The requested resource does not support http method 'PUT'." } What am I missing here? Any pointer is much appreciated. Thanks much, Alex