Hello all,
How to use two web service connector in a single CAF page?
I’m facing problem when I’m working with more that one web service connector in a single page, When one web service connector is triggered it automatically refreshes all other web service connector also.
Here I wanted to provide the output of one web service connector as an input to another web service connector using CAF page.
Please can anyone help me on regarding this?
Regards,
Shashi Kumar
You can create and call any number of web service connectors in a CAF application. The “Refresh” action on the generated bean acts as a trigger to perform actual invocation. You can call these “refresh” actions of different connectors in a sequential manner either in a “Data Flow Implementation” or a java code inside an action you created.
It is up to your application logic/ use case on how you do this. You can bind two separate buttons to the “Refresh” actions of the web service connectors and click one after other or have a single button that calls all the connectors in a sequential manner either using “Data flow implementation” or java code.
Hi Shashi,
How are you calling the WSC?
It is never a chain reaction.
You may be refreshing the whole page which can be controlled by the refresh property.
Hi Khan
I’m populating the select one menu with output of one WSC on loading the page and the selected option will be provided as an input to another WSC. For triggering both services I’m using its respective Refresh method.
Here, I’m able to load the page by populating the select one menu with one WSC, but after selecting an option if I click on the second WSC’s Refresh method, the content of the select one menu are getting emptied.
Can please tell me how to resolve this issue, if possible with an example?
Regards,
Shashi Kumar
Hi Prasad,
Can you please give me a example for the thing which you have explained, so that I can clearly understand what you had said, as I’m new to webMethods.
Regards,
Shashi Kumar
From what you described above, it seems you are doing it right. Not sure why you are facing the issue. Did you play with the scope of the managed beans by any chance?
I have created managed bean with ReguestScoped. Is anything wrong in it?
Did you explicitly change it while creating the Webservice connector or was it created by default? Usually, the default is “Session” as shown in attached screenshot.
In case it is not, please change it to a session.
Hi Prasad,
Thank you, now its working. But I’m not able to get the selected value in the backing bean, can you say what could be the problem? I even tried with the valueChangeListener and Ajax Listener, still I’m not able to get it.
Regards,
Shashi Kumar
Please check if your have more than one control’s value bound to a same backing bean field. If it is the case, what usually happens is the last control (In the vertical direction, top to bottom) value will be bound which could be null or empty.
If I use the variable from the same backing bean (which is used to get selectItems) to store selectedOption, then I’am able to get the selectedOption to backing bean. But if I use a variable of another backing bean, I’am not getting the selectedOption to backing bean.
Here both backing beans are from different Web Service Connector.
Example:
I’m using like,