on 10-30-2008 3:10 PM
Hi,
How to pass a parameter to a Web Service?
I am working with hierarchical data, user choose a category from the first DropDown and when clicking the second DropDownList,
only data that belongs to that category should be retrieved. Example: "select subcategory from tablex where category = 'value first Dropdownlist'".
Thanks,
Ridouan
Hi,
There are many threads already discussed regarding dependent dropdowns go through some of the links below and regarding setting values to webservice, Which type of webservice you are using. If that webservice has input parameters then you can just set input context attributes
Regards
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your response, unfortunately I was not able to find a solution for my scenario.
I have two Context Nodes, one for the Core Category and one for the Sub Category.
The Web Service for the Sub Category expect an input parameter, the attribute arg0 is the input field in the Web Service.
I am using this code:
//@@begin onActionDoSomeThing(ServerEvent)
IReturnNode someNode = wdContext.nodeReturn(); // The node where the attribute SubCategory can be found
IReturnElement someEl = someNode.currentReturnElement(); // Attribute SubCategory contains a value from the first Web Service (like 001 (it's a string and not a number))
String subCategory = someEl.getSubCategory();
CoreModel model = new CoreModel();
Request_GetSubCategory request = new Request_GetSubCategory(model);
wdContext.nodeRequest_GetSubCategory().bind(request);
wdContext.nodeGetSubCategory().currentGetSubCategoryElement().setArg0("%" + subCategory);
try {
wdContext.currentRequest_GetSubCategoryElement().modelObject().execute();
wdContext.nodeResponseSub().invalidate();
} catch (Exception e) {
wdComponentAPI.getMessageManager().reportException(
e.getLocalizedMessage());
}
//@@end
I am getting a java.lang.NullPointerException
Please help!
Thanks,
Ridouan
Hi,
Thanks for your help. I still receive the java.lang.NullPointerException.
I didn't mention that I using NWDS for SAP NetWeaver CE 7.1 SP6.
I have the following code in the wdDoInit of the Component Controller:
// Initialize CoreCategories Node
Request_GetCoreCategory categories = new Request_GetCoreCategory(model);
wdContext.nodeRequest_GetCoreCategory().bind(categories);
// Second Node
Request_GetSubCategory subcategories = new Request_GetSubCategory(model);
wdContext.nodeRequest_GetSubCategory().bind(subcategories);
// This is a sub node of Request_GetSubCategory
GetSubCategory subcat = new GetSubCategory(model);
subcat.setPCoreCategory(wdContext.currentReturnElement().getSubCategory() + "%");
Thanks again.
Ridouan
Hi
Look out for the following links. They might help you :
http://help.sap.com/erp2005_ehp_03/helpdata/EN/9b/dad1ae3908ee44a5caf57e10918be9/frameset.htm
These are some of the useful links for Web Service.
I hope this helps you.
Thanx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.