Deploying Adapter on Bluemix-MobileFirst Foundation - ibm-mobilefirst

I have registered on IBM Bluemix. I've created a Mobile Foundation Service.
Now I wanted to deploy a JavaAdapter on bluemix-MobileFoundation. But getting some "FWLSE0321: state change Failure...exception" during deployment.
The adapter deployed successfully in my machine with local MobileFirst Server 8.0.
For locally installed server - POM.xml
<mfpfUrl>http://localhost:9080/mfpadmin</mfpfUrl>
so my question is, If I want to deploy Adapter on Bluemix-Mobilefoundation then,
what would be the "mfpUrl" ? and
In mfp Operation Console, from where I'll get this URL?
Thanks in advance!

When you open your MFP service from your dashboard, the name of the server will appear on the opened service's main overview page. It would be of the format
<server-name>.mybluemix.net
This will be your mfpfURL along with https:// and the server url must be followed by the port number ( the default is 443). Viz :
<mfpfUrl>https://<server-name>.mybluemix.net:443/mfpadmin</mfpfUrl>
And when the operations console is opened, the url of the opened page will consist your server url too.

You can get the URL from the MobileFirst Console. Make sure you use https and port 443

Related

Weblogic application port for web apps

I have deployed a java web application jar file on weblogic 10.3.
But I'm unsure how to access the application in browser.
I have the path to my web app as "/testapp/home.do"
Can someone tell me what port is used by weblogic apps.
Where can I check the port number info,which file?
When deployed on tomcat, i use "localhost:8080/testapp/home.do"
I'm looking for something similar for weblogic
Thanks in advance.
You can use the Weblogic Administration Console i.e.
Deployments => Click on theApp => Testing Tab => Default URL in the table displayed....
As default, WebLogic Server uses the port 7001. You can take a look at the ${DOMAIN_HOME}/config/config/xml file and see what is your server port.

How to change MobileFirst 8 server URL dynamically from client (Mobile Application)?

I am working on ionic 3 with MobileFirst 8.x in it. To connect server I have configured URL in config.xml file.
Is there any way to change server URL dynamically while using application?
URL change occurs only once and after that we will connect the services which are secure under any scopes.
MobileFirst server version :- 8.0.0.00-20170911-123510
MobileFirst Cordova(plugin) version :- 8.0.2017102403
I can see that provision was there in MobileFirst 7.x :-
https://mobilefirstplatform.ibmcloud.com/blog/2015/02/02/changing-server-url-runtime/
Yes. Use the WL.App.setServerURL to achieve this. Usage details here
You have not mentioned why you intend to use the API. This API comes handy in development environments. For example, switching between dev or staging server instances.
Important points to note:
1) As this API points the client application to a new server, client id associated with the earlier server is reset. The application will register fresh to the new server.
2) Authentication contexts created by the earlier server is reset. You will be challenged again by the new server.
You should use this API judiciously and with caution.

WLAuthorizationManager.obtainAccessToken doesn't work when app uses proxy

I need to have an Android app where I use a proxy URL to connect to our MFP 8.0 server. When I make an android build without proxy pointing directly to the MFP server the app registers in the server and I am able to see the push notification in my device.
But when using a proxy in the config.xml the app is able to reach the server but returns an error on the step where I do WLAuthorizationManager.obtainAccessToken.
This is the error:
errorCode:"201"
errorMsg:"Created"
responseText:"{"server_version":"8.0.2017081900"}"
status:201
statusText:"Created"

IBM Worklight Console: Protected Worklight Console in Liberty Server asked to Authetication twice

I have created a server in liberty and installed IBM Worklight in it.
Everything was working fine till I protect the console.
After protecting the IBM Worklight console the authentication is asked
twice.
First Login Screen with URL localhost:9080
After Login Successful.Again the login is being asked with the hostmachines URL 192.168.10.16:9080
My questions are
Why login appears twice?
Why my hostmachine ip is being revealed?
You are accessing the console with address localhost, whereas in your code you are either using publicWorklightHosname=192.168.10.16 or while building you are using build for remote machine and then putting in IP of the server.
Here is what you need to do:
Make sure a DNS entry of the hostname is present in the server and client machine
Change the publicWorklightHostname property in worklight.properties file to a proper address eg
mymachine.mydomain.com
while building for Remote Server, use the same address as above i.e. mymachine.mydomain.com
redeploy the new war file
Worked perfectly for me.
P.S> I believe you are using local machine, in this case also you can use the machine name in worklight.properties file and make sure that the address you are using is same as the one you used to build. Nonetheless, it doesn;t matter in production or application deployment.

Failed to deploy the application to Worklight server

I installed worklight 6.1.0.1 on eclipse kepler from marketplace. I am getting the following error when I tried to build the application.
" Failed to deploy the application to Worklight server: please verify that the Worklight server is started and reachable.Connection to - 192.168.112.1:10080 failed. (Permission denied: connect)."
We send SOAP requests from the adapter. The backend services are only accessible if connected to VPN. I have connected to VPN and deployed the application. few JS files like dojo.js are pointing to local IP. For building the project to VPN IP , I right clicked the project and Run As>Build Settings and deploy targets. In the window that is popped up, I gave the VPN IP and cliked Ok. Again I right clicked project Run As>build all and deploy all. But still its being pointing to local IP 192.168.112.1:10080 and getting the error mentioned above when I try to deploy the application.
Even if I open project on worklight project console, its redirecting to local IP.
I think some ideas are mixed here.
Your application will be running in a local Worklight test server, that as part of Worklight Studio is placed in your development environment (localhost). If your adapters must use the VPN to reach the backend services, then you must only make sure the your-adapter.xml referes to the correct HTTP host (i.e. an IP address available through the VPN).
You should not need to change your local server address, i.e. if you double-click the Worklight Development Server in Servers view, the Host name field should be "localhost" (without quotes, that's the default value), or preferrable a local IP, may be 192.168.112.1 (or whatever local IP you have). If after trying all this, that still don't work, I'd change that to your VPN IP, but I believe that's not necessary.
One thing you may not be aware of is that when doing a build and deploy to Worklight Development Server, and you have the host name set to "localhost" the Worklight Studio will "guess" your IP, so that's probably the problem you are facing.
In a nutshell, what I'd do is:
1. Make sure your server host name is still localhost (or a fixed local IP address)
2. Make sure your adapter.xml file(s) refer to a correct IP or fully qualified host name in the VPN, so you can reach them.
3. Run As -> Build All and Deploy
4. Test
What I'm saying here is if you want your app built using the VPN IP, then you don't need to do it through Build Settings and Deploy Target, but just going to Servers View, double-click on Worklight Development Server and then set the Host name to the IP you want. The Build All and Deploy will do the rest for you.