I'm doing a demo application, and I need the app to be able to connect to different worklight servers. but I can't find where can I change the url
If you are referring to Worklight Adapters - you cannot change the adapter's connectivity properties during runtime. Explained here, here and here.
If you are referring to Worklight Server - I assume then that you are using Worklight 6.0; Right-click on the application folder >> Run As >> Build for Remote Server (further explained here).
Related
I have few adapters deployed in remote uat server.
I want to access them n develop mobile web app in my local worklight server.
Im using IBM Mobilefirst 7.1.0
I tried setting host and contxt path of uat server in mobilewebapp build settings and run the app in my local server. But query call is throwing 404 error.
Can anyone help me in accessing remote adapters in local server.
It would've been easier to help you had you provided information such as where are you setting that connection info and what are you setting... since you're getting 404, this would typically mean that you have incorrectly inputted the connection info.
In MobileFirst Studio, right-click on the application folder and select Run As -> Remote Target and Build Settings. There you need to input the server address:
Host: https://your-server-ip-address:port-number
Context root: /myproj (typically the project name, unless you've specified otherwise in the server.xml of the remote application server).
I am developing a hybrid app in Worklight 6.2. I have a WorkLight Server installed Red Hat Linux 6 base as remote server.
I have give the servers ip address, port number and context root as"/worklight" in the "build settings and deploy target".
Then i added my adapter file and wlapp file into the remote servers "app" folder. I haven't made any changes in the server.xml file.
Now when i call the procedure from my app i am getting "[IPADDRESS:PORT/worklight/apps/services/api/MyApp/ipad/query] failure. state: 404, response: The server was unable to process the request from the application. Please try again later."
What am i missing and What changes do i have to make to make the request to work.?
The steps you are describing are not clear.
Make sure you are following the steps as provided in the IBM Worklight Knowledge Center.
First make sure the Worklight Server deployment to the application server was done correctly
You can verify this then by loading the Worklight Console (there will be no deployed projects)
Then follow the Worklight project (.war, .wlapp, .adapter) deployment to the Worklight Server instructions
You can verify this then by loading the Worklight Console (there will be 1 deployed application)
Is it possible to deploy an app to external Worklight server instance when I don't have the IBM Worklight Server installed on my computer ?. Is there any alternative to use features inside IBM Worklight Developer to allow us to deploy to external worklight server for testing environment ?
You can use Run AS --> Build for Remote Server option to build for external worklight server.
It will give you WLAPP files in bin folder. Copy that and deploy that in Worklight server console.
For more info please use this link
Find the following link for remote server deployment.
Deploying in test and production environment
I am trying to deploy multiple adapters to a Worklight Server in a production environment. When refreshing the console, the deployed adapters are missing.
What is the problem?
Can you please take a look at your Worklight Server log to see if any errors are displayed. I have seen in the past similar behavior when adapter procedures relied on security-tests, but the security tests were not defined properly in the authenticationConfig.xml file on the server side. In the server log I saw the following error:
"Failed to deploy adapter. This may be due to a JavaScript error in your adapter implementation"
If this is the case please update your authenticationConfig.xml on your production server to match the properties you have defined in your development environment. Also do these adapters deploy successfully in your development environment when running locally?
Make sure that the Studio the adapter was created in and the Server the adapter is deployed to are of the exact same build number
This is reason #1 for adapters to get deployed and then immediately get removed.
I have a client who is interested in calling a Worklight adapter from separate projects. For example the adapter might live in ProjectA and the app lives in ProjectB. When I attempt to invoke a procedure for an adapter that resides in ProjectA from my client code in ProjectB using Worklight V6, I see the error
FWLSE0020E Ajax request exception, Adapter testAdapter does not exist.
Is there a way to call adapters that reside in a different project than the client code?
I saw the following question which stated that adapters are per-project entities: worklight server configuration - separating adapters and server
As Idan mentioned at the bottom of the question you linked:
In Worklight 6.0 you are now able to concurrently run multiple
Worklight projects (or, .war files) in the same server instance, so
while adapters are still per-project entities, you can have them
duplicated in separated projects on the same server machine running
Worklight Server and have multiple separate projects (applications)
use that server to connect to the backend.
The adapters being in different projects isn't as important as them being hosted on different WAR files. The client can only connect to an adapter that lives on the Worklight server that the client has been configured to connect with (to my knowledge, someone correct me if I'm wrong).
If you want two projects to connect to the same WAR file, right click your Worklight project and then click "Change Worklight Target Server". Change the context path to the name of the project you want all of your deployments to go to:
Now all adapters and all clients from both projects will go to the same WAR, and I can call the Worklight adapter from a client that connects to either project.
Note: For the second project, you may have to build each application for a remote server to point to the correct context root. I'm not sure and haven't tried it myself.