<?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 Bound to Anonymous type error. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Bound-to-Anonymous-type-error/m-p/2320281#M90438</link>
    <description>Using wsdl2java cxf tool to generate my service and everything runs fine, and 4 of the 5 services work. But I get this runtime error when I hit the RetrieveSfAccounts operation: 
&lt;BR /&gt; Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1.1:java (default-cli) on project sf-account-soap: An exception occured while executing the Java class. null: InvocationTargetException: Marshalling Error: Instance of "com.cn.dsa.sfaccount.InputRetrieveSfAccounts" is substituting "java.lang.Object", but "com.cn.dsa.sfaccount.InputRetrieveSfAccounts" is bound to an anonymous type. -&amp;gt; 
&lt;BR /&gt;In the wsdl: 
&lt;BR /&gt; &amp;lt;xs:complexType name="Account"&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:sequence&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="id"/&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="name"/&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="firstName"/&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="lastName"/&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="workEmail"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:sequence&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:complexType&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;xs:complexType name="ArrayOfAccounts"&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:sequence&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element maxOccurs="unbounded" 
&lt;BR /&gt; minOccurs="0" 
&lt;BR /&gt; name="accounts" 
&lt;BR /&gt; nillable="true" 
&lt;BR /&gt; type="tns:Account"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:sequence&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:complexType&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;xs:element name="inputRetrieveSfAccounts"&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:complexType&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:all&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element name="amount" type="xs:int"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:all&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:complexType&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:element&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;xs:element maxOccurs="1" minOccurs="1" name="outputRetrieveSfAccounts" nillable="true" type="tns:ArrayOfAccounts" /&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Here's the method I wrote in the Processor class (camel) handling the actual service: 
&lt;BR /&gt; /****************** GET ALL ACCOUNTS ******************/ 
&lt;BR /&gt; if ("InputRetrieveSfAccounts".equals(operationName)) { 
&lt;BR /&gt; 
&lt;BR /&gt; //for now just return all accounts found 
&lt;BR /&gt; 
&lt;BR /&gt; try { 
&lt;BR /&gt; List&amp;lt;Account&amp;gt; acctList = accountMgr.retrieveAccounts(); 
&lt;BR /&gt; 
&lt;BR /&gt; ArrayOfAccounts accounts = new ArrayOfAccounts(); 
&lt;BR /&gt; for(Account acct : acctList) { 
&lt;BR /&gt; accounts.getAccounts().add(acct); 
&lt;BR /&gt; } 
&lt;BR /&gt; exchange.getOut().setBody(accounts); 
&lt;BR /&gt; 
&lt;BR /&gt; } catch (Exception e) { 
&lt;BR /&gt; generateFault("Can't find DFP Accounts: "+e.getMessage()); 
&lt;BR /&gt; 
&lt;BR /&gt; } 
&lt;BR /&gt; } 
&lt;BR /&gt; 
&lt;BR /&gt;Here's the method from the Interface generated by wsdl2java: 
&lt;BR /&gt; @WebResult(name = "outputRetrieveSfAccounts", targetNamespace = " 
&lt;A href="http://sfaccount.dsa.cn.com" target="_blank" rel="nofollow noopener noreferrer"&gt;http://sfaccount.dsa.cn.com&lt;/A&gt;", partName = "out") 
&lt;BR /&gt; @WebMethod(operationName = "RetrieveSfAccounts", action = " 
&lt;A href="http://sfaccount.dsa.cn.com/RetrieveSfAccounts" target="_blank" rel="nofollow noopener noreferrer"&gt;http://sfaccount.dsa.cn.com/RetrieveSfAccounts&lt;/A&gt;") 
&lt;BR /&gt; public ArrayOfAccounts retrieveSfAccounts( 
&lt;BR /&gt; @WebParam(partName = "in", name = "inputRetrieveSfAccounts", targetNamespace = " 
&lt;A href="http://sfaccount.dsa.cn.com" target="_blank" rel="nofollow noopener noreferrer"&gt;http://sfaccount.dsa.cn.com&lt;/A&gt;") 
&lt;BR /&gt; InputRetrieveSfAccounts in 
&lt;BR /&gt; );</description>
    <pubDate>Sat, 16 Nov 2024 12:33:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T12:33:52Z</dc:date>
    <item>
      <title>Bound to Anonymous type error.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Bound-to-Anonymous-type-error/m-p/2320281#M90438</link>
      <description>Using wsdl2java cxf tool to generate my service and everything runs fine, and 4 of the 5 services work. But I get this runtime error when I hit the RetrieveSfAccounts operation: 
&lt;BR /&gt; Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1.1:java (default-cli) on project sf-account-soap: An exception occured while executing the Java class. null: InvocationTargetException: Marshalling Error: Instance of "com.cn.dsa.sfaccount.InputRetrieveSfAccounts" is substituting "java.lang.Object", but "com.cn.dsa.sfaccount.InputRetrieveSfAccounts" is bound to an anonymous type. -&amp;gt; 
&lt;BR /&gt;In the wsdl: 
&lt;BR /&gt; &amp;lt;xs:complexType name="Account"&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:sequence&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="id"/&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="name"/&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="firstName"/&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="lastName"/&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element type="xs:string" name="workEmail"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:sequence&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:complexType&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;xs:complexType name="ArrayOfAccounts"&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:sequence&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element maxOccurs="unbounded" 
&lt;BR /&gt; minOccurs="0" 
&lt;BR /&gt; name="accounts" 
&lt;BR /&gt; nillable="true" 
&lt;BR /&gt; type="tns:Account"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:sequence&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:complexType&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;xs:element name="inputRetrieveSfAccounts"&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:complexType&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:all&amp;gt; 
&lt;BR /&gt; &amp;lt;xs:element name="amount" type="xs:int"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:all&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:complexType&amp;gt; 
&lt;BR /&gt; &amp;lt;/xs:element&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;xs:element maxOccurs="1" minOccurs="1" name="outputRetrieveSfAccounts" nillable="true" type="tns:ArrayOfAccounts" /&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Here's the method I wrote in the Processor class (camel) handling the actual service: 
&lt;BR /&gt; /****************** GET ALL ACCOUNTS ******************/ 
&lt;BR /&gt; if ("InputRetrieveSfAccounts".equals(operationName)) { 
&lt;BR /&gt; 
&lt;BR /&gt; //for now just return all accounts found 
&lt;BR /&gt; 
&lt;BR /&gt; try { 
&lt;BR /&gt; List&amp;lt;Account&amp;gt; acctList = accountMgr.retrieveAccounts(); 
&lt;BR /&gt; 
&lt;BR /&gt; ArrayOfAccounts accounts = new ArrayOfAccounts(); 
&lt;BR /&gt; for(Account acct : acctList) { 
&lt;BR /&gt; accounts.getAccounts().add(acct); 
&lt;BR /&gt; } 
&lt;BR /&gt; exchange.getOut().setBody(accounts); 
&lt;BR /&gt; 
&lt;BR /&gt; } catch (Exception e) { 
&lt;BR /&gt; generateFault("Can't find DFP Accounts: "+e.getMessage()); 
&lt;BR /&gt; 
&lt;BR /&gt; } 
&lt;BR /&gt; } 
&lt;BR /&gt; 
&lt;BR /&gt;Here's the method from the Interface generated by wsdl2java: 
&lt;BR /&gt; @WebResult(name = "outputRetrieveSfAccounts", targetNamespace = " 
&lt;A href="http://sfaccount.dsa.cn.com" target="_blank" rel="nofollow noopener noreferrer"&gt;http://sfaccount.dsa.cn.com&lt;/A&gt;", partName = "out") 
&lt;BR /&gt; @WebMethod(operationName = "RetrieveSfAccounts", action = " 
&lt;A href="http://sfaccount.dsa.cn.com/RetrieveSfAccounts" target="_blank" rel="nofollow noopener noreferrer"&gt;http://sfaccount.dsa.cn.com/RetrieveSfAccounts&lt;/A&gt;") 
&lt;BR /&gt; public ArrayOfAccounts retrieveSfAccounts( 
&lt;BR /&gt; @WebParam(partName = "in", name = "inputRetrieveSfAccounts", targetNamespace = " 
&lt;A href="http://sfaccount.dsa.cn.com" target="_blank" rel="nofollow noopener noreferrer"&gt;http://sfaccount.dsa.cn.com&lt;/A&gt;") 
&lt;BR /&gt; InputRetrieveSfAccounts in 
&lt;BR /&gt; );</description>
      <pubDate>Sat, 16 Nov 2024 12:33:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Bound-to-Anonymous-type-error/m-p/2320281#M90438</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:33:52Z</dc:date>
    </item>
  </channel>
</rss>

