WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
WSIFService wsifService = factory.getService(wsdlLocation,serviceNS,serviceName,portTypeNS, portTypeName);
WSIFPort wsifPort = wsifService.getPort(portTypeName);
WSIFOperation wsifOperation = wsifPort.createOperation(operation); WSIFMessage input =wsifOperation.createInputMessage();WSIFMessage output=wsifOperation.createOutputMessage();
WSIFMessage fault =wsifOperation.createFaultMessage();
input.setObjectPart("in0","0407114"); boolean successful = wsifOperation.executeRequestResponseOperation(input,output,fault);Object nextObj = null;
if
(successful)
{
Iterator outIter = output.getPartNames();
while (outIter.hasNext())
{
nextObj= outIter.next();
System.out.println(nextObj.getClass());
System.out.println(nextObj.toString());
}
}
The result of this is that the class is java.lang.String and the object is some decimal value which is correct except for the object type. I've tried this in the past with plain DII apache soap with the following code and it returned the result correctly.
**************************************************************
String endpoint = "http://localhost:8080/jboss-net/services/FPG"
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
setCallAttributes(call);
invokeServiceCall(call);
System.out.println("Call made to "+component_name+" service");
String methodName = "orderFPGTest";
call.setOperationName(methodName);
MessageContext ctx = call.getMessageContext();
Message msg = ctx.getRequestMessage();
System.out.println("The call looks like\n"+call.toString());
call.addParameter("name",org.apache.axis.Constants.XSD_STRING,ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_ANY);
Object res = call.invoke(new Object[] { "0407114" });
System.out.println("ClassType is " +res.getClass());
double result = ((Double)res).doubleValue();
**************************************************************This produced an object of type java.lang.Double as opposed to java.lang.String.
Here's the WSDL for the message.
Does anyone have any idea why this is happening that the WSIF is returning a java.lang.String object and the regular apache soap API returns the correct java.lang.Double?
Thanks,
Mark.
P.s. Apologies for the first message.
