Dear salarzi, This link will help you.
http://ws.apache.org/axis/java/apiDocs/org/apache/axis/message/SOAPEnvelope.html Kindly Regards, Krishantha Manjula On Sat, Feb 12, 2011 at 6:14 AM, Sardar Hussain <salarzi_...@yahoo.com>wrote: > Hi, > > I have an array of integers in an Axis2 web service method, and I am using > operationclient to send my soap request. > My web service method is as follows > public int calculateMean(int [] array) { > > int sum=0; > for (int i=0;i<array.length;i++) > sum+=array[i]; > return sum/array.length; > } > > My SOAPEnvelop is as follows, however it throws error. > > > SOAPFactory fac = OMAbstractFactory.getSOAP11Factory(); > SOAPEnvelope envelope = fac.getDefaultEnvelope(); > > OMNamespace omNs = fac.createOMNamespace( > getNameSpace(wsdl), "ns"); > OMNamespace argNM=fac.createOMNamespace("", ""); > > OMElement method = fac.createOMElement("calculateMean", omNs); > > OMElement arg1 = fac.createOMElement("a", argNM); > > arg1 = getBinaryOfArray(); > > method.addChild(arg1); > > envelope.getBody().addChild(method); > } > public OMElement getBinaryOfArray(){ > > int[] a= new int[9]; > a[0]=9; > a[1]=8; > a[2]=6; > XMLStreamReader arrayRead = BeanUtil.getPullParser(a); > StreamWrapper parser = new StreamWrapper(arrayRead); > StAXOMBuilder omBuilder = > OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(), > parser); > OMElement arrayElement = omBuilder.getDocumentElement(); > > return arrayElement; > } > > However the above code doesnot invoke the required method. > > Can anybody help how to create a SOAPEnvelope for a client to call this > service method. > Regards, > > Sardar > >