Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
hbandarra
Contributor
Contributor

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
Labels (4)
18 Replies
hbandarra
Contributor
Contributor
Author

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
Anonymous
Not applicable

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
hbandarra
Contributor
Contributor
Author

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
Anonymous
Not applicable

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. 0683p000009MACn.png
Best regards
shong
hbandarra
Contributor
Contributor
Author

Thanks shong. I'll keep my tParseXMLRow then. 0683p000009MAB6.png
Anonymous
Not applicable

Thanks shong. I'll keep my tParseXMLRow then. 0683p000009MAB6.png

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

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!
Anonymous
Not applicable

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/}stackTrace 0683p000009MA5A.pngrg.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)
Anonymous
Not applicable

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/}stackTrace0683p000009MA5A.pngrg.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?