Worklight SAP Netweaver GateWay Adapter - Client ID - ibm-mobilefirst

Currently we are using the Worklight SAP Netweaver GateWay Adapter to connect to our development environment of SAP. Our customer has configured two client environments 101 and 211. The default is 101.
When creating a connection based on the following adapter configuration...
<?xml version="1.0" encoding="UTF-8"?>
<wl:adapter xmlns:wl="http://www.worklight.com/integration" xmlns:nwgateway="http://www.worklight.com/integration/nwgateway" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="SAPAdapter1">
<displayName>SAPAdapter1</displayName>
<description></description>
<connectivity>
<connectionPolicy xsi:type="nwgateway:NWGatewayHTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>10.9.5.27</domain>
<port>8000</port>
<serviceRootUrl>/sap/opu/odata/sap/services_x_y_z/</serviceRootUrl>
<authentication>
<basic/>
<serverIdentity>
<client>211</client>
<username>xyz</username>
<password>123</password>
</serverIdentity>
</authentication>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="10"/>
</connectivity>
<procedure name="getShipments"/>
</wl:adapter>
We assume to connect to client 211, but apparently we are connected to 101.
How is the client-id handled by the Worklight SAP NWG Adapter?

This has been identified as a defect in the product.
There is no available workaround.
To receive an iFix containing the fix for this defect, you need to open a PMR (support ticket).
Please mention this question as well as APAR #PI31148 in your query for reference.

Related

IBM Mobilefirst Java Adapter to connect Couchbase

Can we connect to Couchbase DB thorugh Mobilefirst 8 Java OR Javascript SQL adapter? Please suggest alternative option if available.
You can use a MFP 8.0 Java adapter or Javascript HTTP adapter and use it to make REST calls to the Couchbase DB.
Yes it is possible to connect any NoSQL DB(Couchbase DB) using MFP 8.0 JavaScript or Java HTTP Adapters,making use of REST calls.
Here is an sample example which connects to IBM Cloudant NoSQL DB using MFP 8.0 JavaScript HTTP Adapter.
AdapterSample.js file -->
function getDocByKey(key) {
var path = '/my_database/'+key;
var input = {
method : 'get',
returnedContentType :'json',
path : path
};
return WL.Server.invokeHttp(input);
}
adapter.xml file -->
<mfp:adapter name="AdapterSample"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mfp="http://www.ibm.com/mfp/integration"
xmlns:http="http://www.ibm.com/mfp/integration/http">
<displayName>AdapterSample</displayName>
<description>AdapterSample</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain> <-- DB URL here--> </domain>
<port>443</port>
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
<authentication>
<basic/>
<serverIdentity>
<username> <--DB Username here--> </username>
<password> <--DB Password here--> </password>
</serverIdentity>
</authentication>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
</connectionPolicy>
</connectivity>
<procedure name="getDocByKey" secured="false"/>
</mfp:adapter>
Click here for more information https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/

IBM Mobilefirst: Issue in calling a service from adapter with basic auth

I have a service call thats being called from my adapter and that particular service call is being protected by Basic auth. So I am adding the following code in adapter XML to help all the service calls from this adapter to do the Basic Auth validation.
<wl:adapter name="adapter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wl="http://www.ibm.com/mfp/integration" xmlns:http="http://www.ibm.com/mfp/integration/http">
<displayName>adapter</displayName>
<description>adapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>myweb.com</domain>
<!-- <port>443</port> -->
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
<authentication>
<basic />
<serverIdentity>
<username>123-123-123-123</username>
<password>12334445!</password>
</serverIdentity>
</authentication>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
<!-- Following properties used by adapter's key manager for choosing specific
certificate from key store <sslCertificateAlias></sslCertificateAlias> <sslCertificatePassword></sslCertificatePassword> -->
</connectionPolicy>
</connectivity>
<procedure name="procedure1" securityTest="wl_unprotected"
connectAs="server" />
<procedure name="procedure2" securityTest="wl_unprotected"
connectAs="server" />
</wl:adapter>
When i trying hitting service by using the above xml it gives me Invalid Authorization. But when i added it manually to the header of my service call in the js code it gets through as below.
headers: {Authorization: "Basic MTIzLTEyMy0xMjMtMTIzOjEyMzQ1NiE="}
can some body help me in understanding what could be the issue. Will there be some issue if i keep special characters in the XML. How do i make it work.
Thankyou.
An adapter request with the Authorization header will be sent only if the destination service returns 401 or 403 first. If you are able to change the response code of that service, this may be a solution for you. Otherwise, continue with adding the Authorization header as you do, which as you say seems to work.

Accessing Secured Webservice via mobilefirst adapter

i need to access a wsdl which is secured i.e https and need certificates etc to access.What i did his i followed the steps specified here instead of directly downloading certificates from browser: https://www-01.ibm.com/support/knowledgecenter/SSHSCD_7.0.0/com.ibm.worklight.installconfig.doc/admin/t_configuring_SSL_WL_adapters_backend_servers_certificates.html
when i do the last step keytool -v -list -keystore mfp-default.keystore i get
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
Alias name: backend
Creation date: 5 Feb, 2016
Entry type: trustedCertEntry
my doubt is whether what i have done is enough to access a secured https and do i need anything to add here below for sslcert and ssl pass in adapter.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed Materials - Property of IBM
5725-I43 (C) Copyright IBM Corp. 2011, 2013. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
-->
<wl:adapter name="cloudcheck"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wl="http://www.ibm.com/mfp/integration"
xmlns:http="http://www.ibm.com/mfp/integration/http">
<displayName>cloudcheck</displayName>
<description>cloudcheck</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain>mydummy.com</domain>
<port>443</port>
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
<!-- Following properties used by adapter's key manager for choosing specific certificate from key store
<sslCertificateAlias>backend</sslCertificateAlias>
<sslCertificatePassword>password</sslCertificatePassword>
-->
</connectionPolicy>
</connectivity>
<procedure name="getFeed"/>
</wl:adapter>

giving the host url dynamically in mobilefirst adapter

Hello all I need to pass the host name or url for the adapter dynamically from the client side.i.e when the user login he needs to type the url which will be set to the ${domainname} in the adapter.xml file.help needed pls.Thnks in advance
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wl:adapter xmlns:wl="http://www.ibm.com/mfp/integration" xmlns:http="http://www.ibm.com/mfp/integration/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="SoapAdapter1">
<displayName>SoapAdapter1</displayName>
<description></description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>${domain}</domain>
<port>8001</port>
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
<maxConcurrentConnectionsPerNode>2</maxConcurrentConnectionsPerNode>
</connectionPolicy>
</connectivity>
<procedure name="userlog"></procedure>
</wl:adapter>
Those are not changeable values during runtime. You cannot decide dynamically where will the adapter connect to after the adapter has been built and deploy.
You could try Andrew's suggestion here: IBM Worklight - How to change dynamically domain/hostname to which the adapter connects from the client at launch or runtime?

What should be the value of maxConcurrentConnectionsPerNode in worklight adapter

I am developing IBM Worklight application. On production, application has about 1-2 thousand users. What should be the value of 'maxConcurrentConnectionsPerNode'?
In adapters the value of maxConcurrentConnectionsPerNode is 2 (default).
Application response is good while number of users are less but on heavy load(thousands of user), users are facing issue of connection with sever .
In addition, Backend databases are little bit slow.
<wl:adapter name="Authentication"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wl="http://www.worklight.com/integration"
xmlns:http="http://www.worklight.com/integration/http">
<displayName>Authentication</displayName>
<description>Authentication</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>blank</domain>
<port>80</port>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>
<procedure name="pro1"></procedure>
<procedure name="pro2"></procedure>
<procedure name="pro3" securityTest="appSecurityTest"></procedure>
</wl:adapter>
If you are asking for performance suggestions then this is not the place for it, and is wholly dependent on your specific machines and their setup.
I suggest that you will read the following materials and make educated changes based on it:
https://www.ibm.com/developerworks/community/blogs/worklight/entry/tuning_worklight_server?lang=en
http://www-01.ibm.com/support/knowledgecenter/SSHS8R_6.3.0/com.ibm.worklight.dev.doc/devref/r__maxConcurrentConnectionsPerNode__element_.html
http://dw.developer-works.com/article/10013142/Recommended+value+for+maxConcurrentConnectionsPerNode
search more online...