HTTP request worked fine in the Preview but not after clicked on OK button

Hi All

An interesting issue, but challenging.

Process steps::

  1. Token Generation
  2. API 1
  3. API 2

Both API 1 and 2 uses the same token to execute. API 1 is working, but API 2 is not working.

a. The API 2 is working fine in the Postman. I am receiving the API response.
b. The API 2 is working fine in the HTTP request wizard in the Uipath (preview), but not when I run the XAML file.
c. I received the Unauthorized request in the API 2 response. But the token generated in the Uipath is working fine in the Postman for the API 2.
d. I hardcoded the token and tested it, but API 2 did not work.
e. I upgraded the web API package (1.9.2), but API 2 did not work.
f. I tested API 1 in the API 2 XAML file, and API 1 worked fine.

What could be the reason for this issue?

Please help.

Thanks

1 Like

Hey @G3Devi

Kindly provide the request details to understand.

Thanks
#nK

Hi I’m also getting the same error. I tried to input a sample api request by adding valid request parameters. On clicking preview in http request wizard I got success response on clicking Ok in the request wizard I get the below error

Tried to uninstall and install UIPath.WebAPI.Activities. still issue exist. Anyone please help.

Log details:

21.10.5+Branch.support-v21.10.Sha.369f46199a0fa6287d86ab2534b6896019db01bc

Could not load type ‘UiPath.Platform.ResourceHandling.ILocalResource’ from assembly ‘UiPath.Platform, Version=21.10.0.0, Culture=neutral, PublicKeyToken=null’.

Error: System.Exception: Could not load type ‘UiPath.Platform.ResourceHandling.ILocalResource’ from assembly ‘UiPath.Platform, Version=21.10.0.0, Culture=neutral, PublicKeyToken=null’.
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParameters()
at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetProperties(Type type)
at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetProperties()
at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties()
at System.Activities.Presentation.Metadata.MetadataStore.MetadataStoreProvider.MetadataStoreTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties()
at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties()
at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties()
at System.Activities.Presentation.Model.ModelPropertyCollectionImpl.GetPropertyDescriptors()
at System.Activities.Presentation.Model.ModelPropertyCollectionImpl.d__3.MoveNext()
at System.Activities.Presentation.Model.ModelUtilities.WrapProperties(ModelItem item)
at System.Activities.Presentation.Model.ModelItemImpl.System.ComponentModel.ICustomTypeDescriptor.GetProperties()
at System.ComponentModel.TypeDescriptor.MergedTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties()
at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute attributes, Boolean noCustomTypeDesc, Boolean noAttributes)
at System.Windows.PropertyPath.ResolvePropertyName(String name, Object item, Type ownerType, Object context, Boolean throwOnError)
at MS.Internal.Data.PropertyPathWorker.GetInfo(Int32 k, Object item, SourceValueState& svs)
at MS.Internal.Data.PropertyPathWorker.ReplaceItem(Int32 k, Object newO, Object parent)
at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
at MS.Internal.Data.ClrBindingWorker.AttachDataItem()
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
at System.Windows.Data.BindingExpression.AttachOverride(DependencyObject target, DependencyProperty dp)
at System.Windows.Data.MultiBindingExpression.AttachBindingExpression(Int32 i, Boolean replaceExisting)
at System.Windows.Data.MultiBindingExpression.AttachOverride(DependencyObject d, DependencyProperty dp)
at System.Windows.Data.BindingExpressionBase.OnAttach(DependencyObject d, DependencyProperty dp)
at System.Windows.StyleHelper.GetInstanceValue(UncommonField1 dataField, DependencyObject container, FrameworkElement feChild, FrameworkContentElement fceChild, Int32 childIndex, DependencyProperty dp, Int32 i, EffectiveValueEntry& entry) at System.Windows.StyleHelper.GetChildValueHelper(UncommonField1 dataField, ItemStructList1& valueLookupList, DependencyProperty dp, DependencyObject container, FrameworkObject child, Int32 childIndex, Boolean styleLookup, EffectiveValueEntry& entry, ValueLookupType& sourceType, FrameworkElementFactory templateRoot) at System.Windows.StyleHelper.GetChildValue(UncommonField1 dataField, DependencyObject container, Int32 childIndex, FrameworkObject child, DependencyProperty dp, FrugalStructList1& childRecordFromChildIndex, EffectiveValueEntry& entry, ValueLookupType& sourceType, FrameworkElementFactory templateRoot) at System.Windows.StyleHelper.GetValueFromStyleOrTemplate(FrameworkObject fo, DependencyProperty dp, EffectiveValueEntry& entry) at System.Windows.StyleHelper.ApplyStyleOrTemplateValue(FrameworkObject fo, DependencyProperty dp) at System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList1& exclusionContainerDependents, FrugalStructList1& oldContainerDependents, FrugalStructList1& newContainerDependents)
at System.Windows.StyleHelper.DoStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle)
at System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
at System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.Controls.ItemsControl.ApplyItemContainerStyle(DependencyObject container, Object item)
at System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item)
at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
at System.Windows.Controls.Panel.GenerateChildren()
at System.Windows.Controls.Panel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
at System.Windows.Controls.Panel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
at System.Windows.Controls.ItemContainerGenerator.OnRefresh()
at System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Windows.WeakEventManager.ListenerList1.DeliverEvent(Object sender, EventArgs e, Type managerType) at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args) at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args) at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) at System.Windows.Controls.ItemCollection.OnViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Windows.WeakEventManager.ListenerList1.DeliverEvent(Object sender, EventArgs e, Type managerType)
at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at System.Windows.Data.ListCollectionView.RefreshOverride()
at System.Windows.Data.CollectionView.RefreshInternal()
at System.Windows.Data.CollectionView.Refresh()
at System.Windows.Data.CollectionView.EndDefer()
at System.Windows.Data.CollectionView.DeferHelper.Dispose()
at System.Windows.Controls.ItemCollection.SetCollectionView(CollectionView view)
at System.Windows.Controls.ItemCollection.SetItemsSource(IEnumerable value, Func`2 GetSourceItem)
at System.Windows.Controls.ItemsControl.OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.Controls.ItemsControl.set_ItemsSource(IEnumerable value)
at System.Activities.Presentation.View.DesignerView.MakeRootDesigner(ModelItem modelItem, Boolean setAsSelection, Boolean checkIfCanBeMadeRoot)
at System.Activities.Presentation.View.DesignerView.MakeRootDesigner(ModelItem modelItem)
at System.Activities.Presentation.WorkflowViewElement.MakeRootDesigner()
at System.Activities.Presentation.WorkflowViewElement.OnMouseDown(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2146233054

Hi @Nithinkrishna I too get the same error. I HTTP Request wizard everything works fine on preview. On clicking ok I get the below error.

On clicking Ok in http request preview:

Log Details:
Error: System.Exception: Exception has been thrown by the target of an invocation.
—> System.Exception: Could not load type ‘UiPath.Platform.ResourceHandling.ILocalResource’ from assembly ‘UiPath.Platform, Version=21.10.0.0, Culture=neutral, PublicKeyToken=null’.

After HTTP Request I’ll be using Deserialize Json Activity.

Can you please help to solve this issue.

1 Like

Hey @raj_niresh

But I can’t see any activities in the above.

Thanks
#nK

Hi @Nithinkrishna - That is my issue :frowning: On clicking ok in HTTP Request Wizard HTTP Request Activity is not generated and throwing the above error.

on clicking ok HTTP Request Activity is not getting generated. Instead I get a error message “could not generate view of httpClient”

1 Like

Hey @raj_niresh

You are using WebApi preview version.

Kindly use the latest stable version which should resolve the issue please.

Thanks
#nK

1 Like

Hi @Nithinkrishna No luck, Now also facing same issue after installing same version.

Log Details:

Error: System.Exception: Exception has been thrown by the target of an invocation.
—> System.Exception: Could not load type ‘UiPath.Platform.ResourceHandling.ILocalResource’ from assembly ‘UiPath.Platform, Version=21.10.0.0, Culture=neutral, PublicKeyToken=null’.

1 Like

Hey @raj_niresh

Kindly show me the details you are passing in the preview mode of the activity?

Thanks
#nK

Hi @Nithinkrishna I Done the below steps as per your guidance and issue resolved.

  1. I updated the Web API Package from pre-release to stable version.
  2. Then I Deleted the corrupted project and created a new project. Now I was able to get the HTTP Request Activity.

Thanks bro :slight_smile:

2 Likes

Cool @raj_niresh :slight_smile: :+1:

1 Like

Hi @Nithinkrishna

Please find the below screenshots.

image
image

I received the API response in the preview window, but not after I clicked on the Ok button.

I received the below API response when I ran or debugged the Robot.
“{“message”:“UNAUTHORIZED_REQUEST”,“errors”:,“key”:null,“code”:“UNAUTHORIZED_REQUEST”,“error_code”:”"}"
Status code: 401

I received the API response in the Postman, so the bearer token is correct.

Uipath.WebAPI.Activities 1.9.2 (stable version).
There is no error in the logs.

Thanks.

1 Like

Hey @G3Devi

Kindly try the steps which was posted by @raj_niresh as it resolved the issue.

Thanks
#nK

Hi @Nithinkrishna

I followed the above steps, but I am still facing the same issue.

I used the stable version earlier, so I tried with the lower stable versions, but no luck.
I created a new project and tried only with the HTTP request activity, but no luck.
I still receive the Unauthorized request in the API response.

The Uipath technical team tried some Uipath.WebAPI.activities versions (1.9.1 preview, 1.9.3 preview, and the 1.10.1 preview), but the API response is still displayed Unauthorized request.

The Uipath team is working on it. I will update all the same with the solution.

Thanks

1 Like

Hey @G3Devi

You mean un-authorized error ?

What auth headers you are passing ?

Thanks
#nK