VS2008 C# cannot get return/export values from SAP (one way connection yet)
Hello Experts,
I have successfully established connection to SAP by using Visual Studio 2008 (C#) and web services:
- I am able to login into the SAP-System with my C#-Application
- I am able to call and run functions with my C#-Application
- I am able to passing over vales from my C#-Application to the function module (importing variables = ok)
The problem I face now is getting return values from the function module (getting values of the exporting variables). I just have no idea how to call the u201CResponse-methodu201D correctly in C#.
I think the problem is hided in the wsdl-xml-file.
Here are my codes (only C# codes are really relevant) I post them step by step:
ABAP CODE OF FUNCTION MODULE:
FUNCTION Z_GET_BP_DATA.
TABLES: but000.
Data: ls_test type but000,
lv_bpid type BU_PARTNER.
u201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201D
u201D importing parameter BPID = type string u201D
u201D exporting parameter BPNAME = type string u201D
u201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201Du201D
lv_bpid = BPID.
SELECT SINGLE * from but000 into ls_test
where PARTNER = lv_bpid.
BPNAME = ls_test-NAME_LAST.
ENDFUNCTION.
[Here|http://ng-webservice.com/myxml.xml] is code of my wsdl-xml-file:
C
APPLICATION MAIN CODE:
using System;
using System.Net;
using System.Collections.Generic;
using System.Text;
using System.Web.Services.Protocols;
using System.Web.Services;
namespace test
class Program
static void Main(string[] args)
try
//Sample Project for calling WS in SAP and writing data
string var_bpid = "0000000082";
string var_bpname;
CookieContainer cookie = new CookieContainer();
webref_get_bp_data.service _proxy1 = new test.webref_get_bp_data.service();
webref_get_bp_data.ZGetBpDataResponse _proxy3 = new test.webref_get_bp_data.ZGetBpDataResponse();
test.webref_get_bp_data.ZGetBpData myref = new test.webref_get_bp_data.ZGetBpData();
test.webref_get_bp_data.ZGetBpDataResponse myresponse = new test.webref_get_bp_data.ZGetBpDataResponse();
_proxy1.Credentials = new NetworkCredential("MYUSER", "MYPASSWORD");
_proxy1.CookieContainer = cookie;
myref.Bpid = var_bpid; // myref gets an id for passing over to the function module
_proxy1.ZGetBpData(myref); // call/run function module with given bpid
var_bpname = _proxy1.ZGetBpData(myref);
var_bpname = myresponse.Bpname; // HOW TO GET EXPORTING VALUE???
Console.WriteLine(myref.Bpid);
Console.WriteLine(var_bpname);
cookie = _proxy1.CookieContainer;
Console.WriteLine("Finish proxy1");
string response = Console.ReadLine();
catch (SoapException exc)
Console.WriteLine("Exception thrown");
throw exc;
string response = Console.ReadLine();
Similar Messages
-
I cannot get my export PDF download because I cannot respond to the verification letter. It cannot be sent with the link I pasted from your e-mail. Order# AD015233965
Hi Export PDF.com,
I just checked your account. It looks as though you gave up, and canceled. I'm so sorry that the subscription didn't work out for you.
If there's anything we can help with, please let us know.
Best,
Sara -
Return multiple values from a method
For a school project I have to make a parameter-less constructor that can input values from the keyboard and calculate those values. Now that I have the values how do I return them? I need to return 3 values from this parameter-less method.
I hoope someone can help.Qwertyfshag wrote:
Here is the wording of the assignment. I have copied and pasted it word for word:
"Declare and use a no-argument (or "parameter-less") constructor to input the data needed, and to do the calculations."
Any advice???Find a teacher who isn't an idiot. That sentence is vague ("to input the data needed"? Does that mean that it's supposed to query the user (which is terrible) or that it's supposed to encapsulate the data as hardcoded values, or what?) and is a bad design. Constructors shouldn't do this sort of thing.
Ok I have done that part and now I want to retrieve the values of the calculations. How can I get those values out of that method What do you mean "that method"? Constructors aren't methods, and they don't return values.
I suppose you could define a class whose constructor queries the user, and which would have a method to return values. That could be pretty simple; the method signature would be like this:
Set<Integer> getValues();
This seems like an advanced problem.It's not advanced; it's just garbage.
I can't post the code in hear because that may constitute cheating. I am allowed to discuss it verbally but I cannot share code, sorry.You can't get a lot of help then. We can't psychically see what you've done so far.
In conclusion: I have to have two methods. One method is a constructorConstructors aren't methods. If your teacher told you that they are, then he/she doesn't know what he/she is doing.
that has NO parameters that will get input from the keyboard (done) and do the calculations (done). The other method must print that values to the screen on separate lines (not done). I don't know how to get the values out of the method.If they're two methods in the same class, then the constructor just needs to store the user input into a field of the class, and the other method can read the values in that field. -
Returning multiple values from a method
I have to return a string and int array from a method (both are only of size 5 for a total of 10) What would be considered the best manner in which to do this ?
Dr there's 10 points in it for you or whoever gives me the best idea ;-Phey here it is easy that you can return many things
what ever you want from a single method man....
you know the main thing what you have to do is.....
Just create a VECTOR or LIST object, then add all the
values what ever you want to return like string and
int array like etc...
Then make the method return type is VECTOR and after
getting the Vector you can Iterate that and you can
get all the values from that method what ever you
want....
jus try this,,,,,,,,,,
Its really work......
reply me..but it relies purely on trust that the returned collection would contain exactly the right number and type of arguments -
How to get edited row values from ADF table?
JDev 11.
I have a table which is populated with data from Bean.
I need to save changes after user make changes in any table cell. InputText is defined for table column component.
I have defined ValueChangeListener for inputText field and AutoSubmit=true. So when user change value in inputText field, method is called:
public void SaveMaterial(ValueChangeEvent valueChangeEvent) {
getSelectedRow();
SaveMaterial(material);
This method should call getSelectedRow which take values from selected table row and save them into object:
private Row getSelectedRow(){
RichTable table = this.getMaterialTable();
Iterator selection = table.getSelectedRowKeys().iterator();
while (selection.hasNext())
Object key = selection.next();
table.setRowKey(key);
Object o = table.getRowData();
material = (MATERIAL) o;
System.out.println("Selected Material Desc = "+material.getEnumb());
return null;
Problem is that getSelectedRow method doesnt get new (edited) values, old values are still used.
I have tried to use ActiveButton with same method and it works fine in that case. New values are selected from active row and inserted into object.
JSF:
<af:table var="row" rowSelection="single" columnSelection="single"
value="#{ManageWO.material}" binding="#{ManageWO.materialTable}">
<af:column sortable="false" headerText="E-number">
<af:inputText value="#{row.enumb}" valueChangeListener="#{ManageWO.SaveMaterial}" autoSubmit="true"/>
</af:column>
<af:column sortable="false" headerText="Description">
<af:inputText value="#{row.desc}" valueChangeListener="#{ManageWO.SaveMaterial}" autoSubmit="true"/>
</af:column>
</af:table>
<af:activeCommandToolbarButton text="Save" action="#{ManageWO.EditData}"/>
What is a correct place from where save method should be called to get new (edited) values from ADF table?
Thanks.Did you look into the valueChangeEvent?
It has oldValue and newValue attributes.
public void SaveMaterial(ValueChangeEvent valueChangeEvent) {
Object oldVal = valueChangeEvent.getOldValue();
Object newVal = valueChangeEvent.getNewValue();
// check if you see what you are looking for.....
getSelectedRow();
SaveMaterial(material);
}Timo -
How to return multiple values from dialog popup
hi all
I'm using ADF 10g. I have a requirement that I have to return multiple values from a dialog.
I have a page containing a table with a button which calls the dialog. The dialog contains a multi-select table where i want to select multiple records and add them to the table in the calling page.
In the backing bean of the calling page, I have the returnListener method.
I am thinking that I have to store the selected rows from dialog in an array and return that array to the returnListener...but I don't know how to go about it with the code.
Can someone help me out with it?
thanksHi Frank,
I'm trying to implement your suggestion but getting comfused.
AdfFacesContext.getCurrentInstance().returnFromDialog(null, hashMap) is called in ActionListener method, from what I understood.
ReturnListener method already calls it, so no need to call explicitly.
Okay here's what i'm doing.
command button launches the dialog on the calling page.
In the dialog page, there is a button "select", which when i click, closes the dialog and returns to calling page. I put a af:returnActionListener on this button, which logically should have a corresponding ReturnListener() in the calling page backing bean.
Now I have 3 questions:
1. do i have to use ActionListener or ReturnListener?
2. where do I create the hashMap? Is it in the backing bean of the dialog or in the one of calling page?
3. how do I retrieve the keys n values from hashmap?
please help! thanks
This is found in the backing bean of calling page:
package mu.gcc.dms.view.bean.backing;
import com.sun.java.util.collections.ArrayList;
import com.sun.java.util.collections.HashMap;
import com.sun.java.util.collections.List;
import java.io.IOException;
import java.util.Map;
import javax.faces.application.Application;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import javax.faces.event.ActionEvent;
import mu.gcc.dms.model.services.DMSServiceImpl;
import mu.gcc.dms.model.views.SiteCompaniesImpl;
import mu.gcc.dms.model.views.SiteCompaniesRowImpl;
import mu.gcc.dms.model.views.lookup.LkpGlobalCompaniesImpl;
import mu.gcc.util.ADFUtils;
import mu.gcc.util.JSFUtils;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.view.faces.context.AdfFacesContext;
import oracle.adf.view.faces.event.ReturnEvent;
import oracle.adf.view.faces.model.RowKeySet;
import oracle.binding.AttributeBinding;
import oracle.binding.BindingContainer;
import oracle.binding.OperationBinding;
import oracle.jbo.AttributeDef;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.RowIterator;
import oracle.jbo.RowSetIterator;
import oracle.jbo.domain.Number;
import oracle.jbo.server.java.util.Iterator;
public class CompanyList {
private BindingContainer bindings;
private Map hashMap;
DMSServiceImpl service =(DMSServiceImpl)ADFUtils.getDataControlApplicationModule("DMSServiceDataControl");
SiteCompaniesImpl siteCompanyList = service.getSiteCompanies();
LkpGlobalCompaniesImpl globalCompanyList = service.getLkpGlobalCompanies();
public CompanyList() {
public BindingContainer getBindings() {
return this.bindings;
public void setBindings(BindingContainer bindings) {
this.bindings = bindings;
*public void setHashMap(Map hashMap) {*
*// hashMap = (Map)new HashMap();*
this.hashMap = hashMap;
*public Map getHashMap() {*
return hashMap;
public String searchCompanyButton_action() {
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("Execute");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
return null;
*public void addCompanyActionListener(ActionEvent actionEvent){*
AdfFacesContext.getCurrentInstance().returnFromDialog(null, hashMap);
public void addCompanyReturnListener(ReturnEvent returnEvent){
//how to get hashmap from here??
public String addCompanyButton_action() {
return "dialog:globalLovCompanies";
} -
How Can I get multi column values from dynamic search help?
Hi Gurus;
I'm using dynamic search help in my program.
I want to get multi column values from search help. But I dont know solution for this issue.
I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
How Can I get multi column values from dynamic search help?
Thanks.Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
There are like 3 steps.
You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined (just to keep it straight, i will be putting here) data: It_return type standard table of ddshretval.
Next step is to call the function module. Make sure you have values in IT_VALTAB.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'FLD2'
value_org = 'S'
tables
value_tab = It_VALTAB
return_tab = It_return
dynpfld_mapping = It_dynpfld
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
perform get_selected_fields tables It_return.
endif.
The code within the perform GET_SELECTED_FIELDS - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
I need a internal table as well as a work area here. like,
data: lt_fields type table of dynpread,
la_fields type dynpread.
field-symbols: <fs_return> type ddshretval.
so fill out LT_FIELDS from the IT_RETURN table
loop at lt_return assigning <fs_return>.
la_fields-fieldname = <fs_return>-retfield.
la_fields-fieldvalue = <fs_return>-fieldval.
append la_fields to lt_fields.
clear: la_fields.
endloop.
Call the FM to update the dynpro
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-repid
dynumb = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
tables
dynpfields = lt_fields
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
others = 8.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
good luck -
How to get the Node Value from XmlValue result?
Hi ,
I am not able to get the Node Value from the result. In my XQuery im selecting till a Node, if i change my query as
collection('PhoneBook')/phone_book/contact_person/address/string()", qc);
im getting the node value, but here the problem is its not a Node so i cannot get the Node name.
So how can i get the Node Name and Node value together?
any help please ????
XML :
<?xml version="1.0" encoding="UTF-8"?>
<phone_book>
<contact_person>
<name>
<first_name>Michael</first_name>
<second_name>Harrison</second_name>
</name>
<address city="yyyyy" pincode="600017" state="xxxxx">
176 Ganesan street, Janakinagar, alwarthirunagar
</address>
</contact_person>
<phone_number type="mobile">9881952233</phone_number>
<phone_number type="home">044-24861311</phone_number>
<phone_number type="office">080-12651174</phone_number>
</phone_book>
Code:
XmlQueryContext qc = manager.createQueryContext();
XmlResults rs = manager.query
("collection('PhoneBook')/phone_book/contact_person/address", qc);
while(rs.hasNext()){
XmlValue val = rs.next();
System.out.println(val.getNodeName() + " = [ " + val.getNodeValue() + " ] ");
Output
address = [ ]You are right, this seemed un-intuitive to me too, but I finally understood how it's done.
The "value" of a node is actually the total amount of text that is not contained in any of the node's child nodes (if any). So a node with child nodes can still have text value.
To get the 'value' of an element node, you must therefore concatenate the values of all children of type "XmlValue::TEXT_NODE", of that node. Try it.
In your example, the <address> node has no child elements, my guess is that BDB XML stores the address string "176 Ganesan street, Janakinagar, alwarthirunagar" inside a child node of <address> node (of type XmlValue::TEXT_NODE) because you wrote the string on a separate line. -
How do I return a value from a column based on info from neighboring columns?
I have a table of data that looks similar to this:
Weight
Name
School
Division
106
Name1
School1
1
106
Name2
School2
2
106
Name3
School3
3
106
Name4
School4
4
113
Name5
School5
1
113
Name6
School6
2
113
Name7
School1
3
113
Name8
School3
4
It's a very large table, so there will be multiple matches for Schools, and occasionally a few matches for Names, but there will always be only one match for a given Weight and Division.
In a separate table, how can I get the name of the person associated with the unique weight and division?
In my head, the formula goes" "Look in the Weight column to find 106, then look in the Division column to find 4, then return the value from the Name column." But I can't figure out the formula that will do that.
Any thoughts?Hi momogabi,
This can be easily done with an index column.
The formula I used in your original table for the index column is:
=A2&"-"&D2. This was filled down. The column can be hidden.
You can see the formula in the search table. If I wanted to eliminate the index column in that table the formula would look something like:
=INDEX('Table 1-1'::B,MATCH(A2&"-"&B2,'Table 1-1'::E,0),1)
Hope this helps.
quinn -
How do I get the export value of a combox upon opening a document?
I can't find a way to access the currently selected export value from a combobox upon opening a PDF document (without a keystroke event), so I'm using a very ugly trick (I have a function with a switch statement that returns a value that matches the export value, based on the current combo face value.
Isn't there a way to retrieve the export value of a combo box upon opening a document?
Thanks!
FredThe following code segment is for the change event of a comboBox.
Whenever a selection is made I want to populate a Form Field with the face value of the comboBox.
This isn't working - and I can't determine why -
it appears that I am not dereferencing the text properly - but this is my best effort based on my knowledge.
Can anyone help with this ?
Thanks
var
combo1 = topmostSubform.Page1.DropDownList1.Text;
var Deflt = 1;
switch
(combo1){
case
"Education":
CurrentValue1.rawValue
= topmostSubform.Page1.DropDownList1.Text;
break
case
"Demographics":
CurrentValue1.rawValue
= topmostSubform.Page1.DropDownList1.Text;
break
case
"Licenses":
CurrentValue1.rawValue
= topmostSubform.Page1.DropDownList1.Text;
break
case
"Certifications":
CurrentValue1.rawValue
= topmostSubform.Page1.DropDownList1.Text;
break
case
"Business Information":
CurrentValue1.rawValue
= topmostSubform.Page1.DropDownList1.Text;
break;
case
"Disclosure Questions":
CurrentValue1.rawValue
= topmostSubform.Page1.DropDownList1.Text;
break
default:
Deflt = 0;} -
Why I cannot get payroll result value ?
Expert,
In EBS Payroll R12, I define two elements A and B. A has priority 1500, B has priority 3500. So A will be processed ahead of B. I write a pl/sql package to calculate B, and attach the package to B through formula result. In the package, I will use "Pay value" of A, the logic can be abstracted as " A-Pay value * 0.05". However, the result of B is not my expected. I track my package and find the program doesn't get the Pay Value. I am sure my sql statement is right. So my conclusion is for one assignment calculation, these elements payroll result will be written back to DB together rather than one by one, right?
For my case, it I want to use the pay value of elements which have been calculated, how to do? Please give me some advice.
Thanks in advance.Dear thierry,
Thanks for your kindly help. I follow your hints to modify my fast formula of B as below:
Cal_B:
dummy=A_BALANCE_ASG_RUN /* A_Balance will contain element A*/ /* a new line added here */
v_rtvl=CAL_B_external_F /* It is formula function, which will contain external PLSQL call. The plsql will use the Pay value of A */
return v_rtvl
Per my understanding, after calling statement "dummy=A_BALANCE_ASG_RUN", the relevant pay result of A should be flushed to DB.
unfortunately, when I process my payroll, the result still remains unchange. It seems that CAL_B_external_F cannot get the "Pay value" of A
If I modify fast formula as below:
Cal_B:
v_rtvl=A_BALANCE_ASG_RUN
return v_rtvl
I can get v_rtvl whose value is equal to A_BALANCE_ASG_RUN. It seems the value of A_BALANCE_ASG_RUN can be captured in the fast formula.
So, How do I understand your hints as below:
"A element_A_asg_run in your second fast formula, before calling the plsql, can do the trick, eventually."
I am eager to your help.
Regards,
Michael
Edited by: Gang2 on Mar 22, 2009 10:45 PM -
Getting 2nd Least Value from Different Column
Hi there All,
I have one odd requirement.
I hava table which has diffrent columns of numeric Datatype.
The task is to get the least values from the table.
I can take the least value by least(col1,col2,col3 ...) function.Until this stage it is fine.
But also I have take 2nd least value and 3rd least value, which I am quite unsure how to get it.
Looking forward for suggestions.
Thanks in Advance.
Regards,
AjeetThe following is a generic solution that will allow you to select the nth least and allow you to pass as many column names as you like and will return null if the nth least requested exceeds the number of distinct values. The nleast function that I wrote uses the str2tbl function by Tom Kyte. I have included a demonstration of its usage below. The value returned for the 1st least is the same as that returned by the least function.
This should have been posted on the SQL and PL/SQL discussion group of these forums, rather than the general database. I also posted the same response in the SQL discussion group of the Orafaq forums.
scott@ORA92> -- test data:
scott@ORA92> SELECT * FROM your_table
2 /
COL1 COL2 COL3
1 2 3
4 6 5
8 7 9
11 12 10
15 13 14
18 17 16
6 rows selected.
scott@ORA92> -- type and functions:
scott@ORA92> create or replace type myTableType as table of number;
2 /
Type created.
scott@ORA92> create or replace function str2tbl( p_str in varchar2 )
2 return myTableType
3 as
4 l_str long default p_str || ',';
5 l_n number;
6 l_data myTableType := myTabletype();
7 begin
8 loop
9 l_n := instr( l_str, ',' );
10 exit when (nvl(l_n,0) = 0);
11 l_data.extend;
12 l_data( l_data.count ) := ltrim(rtrim(substr(l_str,1,l_n-1)));
13 l_str := substr( l_str, l_n+1 );
14 end loop;
15 return l_data;
16 end;
17 /
Function created.
scott@ORA92> CREATE OR REPLACE FUNCTION nleast
2 (p_n IN NUMBER,
3 p_nums IN VARCHAR2)
4 RETURN NUMBER
5 AS
6 v_nleast NUMBER;
7 BEGIN
8 SELECT DISTINCT column_value
9 INTO v_nleast
10 FROM (SELECT column_value,
11 DENSE_RANK () OVER (ORDER BY column_value) AS num_rk
12 FROM (select *
13 from table (CAST (str2tbl (p_nums) AS mytabletype)))
14 WHERE column_value IS NOT NULL)
15 WHERE num_rk = p_n;
16 RETURN v_nleast;
17 EXCEPTION
18 WHEN OTHERS THEN RETURN NULL;
19 END nleast;
20 /
Function created.
scott@ORA92> SHOW ERRORS
No errors.
scott@ORA92> -- query:
scott@ORA92> SELECT col1, col2, col3,
2 LEAST (col1, col2, col3) AS the_least,
3 nleast (1, col1 || ',' || col2 || ',' || col3) AS first_least,
4 nleast (2, col1 || ',' || col2 || ',' || col3) AS second_least,
5 nleast (3, col1 || ',' || col2 || ',' || col3) AS third_least,
6 nleast (4, col1 || ',' || col2 || ',' || col3) AS fourth_least
7 FROM your_table
8 /
COL1 COL2 COL3 THE_LEAST FIRST_LEAST SECOND_LEAST THIRD_LEAST FOURTH_LEAST
1 2 3 1 1 2 3
4 6 5 4 4 5 6
8 7 9 7 7 8 9
11 12 10 10 10 11 12
15 13 14 13 13 14 15
18 17 16 16 16 17 18
6 rows selected. -
Get the Cookie Value from Different Application Servers
Hi All,
I am using the two applications with different application servers. How to get the cookie values from one to another application. Shall i know any sample codes?
Thanks
MaalanA cookie carries a domain name. The browser will only return cookies whose domain matches to domain to which the request is made, however although you can use a partial domain name providing it's not too generic. So, when you add a cookie you need to explicitly set the domain name on the cookie to, for example, your company suffix like ".acme.com", then the cookie should be returned to all the servers under that domain e.g. server1.acme.com and server2.acme.com.
-
How can i get the all values from the Property file to Hashtable?
how can i get the all values from the Property file to Hashtable?
ok,consider my property file name is pro.PROPERTIES
and it contain
8326=sun developer
4306=sun java developer
3943=java developer
how can i get the all keys & values from the pro.PROPERTIES to hashtable
plz help guys..............The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
InputStream is = new FileInputStream("tivoli.properties");
props.load(is); -
Get all the values from a multiple select in a multipart form
Hi there!
I am using a form with enctype="multipart/form-data" in order to upload files from the form.
I have read this page: http://commons.apache.org/fileupload/using.html and everything works well for my form.
The only problem is that I can't get all the values from a "multiple select" html object. I get only one value.
Using servlets I have used this method:
public java.lang.String[] getParameterValues(java.lang.String name) But now I have enctype="multipart/form-data" in my form and I can't use this way...
Is there a way to get all the values of a multi-valued parameter?
Thanks a lot!
StefanoHi
I have got solution for this problem so, I am listing here logic
assume tag name of html
<select name="moption" multiple="multiple">
iterate it in as
String moption="";
boolean cnt=true;
while(itr.hasNext())
FileItem fi=(FileItem)itr.next();
if(fi.isFormField())
if(fi.getFieldName().equals("moption"))
if(cnt==true)
moption=fi.getString();
cnt=false;
else
moption=moption+","+fi.getString();
If wants more help then mail me your problem
at [email protected]
Thanks!
Anand Shankar
Edited by: AnandShankar on 6 Nov, 2009 12:54 PM
Maybe you are looking for
-
Guys i have a problem, I used to download apps from one of my friends apple id, now i created my new account, but when i was about to update my apps its asks for my friends id and password. now how could i update my old apps from my new apple id?
-
DS 1.3 changing the value of a variable in a planning function
Hello, i created a planning application with Design Studio 1.3 and one of my planning functions is a revaluation function which uses a variable for the revaluation factor. In Analysis for Office you can set a value for this factor by selecting the pl
-
Total time to FCIP Tunnel be disconnected
I use MDS9222i to Extend SAN with FCIP. In my FCIP profile, tcp min-retransmit-time is 300ms, tcp max-retransmission is default(Maximum number of re-transmissions is 4). With these two value, Can I calculate the time that the FCIP tunnel to be discon
-
I can't remember my passcode for my iPad so cannot access it?
I cannot remember my passcode ( 4 digits ) for my iPad so cannot access it?
-
Approval work flow should work when the KM folder has Write access
Dear all, I have a following scenario. There are set of KM folders and the users can upload documents in those folders ( users has read/write permission) and for those folders i have a approval process as well but when i give read and write access fo