tWebService component no longer working in version 5.1 and above

One Star

tWebService component no longer working in version 5.1 and above

In version 5.0, I am able to use the tWebservice component without a problem. However, in any version above 5.1 it does not work. I configure the tWebservice component exactly the same way as in 5.0 (which is working) but get a error:
Exception in component tWebService_1
java.lang.RuntimeException: java.net.MalformedURLException: no protocol: tmpTargetNamespace0
when trying it in 5.1 or 5.2. Is this a known bug and will it get fixed?
*Update - I just tried using tWebServiceInput component instead, using the exact same wsdl url, and it worked. So this is obviously a bug bug in the tWebservice component introduced in version 5.1 and is still not fixed in version 5.2

*Update2 - I debugged into the job and found the method and line that throws the Exception:
private XmlSchemaCollection getSchemaCollection(Map<String, Definition> definitions) throws FileNotFoundException,
TransformerException, URISyntaxException {
XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
Map<String, Types> typesList = getTypesFromWsdl(definitions);
int tmpCount = 0;
String tmpTNName = "";
for (Object key : typesList.keySet()) {
Types types = typesList.get(key);
if (types != null) {
List<ExtensibilityElement> extensibilityElements = types.getExtensibilityElements();
for (ExtensibilityElement el : extensibilityElements) {
if (el instanceof Schema) {
Schema schema = (Schema) el;
// for bug 8674
// set base uri for relative path in schemaLocation.
schemaCollection.setBaseUri(schema.getDocumentBaseURI());
// synthetic URI for the schemas without targetNamespace,avoid conflict error.
if (schema.getElement().getAttributeNode("targetNamespace") == null) {
tmpTNName = "tmpTargetNamespace" + tmpCount;
schemaCollection.read(schema.getElement(), tmpTNName);
tmpCount++;
} else {
schemaCollection.read(schema.getElement());
}
}
}
}
}

Its on the lines:
tmpTNName = "tmpTargetNamespace" + tmpCount;
schemaCollection.read(schema.getElement(), tmpTNName);
The call to schemaCollection.read doesn't like the temp schema name of "tmpTargetNamespace0". This is the stack trace of the Exception thrown when making the call:
java.lang.RuntimeException: java.net.MalformedURLException: no protocol: tmpTargetNamespace0
at org.apache.ws.commons.schema.resolver.DefaultURIResolver.resolveEntity(DefaultURIResolver.java:71)
at org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:684)
at org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:538)
at org.apache.ws.commons.schema.SchemaBuilder.handleSchemaElementChild(SchemaBuilder.java:1513)
at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:659)
at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:540)
at org.talend.webservice.helper.ServiceDiscoveryHelper.getSchemaCollection(ServiceDiscoveryHelper.java:360)
at org.talend.webservice.helper.ServiceDiscoveryHelper.init(ServiceDiscoveryHelper.java:130)
at org.talend.webservice.helper.ServiceDiscoveryHelper.<init>(ServiceDiscoveryHelper.java:90)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:98)
at amica_jobs.call_process_staging_ws_0_1.call_process_staging_ws.tWebService_2Process(call_process_staging_ws.java:500)
at amica_jobs.call_process_staging_ws_0_1.call_process_staging_ws.runJobInTOS(call_process_staging_ws.java:831)
at amica_jobs.call_process_staging_ws_0_1.call_process_staging_ws.main(call_process_staging_ws.java:624)
Caused by: java.net.MalformedURLException: no protocol: tmpTargetNamespace0
at java.net.URL.<init>(URL.java:585)
at java.net.URL.<init>(URL.java:482)
at java.net.URL.<init>(URL.java:431)
at org.apache.ws.commons.schema.resolver.DefaultURIResolver.resolveEntity(DefaultURIResolver.java:67)
... 12 more
Moderator

Re: tWebService component no longer working in version 5.1 and above

Hi,
Update - I just tried using tWebServiceInput component instead, using the exact same wsdl url, and it worked. So this is obviously a bug bug in the tWebservice component introduced in version 5.1 and is still not fixed in version 5.2

How about download and re-install a new version of 5.1 or 5.2? For twebservice component, we just have the bug https://jira.talendforge.org/browse/TDI-21860, but i found it is not your problem.
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.
One Star

Re: tWebService component no longer working in version 5.1 and above

I did try that already. FYI, I am running on an Ubuntu Linux (version 11). The webservice I'm trying to call was created using Java 6 jax-ws. For now I will just use the tWebServiceInput component. Hopefully this issue will be looked into.
One Star

Re: tWebService component no longer working in version 5.1 and above

hi,
i hava an eror when i tryied to connect to account in Zuora web server with WSDL =https://api.zuora.com/rest/v1/accounts/A00001115  :

The erorSmiley Frustratedtarting job ssss at 14:51 03/12/2015.

connecting to socket on port 3894
connected
Exception in component tWebServiceInput_1
javax.xml.rpc.JAXRPCException: Cannot find operation: GetWeather - none defined
at org.apache.axis.client.Call.setOperation(Call.java:1365)
at org.apache.axis.client.Call.setOperation(Call.java:1652)
at org.apache.axis.client.Service.createCall(Service.java:546)
at org.talend.DynamicInvoker.invokeMethod(DynamicInvoker.java:244)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:190)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:131)
at local_project.ssss_0_1.ssss.tWebServiceInput_1Process(ssss.java:556)
at local_project.ssss_0_1.ssss.runJobInTOS(ssss.java:993)
at local_project.ssss_0_1.ssss.main(ssss.java:850)
disconnected
Job ssss ended at 14:51 03/12/2015.



what this eror??

thanks
Moderator

Re: tWebService component no longer working in version 5.1 and above

Hi amir.f,

Is your method name correct for your use case? Could you please upload your component setting screenshot into forum?
The Method name MUST match the corresponding method described in the Web Service. The Method name is also case-sensitive. Could you please check your input parameter on component tWebserviceInput?
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.
One Star

Re: tWebService component no longer working in version 5.1 and above

https://www.talendforge.org/forum/img/members/340158/mini_Talend1.png       


 






   hi,
i want  to retrive  all the account numbers
this is the WSDL and the mathod name is accountNumbar
what is the meaning of the error and how can i fix it?
thanks
amir.f
One Star

Re: tWebService component no longer working in version 5.1 and above

this is the next image....



            

thanks
amir.f