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

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

Hi,
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
Host: apitest.authorize.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://api.authorize.net/soap/v1/GetUnsettledTransactionList"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetUnsettledTransactionList xmlns="https://api.authorize.net/soap/v1/">
<merchantAuthentication>
<name>string</name>
<transactionKey>string</transactionKey>
</merchantAuthentication>
<request />
</GetUnsettledTransactionList>
</soap:Body>
</soap:Envelope>

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(Utils.java:23)
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tPostgresqlInput_1Process(auth_net_prototype.java:2067)
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tJavaFlex_1Process(auth_net_prototype.java:675)
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tLibraryLoad_2Process(auth_net_prototype.java:565)
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tLibraryLoad_1Process(auth_net_prototype.java:477)
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.runJobInTOS(auth_net_prototype.java:2564)
at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.main(auth_net_prototype.java:2409)
disconnected
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.
Thanks,
Eric
Moderator

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

Hi,
What's your workflow? Did you use list in tjavarow? the java code looks like? You job screenshots will be preferred.
Best regards
Sabrina
--
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.id = row2.id;
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"

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