tWebService: "java.lang.String cannot be cast to java.util.List"

tWebService: "java.lang.String cannot be cast to java.util.List"

I've been trying to get this tWebService component working for several days now, and I can't seem to find the right combination.
The service is found here, and the schema for the request is quoted below:
POST /soap/v1/Service.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: ""
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
<GetUnsettledTransactionList xmlns="">
<request />

I'm not trying to do anything very fancy. The tJavaRow component takes the incoming encrypted authentication information, decrypts it, and sets it on the output row. The (naive) mapping is in the attached screenshot. However, running this produces the following error:
Exception in component tWebService_1
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
at org.talend.webservice.helper.Utils.resolveInputPath(
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tPostgresqlInput_1Process(
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tJavaFlex_1Process(
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tLibraryLoad_2Process(
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tLibraryLoad_1Process(
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.runJobInTOS(
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.main(
Job auth_net_prototype ended at 13:39 28/11/2013.

I gather from other posts (notably here and here), that I need to do something special for this complex type, however, those posts are not helping me much. I've tried different permutations of Maps and Lists, but I always get some sort of type mismatch problem. Either I don't have the combination right, or I don't understand how to work them into the Input Mapping.
I'm pretty new to Talend, and not very good with SOAP services. I would really appreciate it if someone can help me understand how the tWebService component works with complex types, and what I need to do to get this working.

Re: tWebService: "java.lang.String cannot be cast to java.util.List"

What's your workflow? Did you use list in tjavarow? the java code looks like? You job screenshots will be preferred.
Best regards
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Re: tWebService: "java.lang.String cannot be cast to java.util.List"

I'm sorry, I had selected the screenshots to attach at one point, but I guess they got lost. They're attached now.
Yes, I'm setting up the data in a tJavaRow. The current code looks like:
StandardPBEStringEncryptor encryptor = (StandardPBEStringEncryptor) globalMap.get("encryptor");
String loginId = encryptor.decrypt(row2.gateway_login_id);
String transactionKey = encryptor.decrypt(row2.gateway_transaction_key); =;
row3.gateway_login_id = loginId;
row3.gateway_transaction_key = transactionKey;
// What goes here???
Map<String, List<String>> args = new HashMap<String, List<String>>();
List<String> names = Arrays.asList(loginId);
List<String> transactionKeys = Arrays.asList(transactionKey);
args.put("name", names);
args.put("transactionKey", transactionKeys);
globalMap.put("merchantAuth", args);

I thought I could just set the values onto the output row, and then map the values into the web service request, but wasn't able to make that work. Then, in those last 8 lines or so, I tried various combinations of Lists, Maps, Lists of Maps, and Maps of Lists. Nothing has worked. The errors usually are some sort of type mismatch: "can't cast String to List", "can't cast Map to List", "can't cast List to Map", etc.
One Star

Re: tWebService: "java.lang.String cannot be cast to java.util.List"

Any idea about this? I'm having the same problem.
Thank you very much


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach