I'm trying to cast a Parameter from a Vector, but keep running into a ClassCastException error. My ultimate goal is to send XML data to an external web service. Pertinent code is below (I marked the trouble spot with *** It Blows up here ***):
URL url = new URL(" services url...");
String xmlString;
xmlString = "<soap:Envelope xmlns:soap=' etc, etc,... </soap:Body></soap:Envelope>";
Parameter parm = new Parameter("xml", String.class,xmlString,"");
Vector params = new Vector();
params.addElement(xmlString);
Call call = new Call(); // prepare the service invocation
call.setMethodName( "process" );
call.setParams( params );
Response response = call.invoke( url, 30000, "" ); // invoke the service
...
marshall(params, getMethodName());
private void marshall(Vector params, String actionStub)throws MyGenericException
{
*** Blows up here! *** Parameter parm = (Parameter)params.firstElement();
...
}
Thanks in advance!
- Lou
URL url = new URL(" services url...");
String xmlString;
xmlString = "<soap:Envelope xmlns:soap=' etc, etc,... </soap:Body></soap:Envelope>";
Parameter parm = new Parameter("xml", String.class,xmlString,"");
Vector params = new Vector();
params.addElement(xmlString);
Call call = new Call(); // prepare the service invocation
call.setMethodName( "process" );
call.setParams( params );
Response response = call.invoke( url, 30000, "" ); // invoke the service
...
marshall(params, getMethodName());
private void marshall(Vector params, String actionStub)throws MyGenericException
{
*** Blows up here! *** Parameter parm = (Parameter)params.firstElement();
...
}
Thanks in advance!
- Lou