Hi

I am learning and trying out Apache SOAP v2.2. i am using xerces 1.4.1 and classpath 
is also properly set.

i am writing a rpc client in java to fetch services listed out in www.xmethods.com. I 
am getting the following error for a net dealer service listed out:

Caught SOAPException
 Fault Code: SOAP-ENV:Client
 Fault Message: No Deserializer found to deserialize a 'http://schemas.xmlsoap.o
rg/soap/envelope/:Parameter' using encoding style 'null'.

my java client code is as follows:
######################################################
 package SoapImpl.ApacheApi;

 import java.net.*; 
 import java.util.*; 
 import org.apache.soap.*; // Body, Envelope, Fault, Header 
 import org.apache.soap.rpc.*; // Call, Parameter, Response 
 import org.apache.soap.transport.http.*;
 import org.apache.soap.util.xml.XMLJavaMappingRegistry;
 import org.apache.soap.encoding.SOAPMappingRegistry;


 public class ApacheClientRPC 
   { 
   public static void main( String[] args ) throws Exception 
     { 
         
         //set soap end point url
         URL url = new URL( "http://64.110.96.190/DotNet/NearestTileDealer.asmx"; ); 
    
         String targetURI = "http://64.110.96.190/DotNet/NearestTileDealer.asmx";;

        // prepare the service invocation 
     Call call = new Call(); 
     call.setTargetObjectURI( targetURI  ); 
     call.setMethodName( "GetDealerInfo" ); 
     call.setSOAPMappingRegistry(new SOAPMappingRegistry());
     call.setEncodingStyleURI( Constants.NS_URI_SOAP_ENC ); 
     Vector params = new Vector(); 
     params.addElement( new Parameter( "zip", String.class, "94041", null ) );
     //params.addElement( new Parameter( "Country", String.class, "India", null ) ); 
     call.setParams( params ); 
      
     try 
       { 
       System.out.println( "invoke service\n" + "  URL= " + url + "\n" + "targetURI= " 
+ targetURI ); 

           // invoke the service 
           Response response = call.invoke( url, "http://tempuri.org/GetDealerInfo"; ); 

           System.out.println("\n"+response.toString()+"\n");//chetan      

           //check response
           if( !response.generatedFault() ) 
         { 
         Parameter result = response.getReturnValue(); // response was OK 
         System.out.println( "Result= " + result.toString() ); 
         } 
       else 
         { 
         Fault f = response.getFault(); // an error occurred 
         System.err.println( "Fault= " + f.getFaultCode() + ", " + 
           f.getFaultString() ); 
         } 
       } 
     catch( SOAPException e ) // call could not be sent properly 
       { 
                  System.err.println("Caught SOAPException");
              System.err.println(" Fault Code: " + e.getFaultCode());
                  System.err.println(" Fault Message: " + e.getMessage());
                  e.printStackTrace();
       } 
     } 
   }
########################################################

Anybody help me out in this please..................

thanx in advance
chetan



_________________________________________________________
For Rs. 2,000,000 worth of Aptech scholarships click below
http://events.rediff.com/aptechsch/scholarship.htm



Reply via email to