passing bean as web service parameter with WSIF
Hi,
I want to call a web service that accept a bean as parameter .
here is my code :
String wsdlLocation="http://localhost:9080/WEBSERVIS/wsdl/ornekSOAP.wsdl";
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
WSIFService service = factory.getService(
wsdlLocation, // location of the wsdl file
null, // service namespace
null, // service name
null,
null
);
service.mapType(
new javax.xml.namespace.QName(
"http://schemas.xmlsoap.org/wsdl/",
"sayi"),
Odeme.class);
service.mapType(
new javax.xml.namespace.QName(
"http://schemas.xmlsoap.org/wsdl/",
"cikis"),
String.class);
WSIFPort port = null;
if (port == null) {
port = getPortFromAvailablePortNames(service);
}
WSIFOperation operation =
port.createOperation("ornek", "tns:ornekRequest", "tns:ornekResponse");
WSIFMessage inputMessage = operation.createInputMessage();
WSIFMessage outputMessage = operation.createOutputMessage();
WSIFMessage faultMessage = operation.createFaultMessage();
Odeme odeme = new Odeme();
odeme.setOdeme_sira_no(1);
odeme.setBanka_hesap_no("100");
odeme.setBolumkodu("10023");
odeme.setCek_hes_al_tar_kur(new BigDecimal("1"));
odeme.setDeleteFlag(true);
inputMessage.setObjectPart("sayi", odeme);
outputMessage.setObjectPart("cikis", "cikis");
boolean operationSucceeded =
operation.executeRequestResponseOperation(
inputMessage,
outputMessage,
faultMessage);
After running this code the following exception appears :
WSWS3701E: Error: An exception was encountered. Use the wsdeploy command to deploy your application. The exception is java.io.IOException: WSWS3037E: Error: Serialization cannot occur for org.example.www.Odeme. Debug deploy artifact build numbers={pre-WAS 6.0 build}
at com.ibm.ws.webservices.engine.WebServicesFault.makeFault(WebServicesFault.java:192)
at com.ibm.ws.webservices.engine.SOAPPart.writeTo(SOAPPart.java:901)
Whats the reason ? how can I solve this problem ?