I have a web service which uses a C++/CLI DLL that I created to perform certain operations. Now, the C++/CLI DLL calls a function from a third party DLL which throws an exception ONLY when it is used via the web service. If it is used in a standalone application, the process is smooth. I create a mini dump any time the exception occurs, which can be either an access violation or stack overflow. From looking at the call stack (seen below), I notice that the exception is thrown by a std::_Init_locks::operator= function. I don't completely understand its responsibility or why the exception occurs when it is called, hence my plea for assistance. So my question is, why do I only get an exception when this DLL is being called via a web service and why does it occur at this point?
(Project specifications: .NET 4.0 for web service and C++/CLI DLL)
Thanks in advance.
Stack trace:
Child-SP RetAddr Call Site
00000000`019f3a38 00000000`1894e332 frsdk_9_0_0!std::_Init_locks::operator=+0x3cf
00000000`019f3a50 00000000`18945d09 frsdk_9_0_0!FRsdk::CaptureDeviceBody::operator=+0x6152
00000000`019f3a90 00000000`1894620d frsdk_9_0_0!FRsdk::Box::endy+0xc55b9
00000000`01a38610 00000000`18946380 frsdk_9_0_0!FRsdk::Box::endy+0xc5abd
00000000`01a387b0 00000000`18946567 frsdk_9_0_0!FRsdk::Box::endy+0xc5c30
00000000`01a38820 00000000`188818e3 frsdk_9_0_0!FRsdk::Box::endy+0xc5e17
00000000`01a38860 00000000`1888e0a9 frsdk_9_0_0!FRsdk::Box::endy+0x1193
00000000`01a38950 00000000`188a02b4 frsdk_9_0_0!FRsdk::Box::endy+0xd959
00000000`01a38b00 00000000`1884e6a5 frsdk_9_0_0!FRsdk::Box::endy+0x1fb64
00000000`01a38c70 00000000`1882fb34 frsdk_9_0_0!FRsdk::CaptureDeviceBody::gainRange+0x4e255
00000000`01a38d80 00000000`187af3ab frsdk_9_0_0!FRsdk::CaptureDeviceBody::gainRange+0x2f6e4
00000000`01a3a280 00000000`180fc62a frsdk_9_0_0!FRsdk::Enrollment::Processor::process+0x174b
00000000`01a3a3c0 00000000`180f1227 BioEngine!BioAlgos::Encode+0x24a
00000000`01a3a6d0 00000000`180f1dab BioEngine!BioAlgos::EncodeAndWriteTemplate+0x27
00000000`01a3a740 00000000`18027365 BioEngine!BioAlgos::EnrollSubject+0x30b
00000000`01a3ab70 00000000`180aecb0 BioEngine!FRE::Enroll+0x185
00000000`01a3ad40 00000000`1811be4b BioEngine!RecogProcessor::Enroll+0x290
00000000`01a3aec0 000007fe`96c7dfe9 BioEngine!RecogProcessor_Enroll+0x16b
00000000`01a3b350 000007fe`96c7db2f 0x000007fe`96c7dfe9
00000000`01a3b430 000007fe`96c78d05 0x000007fe`96c7db2f
00000000`01a3b510 000007fe`96c77698 0x000007fe`96c78d05
00000000`01a3bb30 000007fe`96c76117 0x000007fe`96c77698
00000000`01a3c0b0 000007fe`96c7269d 0x000007fe`96c76117
00000000`01a3c6f0 000007fe`96c7cc1d 0x000007fe`96c7269d
00000000`01a3d800 000007fe`96c7c017 0x000007fe`96c7cc1d
00000000`01a3dc50 000007fe`96c7bd6e 0x000007fe`96c7c017
00000000`01a3dcd0 000007fe`96d79599 0x000007fe`96c7bd6e
00000000`01a3dd60 000007fe`f2161663 0x000007fe`96d79599
00000000`01a3dde0 000007fe`f215db45 System_ServiceModel_ni+0x631663
00000000`01a3dfc0 000007fe`f215d330 System_ServiceModel_ni+0x62db45
00000000`01a3e370 000007fe`f215c9cb System_ServiceModel_ni+0x62d330
00000000`01a3e420 000007fe`f215b3de System_ServiceModel_ni+0x62c9cb
00000000`01a3e600 000007fe`f215a8f7 System_ServiceModel_ni+0x62b3de
00000000`01a3e6c0 000007fe`f2158ca3 System_ServiceModel_ni+0x62a8f7
00000000`01a3eaa0 000007fe`f21587cb System_ServiceModel_ni+0x628ca3
00000000`01a3eb20 000007fe`f19ed1a2 System_ServiceModel_ni+0x6287cb
00000000`01a3eb80 000007fe`f19e7aaa System_ServiceModel_Internals_ni+0x4d1a2
00000000`01a3ebd0 000007fe`f19ed3d1 System_ServiceModel_Internals_ni+0x47aaa
00000000`01a3ec80 000007fe`f19eccdc System_ServiceModel_Internals_ni+0x4d3d1
00000000`01a3ecd0 000007fe`f19ec8ae System_ServiceModel_Internals_ni+0x4ccdc
00000000`01a3ee40 000007fe`f2185232 System_ServiceModel_Internals_ni+0x4c8ae
00000000`01a3eeb0 000007fe`f2184b9f System_ServiceModel_ni+0x655232
00000000`01a3ef10 000007fe`f2184a0a System_ServiceModel_ni+0x654b9f
00000000`01a3ef90 000007fe`f19eb3d5 System_ServiceModel_ni+0x654a0a
00000000`01a3efc0 000007fe`f19ed1a2 System_ServiceModel_Internals_ni+0x4b3d5
00000000`01a3f040 000007fe`f19e7aaa System_ServiceModel_Internals_ni+0x4d1a2
00000000`01a3f090 000007fe`f218426b System_ServiceModel_Internals_ni+0x47aaa
00000000`01a3f140 000007fe`f19ed1a2 System_ServiceModel_ni+0x65426b
00000000`01a3f1b0 000007fe`ed1feece System_ServiceModel_Internals_ni+0x4d1a2
00000000`01a3f200 000007fe`ed1bb917 System_Web_ni+0xb8eece
00000000`01a3f2f0 000007fe`ed1f1ef0 System_Web_ni+0xb4b917
00000000`01a3f330 000007fe`ed0baac4 System_Web_ni+0xb81ef0
00000000`01a3f390 000007fe`f62bac23 System_Web_ni+0xa4aac4
00000000`01a3f3f0 000007fe`f62d49ec clr!UM2MThunk_WrapperHelper+0x43
00000000`01a3f430 000007fe`f62c94ae clr!UM2MThunk_Wrapper+0x54
00000000`01a3f480 000007fe`f62d4975 clr!Thread::DoADCallBack+0x12e
00000000`01a3f650 000007fe`f62babcd clr!UM2MDoADCallBack+0x91
00000000`01a3f6d0 000007fe`eb400326 clr!UMThunkStub+0x26d
00000000`01a3f760 000007fe`eb3f1bfe webengine4!W3_MGD_HANDLER::DoWork+0x293
00000000`01a3f7c0 000007fe`ef31ba3c webengine4!RequestDoWork+0x34e
00000000`01a3f860 000007fe`ef3146a4 iiscore!NOTIFICATION_CONTEXT::RequestDoWork+0x314
00000000`01a3f8a0 000007fe`ef31a775 iiscore!NOTIFICATION_CONTEXT::CallModulesInternal+0x174
00000000`01a3f990 000007fe`ef315a03 iiscore!NOTIFICATION_CONTEXT::CallModules+0x25
00000000`01a3f9e0 000007fe`ef311741 iiscore!W3_CONTEXT::DoWork+0x34d
00000000`01a3fd00 000007fe`f8e710b2 iiscore!W3_MAIN_CONTEXT::OnIoCompletion+0x81
00000000`01a3fd30 000007fe`f8e7109c w3dt!UL_NATIVE_REQUEST::DoWork+0x22b
00000000`01a3fd90 000007fe`f95e1fba w3dt!OverlappedCompletionRoutine+0x1c
00000000`01a3fdc0 000007fe`f95e2024 w3tp!THREAD_POOL_DATA::ThreadPoolThread+0x7a
00000000`01a3fe10 000007fe`f95e20a1 w3tp!THREAD_POOL_DATA::ThreadPoolThread+0x34
00000000`01a3fe40 00000000`76e55a4d w3tp!THREAD_MANAGER::ThreadManagerThread+0x61
00000000`01a3fe70 00000000`7708b831 kernel32!BaseThreadInitThunk+0xd
00000000`01a3fea0 00000000`00000000 ntdll!RtlUserThreadStart+0x1d
Related
How do I bind a callback function to a DataTemplate inside a HeaderTemplate in WinUI3?
After reading various answers it appears the DataContext inside a HeaderTemplate is different
than throughout the rest of the XAML file.
The callback function is defined in the AM2BasePageViewModel class, which is called in the AM2BasePage constructor as such:
AM2BasePage::AM2BasePage()
{
m_am2BasePageViewModel = winrt::make<bionet::implementation::AM2BasePageViewModel>();
InitializeComponent();
}
Trying out various things, the relevant part in my XAML file now looks like this:
<muxc:NavigationView x:Name="NavigationView"
SelectionChanged="NavigationView_SelectionChanged"
AlwaysShowHeader="True"
Canvas.ZIndex="0"
Header="s"
IsBackButtonVisible="Collapsed"
BackRequested="NavigationView_BackRequested"
Background="Transparent"
IsSettingsVisible="True"
Margin="0">
<NavigationView.HeaderTemplate>
<DataTemplate x:DataType="local:AM2BasePage" >
<CommandBar x:Name ="AM2BaseCommandPanel" HorizontalAlignment="Left" HorizontalContentAlignment="Left">
<CommandBar.PrimaryCommands>
<AppBarButton x:Name="AM2BaseCommandPanelLoad" Icon="Document" Label="Attach Camera"/>
<AppBarSeparator />
<AppBarButton x:Name="AM2BaseCommandPanelRunSimulation" Icon="Play" Label="Like" Click="{x:Bind AM2BaseViewModel.RunSimulation_click, Mode=OneWay}"/>
<AppBarSeparator />
</CommandBar.PrimaryCommands>
</CommandBar>
</DataTemplate>
</NavigationView.HeaderTemplate>
<muxc:NavigationView.MenuItems>
<muxc:NavigationViewItem Content="Home" Icon="Home" ToolTipService.ToolTip="Home"/>
<muxc:NavigationViewItem
x:Uid="AM2BasePage_NavigationViewItem_Values"
Icon="Page2" ToolTipService.ToolTip="Collections">
<muxc:NavigationViewItem.MenuItems>
<muxc:NavigationViewItem
Tag="bionet.AM2BasePageInitialValues"
x:Uid="AM2BasePage_NavigationViewItem_Values_InitialValues"
ToolTipService.ToolTip="Bookshelf"/>
<muxc:NavigationViewItem
Tag="bionet.AM2BasePageParameters"
x:Uid="AM2BasePage_NavigationViewItem_Values_Parameters"
ToolTipService.ToolTip="Mail"/>
</muxc:NavigationViewItem.MenuItems>
</muxc:NavigationViewItem>
</muxc:NavigationView.MenuItems>
<Frame x:Name="ContentFrame">
</Frame>
</muxc:NavigationView>
The relevant part is
Click="{x:Bind AM2BaseViewModel.RunSimulation_click, Mode=OneWay}".
This compiles but immediately crashes my program upon clicking the command bar with
Exception thrown at 0x00007FFCDA4C4F69 (KernelBase.dll) in bionet.exe: WinRT originate error - 0x80004002 : 'No such interface supported'.
Exception thrown at 0x00007FFCDA4C4F69 in bionet.exe: Microsoft C++ exception: winrt::hresult_no_interface at memory location 0x0000009728D5A198.
Exception thrown at 0x00007FFCDA4C4F69 in bionet.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FF6EBE9A039 in bionet.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
I assume I do the callback function binding wrong. How can I call the callback function without the program crashing?
Edit: The AM2BasePageView header looks as such:
#pragma once
#include "pch.h"
#include "AM2BasePageViewModel.g.h"
namespace winrt::bionet::implementation
{
struct AM2BasePageViewModel : AM2BasePageViewModelT<AM2BasePageViewModel>
{
public:
AM2BasePageViewModel();
void RunSimulation_click();
private:
winrt::event<Microsoft::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged;
};
}
namespace winrt::bionet::factory_implementation
{
struct AM2BasePageViewModel : AM2BasePageViewModelT<AM2BasePageViewModel, implementation::AM2BasePageViewModel>
{
};
}
The problem looks you missed RoutedEventHandler parameter for Click method. In general, I don't recommend declare click routed event handler in view model, because it will pass current button instance into view model that make view and viewmodel are highly coupled.
You could bind AppBarButton Command property. please research C++/WinRT XAML command handling tutorial.
My Custom API's are working fine, I've deployed code on staging Server but I'am getting below error.
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. Valid plugin IDs for Drupal\rest\Plugin\Type\ResourcePluginManager are: dblog, file:upload, entity:block, entity:block_content_type, entity:block_content, entity:comment, entity:comment_type, entity:config_pages_type, entity:config_pages, entity:contact_form, entity:contact_message, entity:editor, entity:field_config, entity:field_storage_config, entity:file, entity:filter_format, entity:flagging, entity:flag, entity:google_api_service_client, entity:google_api_client, entity:image_style, entity:menu_link_content, entity:node, entity:node_type, entity:page_variant, entity:page, entity:path_alias, entity:rdf_mapping, entity:rest_resource_config, entity:search_api_task, entity:search_api_server, entity:search_api_index, entity:search_api_autocomplete_search, entity:shortcut_set, entity:shortcut, entity:social_auth, entity:menu, entity:action, entity:taxonomy_term, entity:taxonomy_vocabulary, entity:tour, entity:ultimate_cron_job, entity:user, entity:user_role, entity:webform_options, entity:webform, entity:webform_submission, entity:webform_access_group, entity:webform_access_type, entity:webform_image_select_images, entity:webform_options_custom, entity:view, entity:paragraph, entity:paragraphs_type, entity:base_field_override, entity:entity_view_display, entity:entity_view_mode, entity:entity_form_mode, entity:entity_form_display, entity:date_format, user_registration in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /home1/tourcode/public_html/''/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php)
Thanks in Advance.
Drupal is looking for a plugin with empty string as a name.
I also noticed have some kind of an empty string in your path. (between public_html and web)
/home1/tourcode/public_html/''/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php
It looks like the configuration of your server has a problem.
I'm trying to create an order through the Prestashop API (v1.6.1.13). I havn't written any module, my goal is just to use its API without installing anything on the prestashop.
Creating an order requires a module name. If I leave it blank I get the error:
Validation error: "Property Order->module is empty"
If I write a fake name it says :
Validation error: "Property Order->module is not valid"
What should I do ? While I have the same issue with the payment field ?
Here is what I'm sending :
<prestashop>
<order>
<id_address_delivery>1299</id_address_delivery>
<id_address_invoice>1300</id_address_invoice>
<id_cart>218</id_cart>
<id_currency>1</id_currency>
<id_lang>2</id_lang>
<id_customer>214</id_customer>
<id_carrier>2</id_carrier>
<current_state>2</current_state>
<module></module>
<invoice_number>0</invoice_number>
<delivery_number>0</delivery_number>
<valid>1</valid>
<date_add>2017-06-27 23:00:46</date_add>
<date_upd>2017-06-28 11:50:13</date_upd>
<id_shop_group>1</id_shop_group>
<id_shop>1</id_shop
<payment>MyPayment</payment>
<recyclable>0</recyclable>
<gift>0</gift>
<mobile_theme>0</mobile_theme>
<total_discounts>0</total_discounts>
<total_discounts_tax_incl>0</total_discounts_tax_incl>
<total_discounts_tax_excl>0</total_discounts_tax_excl>
<total_paid>27</total_paid>
<total_paid_tax_incl>27</total_paid_tax_incl>
<total_paid_tax_excl>27</total_paid_tax_excl>
<total_paid_real>27</total_paid_real>
<total_products>27</total_products>
<total_products_wt>27</total_products_wt>
<total_shipping>0</total_shipping>
<total_shipping_tax_incl>0</total_shipping_tax_incl>
<total_shipping_tax_excl>0</total_shipping_tax_excl>
<carrier_tax_rate>0</carrier_tax_rate>
<total_wrapping>0</total_wrapping>
<total_wrapping_tax_incl>0</total_wrapping_tax_incl>
<total_wrapping_tax_excl>0</total_wrapping_tax_excl>
<conversion_rate>1</conversion_rate>
<reference>170627369</reference>
<associations>
<order_rows>
<order_row>
<product_id>2</product_id>
<product_attribute_id>7</product_attribute_id>
<product_quantity>2</product_quantity>
<product_name>Blouse</product_name>
<product_reference>demo_2</product_reference>
<product_ean13>0</product_ean13>
<product_price>27</product_price>
<unit_price_tax_incl>27</unit_price_tax_incl>
<unit_price_tax_excl>27</unit_price_tax_excl>
</order_row>
</order_rows>
</associations>
</order>
</prestashop>
Any help/idea would be greatly appreciate, thanks !
After some debug steps in the payment module I found the solution.
The module should be a valid module name (I use "bankwire") and payment can be wathever you want (the name of the external source for example).
I was testing an address which country was disabled... Enabling the country fix the issue.
What a pity Prestashop doesn't respond the reason on the API call... Even if activating the DEV mode of prestashop and DEBUG of the PaymentModule.
Thanks for your help sarcom !
You need Enable the payment options(like payment by check) in prestashop admin side and then need to add the module with prefix ps_moduleName without any space.
I did like this,
$xml->order->module= "ps_".strtolower(str_replace(' ', '', $order_data['payment_method']));
You can try this if there is any error or If you have any better solution then it me know.
Thanks.
OK, I think there's no easy (make that lazy) way to do what I want but given the Perl SOAP::Transport::HTTP::CGI code fragment below what I am looking to do is intercept all SOAP operation passing through the service and log the result of an operation or fault...
SOAP::Transport::HTTP::CGI
-> dispatch_to(
#first arg needs to be the directory holding the PackageName.pm modules with no trailing "/". The args aftre the first are name of SPECIFIC packages to be loaded as needed by SOAP requests
#Failure to call out specific moudules below will allow the external SOAP modules to be loaded, but the overall module #INC path for other Perl modules will be blocked for security reasons
SOAP_MODULE_INCULDE, #name of the directory holding the PackageName.pm modules with no trailing "/"
"TechnicalMetaDataExtraction", #prod - wrapper for EXIFTool
"Ingest", #module (package) name
"ImageManipulation", #module (package) name
"FacebookBroadcast", #unfinished
"CompressDecompress", #unfinished
"ImageOCR", #prod - tesseract
"HandleDotNet", #prod
"Pipeline", #prod (needs work)
"TwitterBroadcast", #prototype
"Messaging", #prototype but text format email works
"Property", #development
"FileManager", #prototype
"PassThrough" #prod - module to do location conversion (URL -> Fedora Obj+DS, Fedora Obj+DS -> file, URL -> InlineBase64, etc.) but format conversion
) #done with the dispacth_to section
-> on_action(sub {
#on_action method lets you specify SOAPAction understanding. It acceptsreference to subroutine that takes three parameters: SOAPAction, method_uri and method_name.
#'SOAPAction' is taken from HTTP header and method_uri and method_name are extracted from request's body. Default behavior is match 'SOAPAction' if present and ignore it otherwise.
#die SOAP::Data->type('string')->name('debug')->value("Intercepted call, SOAP request='".shift(#_)."'");
if($Debug) {
##_ notes:
#[0] - "http://www.example.org/PassThrough/NewOperation"
#[1] - http://www.example.org/PassThrough/
#[2] - NewOperation
#[3] - "undefined"
my %DataHash=(
message => #_[0]
);
#SendMessageToAMQTopic(localtime()." - ".#_[0]);
SendDebugMessage(\%DataHash, "info");
} #there's only one element passed at this level
}) #end on_action
#-> on_debug() #not valid for SOAP::Transport::HTTP::CGI
#-> request() #valid, but does not fire - request method gives you access to HTTP::Request object which you can provide for Server component to handle request.
#-> response() #does not fire - response method gives you access to HTTP::Response object which you can access to get results from Server component after request was handled.
#-> options({compress_threshold => 10000}) #causes problems for the JavaScript soap client - removed for the moment
-> handle() #fires but ignores content in sub - handle method will handle your request. You should provide parameters with request() method, call handle() and get it back with response().
;
Initially I thought I could get the information I needed from the "on_action" method, but that only contains the destination of the SOAP call (before it is sent?) and I'm looking for data in the operation result that will be sent back to the SOAP client. The documentation of "SOAP::Transport::HTTP::CGI" is a bit thin and there are few examples online.
Anyone know if this is possible give the what the code above is set up? If not, then the only other option is to alter each method of my SOAP service code modules to include the "SendDebugMessage" function.
I would suggest subclassing SOAP::Transport::HTTP::CGI and hooking into the handle() method. An untested and probably non-working example would be:
package MySoapCGI;
use Data::Dumper;
use SOAP::Transport::HTTP;
use base 'SOAP::Transport::HTTP::CGI';
sub handle {
my $self = shift;
$self->SUPER::handle(#_);
warn Dumper($self->request);
warn Dumper($self->response);
}
Replace the dumpers with whatever logging you want. You may need to do some XML parsing, because these will be the raw HTTP::Request and HTTP::Response.
I create a simple silverlight 4.0 application used to read the excel file data in the share point 2010 server. I try to use the "Excel Web Services" but I get an error here when calling the GetRangeA1 method:
An unhandled exception of type 'System.ServiceModel.Dispatcher.NetDispatcherFaultException' occurred in mscorlib.dll
Additional information: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/office/excel/server/webservices:GetRangeA1Response. The InnerException message was 'Error in line 1 position 361. Element 'http://schemas.microsoft.com/office/excel/server/webservices:anyType' contains data from a type that maps to the name 'http://schemas.microsoft.com/office/excel/server/webservices:ArrayOfAnyType'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'ArrayOfAnyType' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.
the source code is like:
namespace SampleApplication
{
class Program
{
static void Main(string[] args)
{
ExcelServiceSoapClient xlservice = new ExcelServiceSoapClient();
xlservice.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
Status[] outStatus;
string targetWorkbookPath = "http://phc/Shared%20Documents/sample.xlsx";
try
{
// Call open workbook, and point to the trusted location of the workbook to open.
string sessionId = xlservice.OpenWorkbook(targetWorkbookPath, "en-US", "en-US", out outStatus);
Console.WriteLine("sessionID : {0}", sessionId);
//1. works fines.
object res = xlservice.GetCellA1(sessionId, "CER by Feature", "B1", true, out outStatus);
//2. exception
xlservice.GetRangeA1(sessionId, "CER by Feature", "H19:H21", true, out outStatus);
// Close workbook. This also closes session.
xlservice.CloseWorkbook(sessionId);
}
catch (SoapException e)
{
Console.WriteLine("SOAP Exception Message: {0}", e.Message);
}
}
}
}
I am totally new to the silverlight and sharepoint developping, I search around but didn't get any luck, just found another post here, any one could help me?
This appears to be an oustanding issue, but two workarounds I found so far:
1) Requiring a change in App.config.
http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/ab2a08d5-2e91-4dc1-bd80-6fc29b5f14eb
2) Indicating to rebuild service reference with svcutil instead of using Add Service Reference:
http://social.msdn.microsoft.com/Forums/en-GB/sharepointexcel/thread/2fd36e6b-5fa7-47a4-9d79-b11493d18107