0

read values from user input

XML:
  `<protocol>http</protocol>
  <domain>192.168.1.10</domain>  
  <port>9080</port>
  <username>user</username>
   <password>pwd</password>`

ok....i will explain briefly........

  1. i am trying to access from process servers running in different pcs.....
  2. if i specify details like above it will become specific to one system only...

So i want to pass details from my app to which i want to connect

Naveed S
  • 5,106
  • 4
  • 34
  • 52
naresh
  • 1
  • 1
  • This is not doable. You declare all of this data in yourAdapter.xml beforehand. – Idan Adar Mar 20 '13 at 12:27
  • is there any possibility connect server dynamically? – naresh Mar 20 '13 at 12:38
  • Do you mean: is it possible for an application to dynamically connect to a worklight server? No. The server URL an application connects to is set in application-descriptor.xml, and is set during build time and cannot be changed during runtime. – Idan Adar Mar 20 '13 at 13:04
  • thank you idan for prompt reply.......i want to connect some remote server from worklight adapter for eg: process server with domain: 192.168.1.20 and port:9080 along with user name and password – naresh Mar 20 '13 at 13:33
  • In your adapter's XML, there is a section, there you define to where the adapter will try to connec. You cannot set these dynamically. – Idan Adar Mar 20 '13 at 13:37
  • But you CAN use variables from worklight.properties – Yaron Mar 21 '13 at 04:11
  • how to inject values into xml from worklight properties – naresh Mar 21 '13 at 06:04
  • I think that in order to provide you a GOOD answer, we need you to provide the actual use case, what it is that you're trying to achieve. Please edit your question with an example. – Idan Adar Mar 21 '13 at 13:11
  • ok....i will explain briefly........ 1)i am trying to connect access data from tomcat server – naresh Mar 22 '13 at 06:20
  • @naresh, if your question is answered, please mark it as Answered. Thanks. – Idan Adar Mar 14 '14 at 06:49

1 Answers1

0

Based on the additions to the question, the answer is still - it is not possible. You cannot dynamically set the connectivity settings of an adapter from the application (or from the server) during runtime.

You didn't explain what is the need to connect to these different data sources, so I will give two options of different scenarios:

  1. Use two adapters with different procedures and on the client-side add some logic that will call the right procedure whenever required.

  2. Perhaps this training module will help you: Advanced adapter usage and mashup, if this is your scenario. Read through it.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89