
import java.util.*;
import java.net.*;

import org.apache.soap.*;
import org.apache.soap.rpc.*;
import org.apache.soap.encoding.SOAPMappingRegistry;
import org.apache.soap.encoding.soapenc.BeanSerializer;
import org.apache.soap.util.xml.QName;

public class client {

  public static void main(String[] args)  {

    // Process the arguments.


    // Build the call.
		try	{
			URL url = new URL ("http://localhost/soap/servlet/rpcrouter");

			Call call = new Call();
			call.setTargetObjectURI("urn:pop_service");
			call.setMethodName("scriey");
			call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
			//
			// Invoke the call.
			Response resp = null;

			try	{
				resp = call.invoke(/* router URL */ url, /* actionURI */ "" );
				//resp = call.invoke(url, "" );

			}	catch( SOAPException e ) {
				System.err.println("Caught SOAPException (" + e.getFaultCode() + "): " + e.getMessage());
				System.exit(-1);
			}

			// Check the response.
			if( !resp.generatedFault() ){
					// response.getReturnValue()
					Parameter result = resp.getReturnValue(); // response was OK
					System.out.println( "before result ");
          System.out.println( "Result= " + result.getValue() );
			}
			else	{
				Fault fault = resp.getFault();
				System.err.println("Generated fault: ");
				System.out.println ("  Fault Code   = " + fault.getFaultCode());
				System.out.println ("  Fault String = " + fault.getFaultString());
			}
      System.out.println("vege");
      System.exit(0);

		}	catch(Exception e){
			e.printStackTrace();
      System.out.println("nagy catch...");
		}


  } // of main
} // off class
