Hi

 

I want to send the string[] as input to web service.I am creating the soapRequestEnvelope as follows:

 

Param contains the parameter name as key and value as value of that key.

 

private SOAPEnvelope getRequestEnvelope(String operationName,

                                    HashMap param, String webserviceNameSpace) {

 

                        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

                        SOAPEnvelope envelope = fac.getDefaultEnvelope();

                        OMNamespace namespace = fac.createOMNamespace(webserviceNameSpace,

                                                operationName);

 

                        OMElement params1 = fac.createOMElement(operationName, namespace);

                        if(param!=null){

                        Set set = param.keySet();

                        Iterator iter = set.iterator();

 

                        while (iter.hasNext()) {

                                    String paramName = iter.next().toString();

                                    Object paramValue = param.get(paramName);

                                    OMElement paramOM = fac.createOMElement(paramName, namespace);                        

                                    paramOM.setText( paramValue.toString());

                                    params1.addChild(paramOM);

                        }

                        }

                        envelope.getBody().setFirstChild(params1);

 

                        System.out.println(envelope.toString());

                        return envelope;

            }

 

In this I am using OMElement to reperesent the data and setting the the data as string using its setText method.It means my all input parameters must be string.

 

Please help how I can remove this mistake (using only String).

 

thanks

Reply via email to