Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 12173 invoked from network); 6 Jun 2005 18:11:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jun 2005 18:11:41 -0000 Received: (qmail 49124 invoked by uid 500); 6 Jun 2005 18:11:31 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 49113 invoked by uid 500); 6 Jun 2005 18:11:31 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 49100 invoked by uid 99); 6 Jun 2005 18:11:31 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mailrelay.savvion.com (HELO mailrelay.savvion.com) (206.40.33.101) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 06 Jun 2005 11:11:26 -0700 Received: from mail.savvion.com (mail.savvion.com [10.1.6.6]) by mailrelay.savvion.com (Postfix) with ESMTP id 227F9701DB for ; Mon, 6 Jun 2005 14:49:33 -0400 (EDT) Received: from [127.0.0.1] (dhcp77174.savvion.com [10.1.16.174]) by mail.savvion.com (Postfix) with ESMTP id 043452FC006 for ; Mon, 6 Jun 2005 14:03:54 -0400 (EDT) Message-ID: <42A49224.5030202@savvion.com> Date: Mon, 06 Jun 2005 11:12:52 -0700 From: Ravi Krishnamurthy User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: axis-user@ws.apache.org Subject: Re: wrapped style client References: <42A3E596.6080500@savvion.com> In-Reply-To: <42A3E596.6080500@savvion.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I had to make the following changes in the addParameter: _call.addParameter(new javax.xml.namespace.QName("http://tempuri.org/", "A"),org.apache.axis.Constants.XSD_FLOAT,float.class,ParameterMode.IN); _call.addParameter(new javax.xml.namespace.QName("http://tempuri.org/", "B"),org.apache.axis.Constants.XSD_FLOAT,float.class,ParameterMode.IN); instead of _call.addParameter( "A",org.apache.axis.Constants.XSD_FLOAT,float.class,ParameterMode.IN); _call.addParameter( "B",org.apache.axis.Constants.XSD_FLOAT,float.class,ParameterMode.IN); Dont know why I did not get any exception if that is not right!! Thanks, Ravi Ravi Krishnamurthy wrote: > Hello: > I'm trying to write a client to document/literal webservice as wrapped > style to the following webservice: > > http://chs.gotdotnet.com/quickstart/aspplus/samples/services/MathService/VB/MathService.asmx > > > I have attached my client program. I'm trying to invoke the Add > operation. There are 2 static methods in the program: > > 1. add_good - this gives the expected result (12 + 12 = 24) > 2. add_bad - returns 0 - Passing the same input. Looks like I'm > doing something wrong which is not very obvious to me. Could someone > throw some pointers. > > Thanks for your help and time. > > Regards, > Ravi > > >------------------------------------------------------------------------ > >import org.apache.axis.client.Call; >import org.apache.axis.client.Service; >import org.apache.axis.enum.Style; >import org.w3c.dom.Document; >import org.w3c.dom.Element; > >import javax.xml.namespace.QName; >import javax.xml.rpc.ServiceFactory; >import javax.xml.rpc.ParameterMode; >import java.net.URL; > > >import java.util.Iterator; > >public class MathClient >{ > private static String endpoint = "http://chs.gotdotnet.com/quickstart/aspplus/samples/services/MathService/VB/MathService.asmx"; > private static String wsdlURL = endpoint + "?WSDL"; > public static void main(String [] args) throws Exception { > > > //checkExists(); > add_good(); > > add_bad(); > //checkExists(); > > > > } > > > public static void add_good() throws Exception{ > > Service service = new Service(new URL(wsdlURL), new QName("http://tempuri.org/","MathService")); > Call _call = (Call)(service.createCall(new QName("http://tempuri.org/","MathServiceSoap"), > new QName("http://tempuri/org/","Add"))); > _call.setSOAPActionURI("http://tempuri.org/Add"); > _call.setOperationStyle(Style.WRAPPED); > System.out.println(" Response from add_good is " + _call.invoke(new Object[] {new Float(12) , new Float(12)})); > } > > public static void add_bad() throws Exception{ > > Service service = new Service(); > Call _call = (Call)(service.createCall()); > > _call.setUseSOAPAction(true); > _call.setSOAPActionURI("http://tempuri.org/Add"); > > _call.setTargetEndpointAddress( new java.net.URL(endpoint) ); > _call.setOperationStyle(Style.WRAPPED); > > _call.setOperationName(new QName("http://tempuri.org/","Add")); > _call.addParameter("A",org.apache.axis.Constants.XSD_FLOAT,Float.class,ParameterMode.IN); > _call.addParameter("B",org.apache.axis.Constants.XSD_FLOAT,Float.class,ParameterMode.IN); > > _call.setReturnClass(Float.class); > > System.out.println(" Response from add_bad is " + _call.invoke(new Object[] {new Float(12) , new Float(12)})); > } >} >