I want to initialize a QuickFix initiator and I used the following code:
ExtLogger.Out(MTLogOK, L"FIXExchangeAPI::initialize start");
std::string filename = "FileSettings.cfg";//cfgFileName
ExtLogger.Out(MTLogOK, L"FIXExchangeAPI::initialize filename");
FIX::SessionSettings settings(filename);
ExtLogger.Out(MTLogOK, L"FIXExchangeAPI::initialize settings");
FIX::FileStoreFactory storeFactory(settings);
FIX::ScreenLogFactory logFactory(settings);
_socketInitiator = new FIX::SocketInitiator(*this, storeFactory, settings, logFactory);
ExtLogger.Out(MTLogOK, L"FIXExchangeAPI::initialize true");
It works inside the debugger but, when I try to use it inside an executable (I'm working on Windows) the .exe file crashes after the line:
FIX::SessionSettings settings(filename);
My QuickFix configuration file is:
[DEFAULT]
ConnectionType=initiator
HeartBtInt=30
ReconnectInterval=1
FileStorePath=store
FileLogPath=log
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=N
SocketConnectHost=127.0.0.1
[SESSION]
BeginString=FIX.4.2
SenderCompID=123
TargetCompID=Coinbase
SocketConnectPort=4198
DefaultApplVerID=9
ResetOnLogon=Y
Password=password
DataDictionary=FIX42.xml
What is happening?
Related
Trying to send SecurityListRequest in quickfix using the following code
void FixApplication::SendSecurityListRequest()
{
FIX44::SecurityListRequest request(SecurityReqID(NextRequestID()), SecurityListRequestType(4));
Session::sendToTarget(request, sessionID(false));
}
Getting
8=FIX.4.49=12435=334=349=nik52=20211015-19:40:29.47256=DERIBITSERVER57=U100D145=258=Tag appears more than once371=15372=y373=1310=011
in toAdmin function after the call to sendToTarget
372=y would mean issue is in MessageType "y" which is SecurityList 371=15 would mean issue in tag 15 which is Currency.
Can someone tell what is going wrong here ?
I also tried setting DataDictionary using settings.cfg but it results in
8=FIX.4.49=13435=334=349=nik52=20211015-19:46:29.29256=DERIBITSERVER57=U100D145=258=Tag not defined for this message type371=15372=y373=210=247
My current config file
[DEFAULT]
ConnectionType=initiator
HeartBtInt=20
FILESTOREPATH=store
FileLogPath=Logs
StartDay=TUESDAY
StartTime=00:00:00
EndDay=TUESDAY
EndTime=00:00:00
UseDataDictionary=Y
DataDictionary=FIX44.xml
ValidateUserDefinedFields=N
ValidateFieldsHaveValues=N
ValidateFieldsOutOfOrder=N
ValidateUnorderedGroupFields=N
ValidateLengthAndChecksum=N
ReconnectInterval=60
ResetOnDisconnect=Y
ResetSeqNumFlag=Y
ResetOnLogout=Y
ResetOnLogon=Y
SendResetSeqNumFlag=Y
ContinueInitializationOnError=Y
PrintIncoming=Y
PrintOutgoing=Y
PrintEvents=Y
IgnorePossDupResendRequests=Y
TargetSubID=U100D1
Username=
Password=
[SESSION]
SocketConnectHost=www.deribit.com
SocketConnectPort=9881
BeginString=FIX.4.4
SenderCompID=nik
TargetCompID=DERIBITSERVER
MDEntryType=Y
I have been attempting to write a WPF UI for the WiX installer that chains multiple msis from our company together.
I have followed This Link to do so, however, I cannot get the ui app tp open at all.
I have gotten the command line to run the MyBootstrapper.exe file and save the logs to the desktop.
[1CAC:1CB0][2020-08-06T08:31:55]i001: Burn v3.11.2.4516, Windows v10.0 (Build 18362: Service Pack 0),
path: C:\Users\james\AppData\Local\Temp\{75974D4E-F6FC-4A63-8B17-9C40D549A877}\.cr\MyBootstrapper.exe
[1CAC:1CB0][2020-08-06T08:31:55]i009: Command Line: '-burn.clean.room=C:\Users\james\Desktop\MyBootstrapper.exe -burn.filehandle.attached=632 -burn.filehandle.self=688 -l log.log'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\james\Desktop\MyBootstrapper.exe'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\james\Desktop\'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\james\Desktop\log.log'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleName' to value 'MyBootstrapper'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleManufacturer' to value 'James'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Loading managed bootstrapper application.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to create the managed bootstrapper application.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to create UX.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to load UX.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed while running
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleAction = 5
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleElevated = 0
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleLog = C:\Users\james\Desktop\log.log
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleManufacturer = James
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleName = MyBootstrapper
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleOriginalSource = C:\Users\james\Desktop\MyBootstrapper.exe
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleOriginalSourceFolder = C:\Users\james\Desktop\
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleProviderKey = {3d87621d-9ee8-4412-843e-67b7d5da8dd5}
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleSourceProcessFolder = C:\Users\james\Desktop\
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleSourceProcessPath = C:\Users\james\Desktop\MyBootstrapper.exe
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleTag =
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleUILevel = 4
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleVersion = 1.0.0.0
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to run per-user mode.
[1CAC:1CB0][2020-08-06T08:31:56]i007: Exit code: 0x80131508, restarting: No
What I don't understand is why this never attempts to open the WixBootstrapper.Run method. I know this because, the very first line I have a log message that says Engine.Log(LogLevel.Verbose, "Starting Custom UI");
so I would assume that this has to be in the Bundle.wxs file that looks like.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="MyBootstrapper" Version="1.0.0.0" Manufacturer="James" UpgradeCode="c59306b1-bc3d-4aa0-9936-53f2a3484343">
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" >
<Payload SourceFile="$(var.InstallerUI.TargetDir)BootstrapperCore.config"/>
<Payload SourceFile="$(var.InstallerUI.TargetDir)InstallerUI.dll"/>
<Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.11\bin\Microsoft.Deployment.WindowsInstaller.dll"/>
</BootstrapperApplicationRef>
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="Netfx45Full"/>
<WixVariable Id="WixMbaPrereqPackageId" Value="NetFxLicense.rtf"/>
<Chain>
<MsiPackage Id="WPFInstaller" SourceFile="$(var.Installer.TargetPath)" />
</Chain>
</Bundle>
</Wix>
On to my question, Can someone please explain what I am doing wrong, and why this doesn't open bootstrapper class in cs?
Also, I have extracted the MyBootstrapper.exe file and all of my dependencies are in it.
I was able to get past this point where it is now attempting to install the application, it still doesn't open the WPF UI, but it does now at least attempt it.
I had to change the BootstrapperCore.config From
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
To
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.5" />
</startup>
I am trying to configure my WSO2 Identity Server to set up service providers via a .xml file. Here are the steps I am taking:
Paste the service provider .xml file into the $WSO2_HOME/repository/conf/identity/service-providers folder
Run the wso2server.sh script in a fresh WSO2 environment (never setup, databases with empty tables)
The .xml file I created in step 1 was created using the "export" feature from the console, so I am pretty confident it is set up correctly. Just in case, this is the code (lines with "REMOVED" were removed for privacy):
<?xml version="1.0" encoding="UTF-8"?><ServiceProvider>
<ApplicationName>__REMOVED__</ApplicationName>
<Description>__REMOVED__</Description>
<InboundAuthenticationConfig>
<InboundAuthenticationRequestConfigs>
<InboundAuthenticationRequestConfig>
<InboundAuthKey>__REMOVED__</InboundAuthKey>
<InboundAuthType>passivests</InboundAuthType>
<InboundConfigType>standardAPP</InboundConfigType>
<Properties/>
</InboundAuthenticationRequestConfig>
<InboundAuthenticationRequestConfig>
<InboundAuthKey>__REMOVED__</InboundAuthKey>
<InboundAuthType>openid</InboundAuthType>
<InboundConfigType>standardAPP</InboundConfigType>
<Properties/>
</InboundAuthenticationRequestConfig>
<InboundAuthenticationRequestConfig>
<InboundAuthKey>__REMOVED__</InboundAuthKey>
<InboundAuthType>oauth2</InboundAuthType>
<InboundConfigType>standardAPP</InboundConfigType>
<inboundConfiguration><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<oAuthAppDO>
<oauthConsumerKey>__REMOVED__</oauthConsumerKey>
<oauthConsumerSecret>__REMOVED__</oauthConsumerSecret>
<applicationName>__REMOVED__</applicationName>
<callbackUrl></callbackUrl>
<oauthVersion>OAuth-2.0</oauthVersion>
<grantTypes>client_credentials </grantTypes>
<scopeValidators/>
<pkceSupportPlain>true</pkceSupportPlain>
<pkceMandatory>false</pkceMandatory>
<userAccessTokenExpiryTime>3600</userAccessTokenExpiryTime>
<applicationAccessTokenExpiryTime>3600</applicationAccessTokenExpiryTime>
<refreshTokenExpiryTime>84600</refreshTokenExpiryTime>
<idTokenExpiryTime>3600</idTokenExpiryTime>
<audiences/>
<bypassClientCredentials>false</bypassClientCredentials>
<requestObjectSignatureValidationEnabled>false</requestObjectSignatureValidationEnabled>
<idTokenEncryptionEnabled>false</idTokenEncryptionEnabled>
<idTokenEncryptionAlgorithm>null</idTokenEncryptionAlgorithm>
<idTokenEncryptionMethod>null</idTokenEncryptionMethod>
<backChannelLogoutUrl></backChannelLogoutUrl>
<tokenType>JWT</tokenType>
</oAuthAppDO>
]]></inboundConfiguration>
<Properties/>
</InboundAuthenticationRequestConfig>
</InboundAuthenticationRequestConfigs>
</InboundAuthenticationConfig>
<LocalAndOutBoundAuthenticationConfig>
<AuthenticationSteps/>
<AuthenticationType>default</AuthenticationType>
<alwaysSendBackAuthenticatedListOfIdPs>false</alwaysSendBackAuthenticatedListOfIdPs>
<UseTenantDomainInUsername>false</UseTenantDomainInUsername>
<UseUserstoreDomainInRoles>true</UseUserstoreDomainInRoles>
<UseUserstoreDomainInUsername>false</UseUserstoreDomainInUsername>
<EnableAuthorization>false</EnableAuthorization>
</LocalAndOutBoundAuthenticationConfig>
<RequestPathAuthenticatorConfigs/>
<InboundProvisioningConfig>
<ProvisioningUserStore/>
<IsProvisioningEnabled>false</IsProvisioningEnabled>
<IsDumbModeEnabled>false</IsDumbModeEnabled>
</InboundProvisioningConfig>
<OutboundProvisioningConfig>
<ProvisioningIdentityProviders/>
</OutboundProvisioningConfig>
<ClaimConfig>
<RoleClaimURI/>
<LocalClaimDialect>false</LocalClaimDialect>
<IdpClaim/>
<ClaimMappings>
<ClaimMapping>
<LocalClaim>
<ClaimUri>http://wso2.org/claims/role</ClaimUri>
<claimId>0</claimId>
</LocalClaim>
<RemoteClaim>
<ClaimUri>roles</ClaimUri>
<claimId>0</claimId>
</RemoteClaim>
<RequestClaim>true</RequestClaim>
<MandatoryClaim>false</MandatoryClaim>
</ClaimMapping>
</ClaimMappings>
<AlwaysSendMappedLocalSubjectId>false</AlwaysSendMappedLocalSubjectId>
<SPClaimDialects/>
</ClaimConfig>
<PermissionAndRoleConfig>
<Permissions/>
<RoleMappings/>
<IdpRoles/>
</PermissionAndRoleConfig>
<IsSaaSApp>false</IsSaaSApp>
</ServiceProvider>
After the startup script completes, I don't see the service provider in the console:
Something strange I noticed - If I try to import the service provider manually using the console, I get an error on the UI reading:
Error in importing provided service provider serviceprovider#carbon.super from file
My console output says:
Caused by: org.wso2.carbon.identity.application.common.IdentityApplicationManagementException: Application with the same name loaded from the file system.
at org.wso2.carbon.identity.application.mgt.ApplicationManagementServiceImpl.doAddApplication(ApplicationManagementServiceImpl.java:1637)
at org.wso2.carbon.identity.application.mgt.ApplicationManagementServiceImpl.createApplicationWithTemplate(ApplicationManagementServiceImpl.java:169)
at org.wso2.carbon.identity.application.mgt.ApplicationManagementServiceImpl.importSPApplicationFromObject(ApplicationManagementServiceImpl.java:1025)
... 80 more
I found the source code this error is from and it is the ApplicationManagementServiceImpl.java file
if (ApplicationManagementServiceComponent.getFileBasedSPs().containsKey(applicationName)) {
throw new IdentityApplicationManagementException(
"Application with the same name loaded from the file system.");
}
which makes a call to ApplicationManagementServiceComponent.java.
private void buildFileBasedSPList() {
String spConfigDirPath = CarbonUtils.getCarbonConfigDirPath() + File.separator + "identity"
+ File.separator + "service-providers";
FileInputStream fileInputStream = null;
File spConfigDir = new File(spConfigDirPath);
OMElement documentElement;
if (spConfigDir.exists()) {
for (final File fileEntry : spConfigDir.listFiles()) {
try {
if (!fileEntry.isDirectory()) {
fileInputStream = new FileInputStream(new File(fileEntry.getAbsolutePath()));
documentElement = new StAXOMBuilder(fileInputStream).getDocumentElement();
ServiceProvider sp = ServiceProvider.build(documentElement);
if (sp != null) {
fileBasedSPs.put(sp.getApplicationName(), sp);
}
}
} catch (Exception e) {
log.error("Error while loading idp from file system.", e);
} finally {
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (IOException e) {
log.error("Error occurred while closing file input stream for file " + spConfigDirPath, e);
}
}
The error is thrown because my service provider directory has a file with the same service provider name that is trying to be imported through the console. However, the service provider in my file system wasn't imported in the first place.
So my failure to import the service provider when the server gets configured prevents me from importing the files through the console later.
Any help is appreciated.
The service providers deployed as the file $WSO2_HOME/repository/conf/identity/service-providers folder will not be visible in the UI. But it will be active in the system. Currently the InboundAuthenticationConfig in the deployed file is not supported. But, you can have the SAML configurations in the $WSO2_HOME/repository/conf/identity/sso-idp-config.xml file.
<SSOIdentityProviderConfig>
<ServiceProviders>
.......
.......
<ServiceProvider>
<Issuer>_InboundAuthKey_</Issuer>
<AssertionConsumerServiceURLs>
<AssertionConsumerServiceURL>_url_</AssertionConsumerServiceURL>
</AssertionConsumerServiceURLs>
......
......
</ServiceProvider>
</ServiceProviders>
</SSOIdentityProviderConfig>
Here the InboundAuthKey is the value of for saml InboundAuthenticationRequestConfig
I've failed to setup service provider by storing file to $WSO2_HOME/repository/conf/identity/service-providers. OAuth2/token request always fails with error that the particular client_id is not found.
What works for me is to create python script to load XML using SOAP interface.
import zeep
from requests import Session
import os
session = Session()
#uncomment in case you use HTTPS without valid certificates
session.verify = False
transport = zeep.Transport(session=session)
def get_client(service):
base_url = 'https://{IS_SERVICE_NAME}:{IS_PORT}/services/{SERVICE}?wsdl'.format(
IS_SERVICE_NAME=os.environ["IS_SERVICE_NAME"],
IS_PORT=os.environ["IS_PORT"],
SERVICE=service)
print("Getting client %s" % base_url)
return zeep.Client(base_url, transport=transport)
def init_session():
client = get_client('AuthenticationAdmin')
client.service.login(username=os.environ["IS_USERNAME"],
password=os.environ["IS_PASSWORD"],
remoteAddress=os.environ["IS_SERVICE_NAME"])
def import_config(path):
print("Calling IdentityApplicationManagementService")
client_iam = get_client('IdentityApplicationManagementService')
with open(path) as f:
contents = f.read()
# list of available namespaces
# print client_iam.client_iam.namespaces
sp_file_content_type = client_iam.get_type('ns2:SpFileContent')
sp_file_content = sp_file_content_type(content=contents,
fileName='service-provider.xml')
client_iam.service.importApplication(sp_file_content)
if __name__ == '__main__':
assert "IS_USERNAME" in os.environ, "Define IS_USERNAME env variable"
assert "IS_PASSWORD" in os.environ, "Define IS_PASSWORD env variable"
assert "IS_SERVICE_NAME" in os.environ, "Define IS_SERVICE_NAME env variable"
assert "IS_PORT" in os.environ, "Define IS_PORT env variable"
init_session()
import_config('/conf/service-provider.xml')
This SOAP interface is enabled by setting in carbon.xml.
<HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>
I am receicing the following error when trying to run the example-sixlowpan.cc file in NS3, i have placed both the example-sixlowpan.cc and example-ping-lr-wpan.cc files within a folder named 6lowpan within the scratch folder of NS3.
after running "./waf --run example-sixlowpan" i receive the following error:
Waf: Leaving directory `/repos/ns-allinone-3.25/ns-3.25/build'
Build failed
-> task in '6lowpan' failed (exit status 1):
{task 140117242282192: cxxprogram example-ping-lr-wpan.cc.3.o,example-sixlowpan.cc.3.o -> 6lowpan}
['/usr/bin/g++', '-pthread', '-pthread', 'scratch/6lowpan/example-ping-lr-wpan.cc.3.o', 'scratch/6lowpan/example-sixlowpan.cc.3.o', '-o', '/repos/ns-allinone-3.25/ns-3.25/build/scratch/6lowpan/6lowpan', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--no-as-needed', '-L.', '-lns3.25-test-debug', '-lns3.25-lr-wpan-debug', '-lns3.25-netanim-debug', '-lns3.25-lte-debug', '-lns3.25-spectrum-debug', '-lns3.25-antenna-debug', '-lns3.25-aodv-debug', '-lns3.25-applications-debug', '-lns3.25-csma-layout-debug', '-lns3.25-dsdv-debug', '-lns3.25-dsr-debug', '-lns3.25-flow-monitor-debug', '-lns3.25-internet-apps-debug', '-lns3.25-mesh-debug', '-lns3.25-wimax-debug', '-lns3.25-nix-vector-routing-debug', '-lns3.25-olsr-debug', '-lns3.25-point-to-point-layout-debug', '-lns3.25-sixlowpan-debug', '-lns3.25-tap-bridge-debug', '-lns3.25-visualizer-debug', '-lns3.25-wave-debug', '-lns3.25-internet-debug', '-lns3.25-bridge-debug', '-lns3.25-point-to-point-debug', '-lns3.25-mpi-debug', '-lns3.25-traffic-control-debug', '-lns3.25-wifi-debug', '-lns3.25-buildings-debug', '-lns3.25-propagation-debug', '-lns3.25-uan-debug', '-lns3.25-mobility-debug', '-lns3.25-energy-debug', '-lns3.25-config-store-debug', '-lns3.25-csma-debug', '-lns3.25-fd-net-device-debug', '-lns3.25-virtual-net-device-debug', '-lns3.25-topology-read-debug', '-lns3.25-network-debug', '-lns3.25-stats-debug', '-lns3.25-core-debug', '-lrt', '-lgsl', '-lgslcblas', '-lm', '-lsqlite3', '-lgtk-x11-2.0', '-lgdk-x11-2.0', '-latk-1.0', '-lgio-2.0', '-lpangoft2-1.0', '-lpangocairo-1.0', '-lgdk_pixbuf-2.0', '-lcairo', '-lpango-1.0', '-lfontconfig', '-lgobject-2.0', '-lglib-2.0', '-lfreetype', '-lxml2']
Try to use the following command
./waf --run scratch/6lowpan/example-sixlowpan
or place the example-sixlowpan.cc file in scratch folder.
I have installed open cart on my demo subdomain server.
config file changed by me is as follows
// HTTP
define('HTTP_SERVER', 'https://demos.abc.com/artnkraft/');
// HTTPS
define('HTTPS_SERVER', 'https://demos.abc.com/artnkraft/');
// DIR
define('DIR_APPLICATION', '/demos/artnkraft/catalog/');
define('DIR_SYSTEM', '/demos/artnkraft/system/');
define('DIR_IMAGE', '/demos/artnkraft/image/');
define('DIR_LANGUAGE', '/demos/artnkraft/catalog/language/');
define('DIR_TEMPLATE', '/demos/artnkraft/catalog/view/theme/');
define('DIR_CONFIG', '/demos/artnkraft/system/config/');
define('DIR_CACHE', '/demos/artnkraft/system/storage/cache/');
define('DIR_DOWNLOAD', '/demos/artnkraft/system/storage/download/');
define('DIR_LOGS', '/demos/artnkraft/system/storage/logs/');
define('DIR_MODIFICATION', '/demos/artnkraft/system/storage/modification/');
define('DIR_UPLOAD', '/demos/artnkraft/system/storage/upload/');
// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'abc');
define('DB_PASSWORD', 'abc#_password');
define('DB_DATABASE', 'abc_database');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');
this gives error
Warning: require_once(/demos/artnkraft/system/startup.php): failed to open stream: No such file or directory in /home/cloudusweb/public_html/demos/artnkraft/index.php on line 17
Fatal error: require_once(): Failed opening required '/demos/artnkraft/system/startup.php' (include_path='.:/usr/local/lib/php') in /home/cloudusweb/public_html/demos/artnkraft/index.php on line 17
i have also change the admin config file.
help me how to configure configre file to correct path
thanks in advance