Hi,
I had mailed u asking how to use an ASP generated by the MS Soap Toolkit as end point URL in my Apache Soap on Linux.


My End point URL generated by MS Soap toolkit is on a Microsoft machine whose IP is 10.0.0.20

The method prototype in my service is
int Square(int I)

My client program in linux is as follows:
=========================================================================
package samples.stex;

import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;

class winclient
{
        static URL url;

        public static void main(String as[])
        {
                int a;

BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
try
{
System.out.print("\nA: ");
a = Integer.parseInt (br.readLine());
7,1


doOp ("Square", a);

                } catch (Exception e) { }
        }


public static void doOp (String op, int arg1)
{
try
{
//url = new URL ("http://localhost:8080/soap/servlet/rpcrouter";);
url = new URL ("http://10.0.0.20/lSoap.asp";);
Call call = new Call ();
call.setTargetObjectURI ("uri:");
call.setMethodName (op);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector ();


params.addElement (new Parameter("I", int.class,
new Integer (arg1), null));
call.setParams (params);
Response resp = call.invoke (/* router URL */ url, /* actionURI */ "http://tempuri.org/action/lSoap."; );


                        // Check the response.
                        if (resp.generatedFault ())
                        {
                                Fault fault = resp.getFault ();

System.out.println ("Generated fault: " + fault);
}
else
{
Parameter result = resp.getReturnValue ();
System.out.println ("Result: " + result);//.getValue());
}
}
catch( Exception e ) {
e.printStackTrace();
}
}
}
=======================================================================


Pls tell me whether my TargetObjectURI and the rest are correct.

Thank you.

Arvind. K.


ARVIND ___________________________________________________ Art meets Anesthesia; Shefali Weds Dr. Raman. Rediff Matchmaker strikes another interesting match !! Visit http://matchmaker.rediff.com?1



Reply via email to