<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: tWebService: &amp;quot;java.lang.String cannot be cast to java.util.List&amp;quot; in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tWebService-quot-java-lang-String-cannot-be-cast-to-java-util/m-p/2314177#M84969</link>
    <description>I'm sorry, I had selected the screenshots to attach at one point, but I guess they got lost. They're attached now. 
&lt;BR /&gt;Yes, I'm setting up the data in a tJavaRow. The current code looks like: 
&lt;BR /&gt; 
&lt;PRE&gt;StandardPBEStringEncryptor encryptor = (StandardPBEStringEncryptor) globalMap.get("encryptor");&lt;BR /&gt;String loginId = encryptor.decrypt(row2.gateway_login_id);&lt;BR /&gt;String transactionKey = encryptor.decrypt(row2.gateway_transaction_key);&lt;BR /&gt;row3.id = row2.id;&lt;BR /&gt;row3.gateway_login_id = loginId;&lt;BR /&gt;row3.gateway_transaction_key = transactionKey;&lt;BR /&gt;// What goes here???&lt;BR /&gt;Map&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt; args = new HashMap&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt;();&lt;BR /&gt;List&amp;lt;String&amp;gt; names = Arrays.asList(loginId);&lt;BR /&gt;List&amp;lt;String&amp;gt; transactionKeys = Arrays.asList(transactionKey);&lt;BR /&gt;args.put("name", names);&lt;BR /&gt;args.put("transactionKey", transactionKeys);&lt;BR /&gt;globalMap.put("merchantAuth", args);&lt;/PRE&gt; 
&lt;BR /&gt;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.</description>
    <pubDate>Mon, 02 Dec 2013 08:52:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-12-02T08:52:48Z</dc:date>
    <item>
      <title>tWebService: "java.lang.String cannot be cast to java.util.List"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWebService-quot-java-lang-String-cannot-be-cast-to-java-util/m-p/2314175#M84967</link>
      <description>Hi, 
&lt;BR /&gt;I've been trying to get this tWebService component working for several days now, and I can't seem to find the right combination. 
&lt;BR /&gt;The service is found 
&lt;A href="https://apitest.authorize.net/soap/v1/Service.asmx?op=GetUnsettledTransactionList" target="_blank" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;, and the schema for the request is quoted below: 
&lt;BR /&gt; 
&lt;PRE&gt;POST /soap/v1/Service.asmx HTTP/1.1&lt;BR /&gt;Host: apitest.authorize.net&lt;BR /&gt;Content-Type: text/xml; charset=utf-8&lt;BR /&gt;Content-Length: length&lt;BR /&gt;SOAPAction: "https://api.authorize.net/soap/v1/GetUnsettledTransactionList"&lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR /&gt;&amp;lt;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/"&amp;gt;&lt;BR /&gt;  &amp;lt;soap:Body&amp;gt;&lt;BR /&gt;    &amp;lt;GetUnsettledTransactionList xmlns="https://api.authorize.net/soap/v1/"&amp;gt;&lt;BR /&gt;      &amp;lt;merchantAuthentication&amp;gt;&lt;BR /&gt;        &amp;lt;name&amp;gt;string&amp;lt;/name&amp;gt;&lt;BR /&gt;        &amp;lt;transactionKey&amp;gt;string&amp;lt;/transactionKey&amp;gt;&lt;BR /&gt;      &amp;lt;/merchantAuthentication&amp;gt;&lt;BR /&gt;      &amp;lt;request /&amp;gt;&lt;BR /&gt;    &amp;lt;/GetUnsettledTransactionList&amp;gt;&lt;BR /&gt;  &amp;lt;/soap:Body&amp;gt;&lt;BR /&gt;&amp;lt;/soap:Envelope&amp;gt;&lt;/PRE&gt; 
&lt;BR /&gt;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: 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in component tWebService_1&lt;BR /&gt;java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List&lt;BR /&gt;	at org.talend.webservice.helper.Utils.resolveInputPath(Utils.java:23)&lt;BR /&gt;	at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tPostgresqlInput_1Process(auth_net_prototype.java:2067)&lt;BR /&gt;	at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tJavaFlex_1Process(auth_net_prototype.java:675)&lt;BR /&gt;	at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tLibraryLoad_2Process(auth_net_prototype.java:565)&lt;BR /&gt;	at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.tLibraryLoad_1Process(auth_net_prototype.java:477)&lt;BR /&gt;	at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.runJobInTOS(auth_net_prototype.java:2564)&lt;BR /&gt;	at auth_net_prototype.auth_net_prototype_0_1.auth_net_prototype.main(auth_net_prototype.java:2409)&lt;BR /&gt; disconnected&lt;BR /&gt;Job auth_net_prototype ended at 13:39 28/11/2013. &lt;/PRE&gt; 
&lt;BR /&gt;I gather from other posts (notably 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCpQPCA0" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/tWebService-provide-a-Map-to-create-a-complexType/td-p/101937&lt;/A&gt; and 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCklOCAS" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-tWebService-quot-You-must-provide-a-Map-to-create-a/td-p/75778&lt;/A&gt;), 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. 
&lt;BR /&gt;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. 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;Eric 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBpO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157363i031B9FB9B1436E79/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBpO.png" alt="0683p000009MBpO.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBpP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156179i09E6FD9445124ADA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBpP.png" alt="0683p000009MBpP.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Thu, 28 Nov 2013 21:36:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWebService-quot-java-lang-String-cannot-be-cast-to-java-util/m-p/2314175#M84967</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-28T21:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: tWebService: "java.lang.String cannot be cast to java.util.List"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWebService-quot-java-lang-String-cannot-be-cast-to-java-util/m-p/2314176#M84968</link>
      <description>Hi, &lt;BR /&gt;What's your workflow? Did you use list in tjavarow? the java code looks like? You job screenshots will be preferred.&lt;BR /&gt;Best regards&lt;BR /&gt;Sabrina</description>
      <pubDate>Mon, 02 Dec 2013 02:23:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWebService-quot-java-lang-String-cannot-be-cast-to-java-util/m-p/2314176#M84968</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-02T02:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: tWebService: "java.lang.String cannot be cast to java.util.List"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWebService-quot-java-lang-String-cannot-be-cast-to-java-util/m-p/2314177#M84969</link>
      <description>I'm sorry, I had selected the screenshots to attach at one point, but I guess they got lost. They're attached now. 
&lt;BR /&gt;Yes, I'm setting up the data in a tJavaRow. The current code looks like: 
&lt;BR /&gt; 
&lt;PRE&gt;StandardPBEStringEncryptor encryptor = (StandardPBEStringEncryptor) globalMap.get("encryptor");&lt;BR /&gt;String loginId = encryptor.decrypt(row2.gateway_login_id);&lt;BR /&gt;String transactionKey = encryptor.decrypt(row2.gateway_transaction_key);&lt;BR /&gt;row3.id = row2.id;&lt;BR /&gt;row3.gateway_login_id = loginId;&lt;BR /&gt;row3.gateway_transaction_key = transactionKey;&lt;BR /&gt;// What goes here???&lt;BR /&gt;Map&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt; args = new HashMap&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt;();&lt;BR /&gt;List&amp;lt;String&amp;gt; names = Arrays.asList(loginId);&lt;BR /&gt;List&amp;lt;String&amp;gt; transactionKeys = Arrays.asList(transactionKey);&lt;BR /&gt;args.put("name", names);&lt;BR /&gt;args.put("transactionKey", transactionKeys);&lt;BR /&gt;globalMap.put("merchantAuth", args);&lt;/PRE&gt; 
&lt;BR /&gt;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.</description>
      <pubDate>Mon, 02 Dec 2013 08:52:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWebService-quot-java-lang-String-cannot-be-cast-to-java-util/m-p/2314177#M84969</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-02T08:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: tWebService: "java.lang.String cannot be cast to java.util.List"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWebService-quot-java-lang-String-cannot-be-cast-to-java-util/m-p/2314178#M84970</link>
      <description>UP&lt;BR /&gt;Any idea about this? I'm having the same problem.&lt;BR /&gt;Thank you very much</description>
      <pubDate>Tue, 27 Jan 2015 14:44:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWebService-quot-java-lang-String-cannot-be-cast-to-java-util/m-p/2314178#M84970</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-27T14:44:40Z</dc:date>
    </item>
  </channel>
</rss>

