You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by nancy <na...@daffodildb.com> on 2006/06/05 12:07:28 UTC

[Axis2] How to make soap request envelope with string[] as input parameter

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


RE: [Axis2] How to make soap request envelope with string[] as input parameter

Posted by Martin Gainty <mg...@hotmail.com>.
Can you send us the WSDL you are working with

Martin

______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official 
business of Sender. This transmission is of a confidential nature and Sender 
does not endorse distribution to any party other than intended recipient. 
Sender does not necessarily endorse content contained within this 
transmission.




>
>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
>



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org