I got help from my friend and was able to arrive at the answer .
The problem is that the soap call , gives a soap response which comes as a bean of type "FrsFileSoapDO" . As I have not given anything in code of how my program will understand the received bean , that gave me an error saying "could not find deserializer for type {http://Url}FrsFileSoapDO
" .
Now the step's to clear the problem is
1) create a "QName" to say what is the namespace that "FrsFileSoapDO" refers to .
2) create Bean serializer (that knows how to serialize the bean),
3) create a Bean deserializer (that knows how to deserialize the bean) ,
4) Do the mapping saying that the QName q maps to the class FrsFileSoapDO.class (before that make sure that you have the FrsFileSoapDO.class with you and you have imported it )
Now lets implement this in the program , (I am repeating only the try block here)
try {
String endpoint ="http://RequestUrl";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
QName q = new QName ("http://Url", "FrsFileSoapDO"); // step 1
BeanSerializerFactory bsf = new BeanSerializerFactory(FrsFileSoapDO.class,q); // step 2
BeanDeserializerFactory bdf = new BeanDeserializerFactory(FrsFileSoapDO.class,q); // step 3
call.registerTypeMapping(FrsFileSoapDO.class,q, bsf, bdf); //step 4
call.setOperationName(new QName(endpoint, "getFrsFileData"));
FrsFileSoapDO s = (FrsFileSoapDO) call.invoke(new Object[] { "24BB7","frs1001" } );
System.out.println(s.getFilename());
}
This works giving me the expected output.
The document for the functions Call,BeanSerializerFactory,BeanDeserializerFactory are available at BeanSerializerFactory and BeanDeserializerFactory
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…