One Star

Web services output

Hi guys, thanks for the nice work so far!
But here goes a question:
I'm consuming a web service with your tWebServiceInput component and I'm getting the soap message instead of the actual list of results that my web service produces. It seams that you cannot parse complex types.
Could you please tell-me what kind of lists Talend can properly parse? Is Talend expecting specific names for the list and list element xml nodes?
Also: Do I have to configure the output schema in any special way?
The output of my web service is something like:
<?xml version="1.0" encoding="utf-8" ?>
<ArrayOfMyClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://xxx.com/webservices/xxx">
<MyClass>
<b>10</b>
</MyClass>
<MyClass>
<b>11</b>
</MyClass>
<MyClass>
<b>12</b>
</MyClass>
</ArrayOfMyClass>
My web service is done using Managed C++ returning System::Collections::Generic::List<MyClass^>I^.
The class is

public ref class MyClass
{
public:
int b;
};
And the WSDL part that describes my class is:
<s:element name="GetArray">
<s:complexType />
</s:element>
<s:element name="GetArrayResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetArrayResult" type="tns:ArrayOfMyClass" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfMyClass">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="MyClass" nillable="true" type="tns:MyClass" />
</s:sequence>
</s:complexType>
<s:complexType name="MyClass">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="b" type="s:int" />
</s:sequence>
</s:complexType>
Thanks!
HB
18 REPLIES
One Star

Re: Web services output

Found a not so elegant solution of using a tParseXMLRow after the tWebServiceInput with:
- Loop XPath query = "/GetListResult/MyClass" (strange that the tWebServiceInput component substitutes the 'ArrayOfMyClass' with a 'GetListResult')
- Mapping: column 'b' XPath query = "b"
Does an imediate way exists?
Thx,
HB
Community Manager

Re: Web services output

Hi
Also: Do I have to configure the output schema in any special way?

tWebServiceInput also support the following type: List, Array and Map, besides the base data types.
If the method return a list, the schema will get the value from list in order.
Here is a schema(for example):
myClass1(int)
myClass2(int)
a list {10,11,12,...}
result will be
myClass1-->10
myClass2-->11
PS: Currently, tWebServiceInput doesn't support any Object type returned by method or any Object type as parameter.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Web services output

Thanks shong,
PS: Currently, tWebServiceInput doesn't support any Object type returned by method or any Object type as parameter.

So you mean that the problem is in my WSDL by describing the result type as beeing a complex type, or just because it has the wrong name (like, it should be called 'List' instead of 'ArrayOfMyClass')?
<s:element minOccurs="0" maxOccurs="1" name="GetArrayResult" type="tns:ArrayOfMyClass" />
<s:complexType name="ArrayOfMyClass">
<s:sequence>
...
Do you have an example of a working WSDL with a list of items you can give-me?
Many thanks,
HB
Community Manager

Re: Web services output

Hi HB
It seams that you cannot parse complex types.

Yes, you are right. tWebServiceInput doesnn't support complex types. So, it can't work well in your scenario, because your method return System::Collections::Generic::List<MyClass^>I^ , MyClass is a class (Object type), the element of list should be base data type.Smiley Happy
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Web services output

Thanks shong. I'll keep my tParseXMLRow then. Smiley Tongue
One Star

Re: Web services output

Thanks shong. I'll keep my tParseXMLRow then. Smiley Tongue

hi hbandarra,
Could you please explain how to use tParseXMLRow to get an Array of Complex Type?
One Star

Re: Web services output

Of course!
For the example above, I've created a tParseXMLRow with the following properties:
Loop XPath Query = "/GetArrayResult/MyClass"
(You can see this 'GetArrayResult' in your Web Service's WSDL, something like
http://localhost/MyWebServer/MyWebService.asmx?WSDL)
Mapping:
Column = b, Xpath query = "b"
if I had, for example another column c in MyClass I could add:
Column = c, Xpath query = "c"
Hope it helped!
One Star

Re: Web services output

I tryied it but keep getting the same error. Please look the picture a send.
SEVERE: Exception:
org.xml.sax.SAXException: No deserializer defined for array type {http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration}BPartner
at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:276)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.talend.DynamicInvoker.invokeMethod(DynamicInvoker.java:257)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:137)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:107)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.tWebServiceInput_1Process(WebServiceIntegrationWithIntermediary.java:164)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.runJob(WebServiceIntegrationWithIntermediary.java:476)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.main(WebServiceIntegrationWithIntermediary.java:399)
Exception in component tWebServiceInput_1
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: No deserializer defined for array type {http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration}BPartner
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTraceSmiley Surprisedrg.xml.sax.SAXException: No deserializer defined for array type {http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration}BPartner
at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:276)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.talend.DynamicInvoker.invokeMethod(DynamicInvoker.java:257)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:137)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:107)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.tWebServiceInput_1Process(WebServiceIntegrationWithIntermediary.java:164)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.runJob(WebServiceIntegrationWithIntermediary.java:476)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.main(WebServiceIntegrationWithIntermediary.java:399)
One Star

Re: Web services output

I tryied it but keep getting the same error. Please look the picture a send.
SEVERE: Exception:
org.xml.sax.SAXException: No deserializer defined for array type {http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration}BPartner
at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:276)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.talend.DynamicInvoker.invokeMethod(DynamicInvoker.java:257)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:137)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:107)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.tWebServiceInput_1Process(WebServiceIntegrationWithIntermediary.java:164)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.runJob(WebServiceIntegrationWithIntermediary.java:476)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.main(WebServiceIntegrationWithIntermediary.java:399)
Exception in component tWebServiceInput_1
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: No deserializer defined for array type {http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration}BPartner
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTraceSmiley Surprisedrg.xml.sax.SAXException: No deserializer defined for array type {http://192.168.0.200:8080/openbravo/services/sugarCRMIntegration}BPartner
at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:276)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.talend.DynamicInvoker.invokeMethod(DynamicInvoker.java:257)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:137)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:107)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.tWebServiceInput_1Process(WebServiceIntegrationWithIntermediary.java:164)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.runJob(WebServiceIntegrationWithIntermediary.java:476)
at justatest.webserviceintegrationwithintermediary.WebServiceIntegrationWithIntermediary.main(WebServiceIntegrationWithIntermediary.java:399)

Hi. I am receiving a similar error to this. Did you or anyone else find a solution to this?
One Star

Re: Web services output

Turns out this problem is because of the complex data types. I can get data when the project is in perl, but not in Java.
I have opened the following issue for this:
http://www.talendforge.org/bugs/view.php?id=3814
One Star

Re: Web services output

Any update on this? I got a message on bugtracker that someone was going to contact me about a button on the advanced menu. Only thing I see is a check box for the stats.
Community Manager

Re: Web services output

Hello
I got a message on bugtracker that someone was going to contact me about a button on the advanced menu. Only thing I see is a check box for the stats.

This button is only available on Java project now. I have sent a email to parham, a Talend designer. He will give some explaination about this issue.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Web services output

Hi, are you sure this is on my version? (TIS 2.3.2.r12707)
I don't see it on a java project.
Community Manager

Re: Web services output

Hello dweaver
It is built on the latest version 2.4 Smiley Happy
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Web services output

I wasn't aware that this is a stable build.
One Star

Re: Web services output

Can you please let us know what is the Advance option in 2.4 I see that there is a WSDL2java button,but then how do one map the complex data types using this? please help
Community Manager

Re: Web services output

Hello
Can you please let us know what is the Advance option in 2.4 I see that there is a WSDL2java button,but then how do one map the complex data types using this? please help

Pease read 2997
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Web services output

Hello
About the complex type in tWebServiceInput, we design a new button "WSDL2Java" to process this case in version 2.4.
as we know tWebServiceInput is a webservice client provide by TOS, and it can work with the FLOW link with others TOS components to complete an integral job.
"WSDL2java" it will generate a stub client, and then user can write some simple code with the stub, it is a common use way with the webservice client,
and nearly all the people create the client following this way. So, TOS support this function, it can deal with all the case. but need user write some code.
I add a usecase about the this button, please see:tWebServiceInput_test.zip, it contains a TOS java project, and a war file. I test it on Tomcat5.5. it is ok. It can show how TOS process the complex type in webservice.
regards
xtan