File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes got error when call to >net webservice from java client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "got error when call to >net webservice from java client" Watch "got error when call to >net webservice from java client" New topic
Author

got error when call to >net webservice from java client

laxmidhar prad
Ranch Hand

Joined: Feb 05, 2006
Posts: 33
Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to deserialize a 'http://schemas.xmlsoap.org/soap/envelope/:Parameter' using encoding style 'null'.; targetException=java.lang.IllegalArgumentException: No Deserializer found to deserialize a 'http://schemas.xmlsoap.org/soap/envelope/:Parameter' using encoding style 'null'.]
at org.apache.soap.rpc.Call.invoke(Call.java:244)

MY CODE
-----------------



import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.encoding.SOAPMappingRegistry;
import org.apache.soap.encoding.soapenc.StringDeserializer;
import org.apache.soap.rpc.*;
import org.apache.soap.util.xml.QName;

public class Test_client {

public static void main (String[] args)
throws Exception {

System.out.println("\n\nCalling the SOAP Server to say hello\n\n");
URL url = new URL ("http://localhost/ASVWS/ASVWS.asmx?wsdl");
String name = "satya";
Call call = new Call ( );
String s="//";
String p="/";
//call.setTargetObjectURI("xmlns=http:"+s+"tempuri.org"+p);
SOAPMappingRegistry soapMappingRegistry = new SOAPMappingRegistry();
soapMappingRegistry.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("http://tempuri.org/", "HelloWorldResult"),null,null, new StringDeserializer());
call.setTargetObjectURI( "http://tempuri.org/");
call.setMethodName("HelloWorld");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setSOAPMappingRegistry(soapMappingRegistry);
Vector params = new Vector ( );
params.addElement (new Parameter("name", String.class, name, "http://schemas.xmlsoap.org/soap/encoding/"));
call.setParams (params);

System.out.print("The SOAP Server says: ");

Response resp = call.invoke(url,"http://tempuri.org/HelloWorld" );

if (resp.generatedFault ( )) {
Fault fault = resp.getFault ( );
System.out.println ("\nOuch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode());
System.out.println (" Fault String = " + fault.getFaultString ( ));
} else {
System.out.println("Here");
Parameter result = resp.getReturnValue ( );
System.out.print(result.getValue ( ));
System.out.println( );
}
}
}



Please any help me out on this issue

Thanks in Advance
Hany Shafik
Ranch Hand

Joined: Jun 21, 2008
Posts: 80
Please post the wsdl, as it describes how you will call the Web Service.
laxmidhar prad
Ranch Hand

Joined: Feb 05, 2006
Posts: 33
Hany Shafik wrote:Please post the wsdl, as it describes how you will call the Web Service.



Sorry for delay

here is the WSDL



Benjamin Hiner
Greenhorn

Joined: Feb 27, 2009
Posts: 12
When posting code please use the code tags and the disable smilies option.

[ code ] [ /code ]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: got error when call to >net webservice from java client