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 "Pantvaidya, Vishwajit" <vp...@selectica.com> on 2007/11/08 02:27:23 UTC

[Axis2] Sending or receiving unnamed parameter arrays/lists with Axiom,ADB in Axis2 client

I need to dynamically call any given webservice using its wsdl provided as a parameter. Since I do not know the signature of the service, I need to be able to provide for sending or receiving parameter arrays/lists. So I have coded a client which creates a payload by adding a number of children to an OMElement i.e

OMNamespace ns = fac.createOMNamespace(operationNamespace, "ns1");
payload = fac.createOMElement(operationName, ns);
for (each parameter value) {
OMElement value = fac.createOMElement(parameterName, ns);
value.addChild(fac.createOMText(value, parameterValue.toString()));
payload.addChild(value);
}

Is this correct?

And do I absolutely need to provide parameter names as in the call "OMElement value = fac.createOMElement(parameterName, ns)" or is their another way by which I can only provide a list of input param values and have them associated with the webservice parameters based on position rather than name?


Re: [Axis2] Sending or receiving unnamed parameter arrays/lists with Axiom,ADB in Axis2 client

Posted by Sanka Samaranayke <ss...@gmail.com>.
Hi,

If you are constructing the payload, you need to do the way which is specified by the WSDL of the service. For example, the pay load of a request which will be sent to a particular Web service operation will differ depending on the style it uses (document, rpc) and the encoding (literal, encoded).
So I am not sure whether you can achieve that by just including the parameter names and values as child elements of a parent with operation name.

Best,
--Sanka




Pantvaidya, Vishwajit wrote:
>
> I need to dynamically call any given webservice using its wsdl 
> provided as a parameter. Since I do not know the signature of the 
> service, I need to be able to provide for sending or receiving 
> parameter arrays/lists. So I have coded a client which creates a 
> payload by adding a number of children to an OMElement i.e
>
> OMNamespace ns = fac.createOMNamespace(operationNamespace, "ns1");
>
> payload = fac.createOMElement(operationName, ns);
>
> for (each parameter value) {
>
> OMElement value = fac.createOMElement(parameterName, ns);
>
> value.addChild(fac.createOMText(value, parameterValue.toString()));
>
> payload.addChild(value);
>
> }
>
> Is this correct?
>
> And do I absolutely need to provide parameter names as in the call 
> “OMElement value = fac.createOMElement(parameterName, ns)” or is their 
> another way by which I can only provide a list of input param values 
> and have them associated with the webservice parameters based on 
> position rather than name?
>


-- 
Sanka Samaranayake
WSO2 Inc.

http://www.bloglines.com/blog/sanka
http://www.wso2.org/


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