One Star

Domain Schemas and WSDLs - how to import xsd:schema

We have domain.objects defined as XML Schemas, which have been deployed as POJOs with JaxB annotations for marshaling / unmarshaling during WS SOAP cals to an app server (jboss, tomcat, tibco, ...). When creating the WSDL, is it possible to import the schema from a location instead of defining them outright within the WSDL during design time? Also, why can't I import an XML Schema from a .xsd files within Talend ESB Studio?
The reason is that we have many services using these objects that are still in a state of change, so instead of modifying each WSDL, I would only have to change the XSD schema within Metadata or my reference folder containing my schemas.
For example, use the following:



xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.rst2.com/service/"
targetNamespace="http://www.rst2.com/service/"
>




targetNamespace="http://www.rst2.com/service/" version="1.0"
xmlns:tns="http://www.rst2.com/service/"
xmlnsSmiley Tonguerd="http://www.rst2.com/Product"
xmlns:ens="urn:sobject.enterprise.soap.sforce.com" >



















...
Instead of the fully defining the XSD types as:


xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.rst1.com/service/"
targetNamespace="http://www.rst1.com/service/"
>


targetNamespace="http://www.rst1.com/Global" version="1.0"
xmlns:glb="http://www.rst1.com/Global" >




























































































targetNamespace="http://www.rst1.com/Product" version="1.0"
xmlns:glb="http://www.rst1.com/Global"
xmlnsSmiley Tonguerd="http://www.rst1.com/Product" >
































targetNamespace="http://www.rst1.com/service/" version="1.0"
xmlns:tns="http://www.rst1.com/service/"
xmlnsSmiley Tonguerd="http://www.rst1.com/Product"
xmlns:ens="urn:sobject.enterprise.soap.sforce.com" >


















...
Cheers, JP

7 REPLIES
Employee

Re: Domain Schemas and WSDLs - how to import xsd:schema

Hi JP,
Unfortunately we do not supper the external schema references from WSDL, however you can import your schemas in the XML Metadata, just select your XSD file instead of XML.
Renat
One Star

Re: Domain Schemas and WSDLs - how to import xsd:schema

Hi Renat,
Thank you for the prompt response. The reason why is that I am having some issues while importing WSDLs: every time I get the resulting schema with the name of their data types as opposed to their actual name as depicted in the attachment for the following well form WSDL (Pass validate from EClipse WS and XML Spy):


xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.rst1.com/service/"
targetNamespace="http://www.rst1.com/service/"
>


targetNamespace="http://www.rst1.com/Global" version="1.0"
xmlns:glb="http://www.rst1.com/Global" >




























































































targetNamespace="http://www.rst1.com/Product" version="1.0"
xmlns:glb="http://www.rst1.com/Global"
xmlnsSmiley Tonguerd="http://www.rst1.com/Product" >
































targetNamespace="http://www.rst1.com/service/" version="1.0"
xmlns:tns="http://www.rst1.com/service/"
xmlnsSmiley Tonguerd="http://www.rst1.com/Product"
xmlns:ens="urn:sobject.enterprise.soap.sforce.com" >



















































Even simple WSDLs behave the same - any idea why?
Cheers, JP
One Star

Re: Domain Schemas and WSDLs - how to import xsd:schema

Hi Renat,
Thank you for the prompt response. The reason why is that I am having some issues while importing WSDLs: every time I get the resulting schema with the name of their data types as opposed to their actual name as depicted in the attachment for the following well form WSDL (Pass validate from EClipse WS and XML Spy):


xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.rst1.com/service/"
targetNamespace="http://www.rst1.com/service/"
>


targetNamespace="http://www.rst1.com/Global" version="1.0"
xmlns:glb="http://www.rst1.com/Global" >




























































































targetNamespace="http://www.rst1.com/Product" version="1.0"
xmlns:glb="http://www.rst1.com/Global"
xmlnsSmiley Tonguerd="http://www.rst1.com/Product" >
































targetNamespace="http://www.rst1.com/service/" version="1.0"
xmlns:tns="http://www.rst1.com/service/"
xmlnsSmiley Tonguerd="http://www.rst1.com/Product"
xmlns:ens="urn:sobject.enterprise.soap.sforce.com" >



















































Even simple WSDLs behave the same - any idea why?
Cheers, JP
One Star

Re: Domain Schemas and WSDLs - how to import xsd:schema

Hi,
We are working in Talend for Data Services.
We took our WSDL underneath Services and extracted the DataTypes.
We created a new file DataTypes.xsd.
Then we Imported that Schema to the WDSL. Not include, because it is in a different namespace.
Now underneath Directives I can see our DataTypes.xsd file.
Then we ran the Job and tested it with soapUI and everything works great.
When right clicking the service underneath Services and hitting Publish, we get an error.
The funny thing is last week I got this error, then for a reason I do not know, it disappeared; only to return this week again.
Can you please help - How do you add an XSD to your WSDL and publish it?
According to this post you do not support it? Did this maybe change with time?
I get this error:
java.lang.reflect.InvocationTargetException
at org.talend.repository.services.ui.action.ExportServiceAction.run(ExportServiceAction.java:172)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1008)
at org.talend.designer.publish.wizards.PublishServiceWizard.publishToRepository(PublishServiceWizard.java:46)
at org.talend.designer.publish.wizards.AbstractPublishWizard.performFinish(AbstractPublishWizard.java:125)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.talend.designer.publish.actions.PublishServiceAction.doRun(PublishServiceAction.java:83)
at org.talend.repository.ui.actions.AContextualAction$2.run(AContextualAction.java:593)
at org.talend.repository.RepositoryWorkUnit.executeRun(RepositoryWorkUnit.java:84)
at org.talend.core.repository.model.AbstractRepositoryFactory.executeRepositoryWorkUnit(AbstractRepositoryFactory.java:217)
at org.talend.repository.localprovider.model.LocalRepositoryFactory.executeRepositoryWorkUnit(LocalRepositoryFactory.java:3013)
at org.talend.repository.svnprovider.SvnRepositoryFactory.executeRepositoryWorkUnit(SvnRepositoryFactory.java:395)
at org.talend.repository.remoteprovider.RemoteRepositoryFactory.executeRepositoryWorkUnit(RemoteRepositoryFactory.java:634)
at org.talend.core.repository.model.ProxyRepositoryFactory.executeRepositoryWorkUnit(ProxyRepositoryFactory.java:1892)
at org.talend.repository.ui.actions.AContextualAction.run(AContextualAction.java:602)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.talend.rcp.intro.Application.start(Application.java:127)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: org.eclipse.core.runtime.CoreException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'CamDataTypes.xsd', relative to 'file:/C:/Development/Talend-Studio/workspace/CAM/temp/serviceExporter/service3111424330908024568.tmp/temp/CAMASService_0.1.wsdl'.: java.io.FileNotFoundException: This file was not found: file:/C:/Development/Talend-Studio/workspace/CAM/temp/serviceExporter/service3111424330908024568.tmp/temp/CamDataTypes.xsd
at org.talend.repository.services.utils.WSDLUtils.getDefinition(WSDLUtils.java:297)
at org.talend.repository.services.ui.scriptmanager.ServiceExportManager.createSpringBeans(ServiceExportManager.java:66)
at org.talend.repository.services.ui.action.ExportServiceAction.generateControlBundle(ExportServiceAction.java:193)
at org.talend.repository.services.ui.action.ExportServiceAction.run(ExportServiceAction.java:168)
... 53 more
Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'CamDataTypes.xsd', relative to 'file:/C:/Development/Talend-Studio/workspace/CAM/temp/serviceExporter/service3111424330908024568.tmp/temp/CAMASService_0.1.wsdl'.: java.io.FileNotFoundException: This file was not found: file:/C:/Development/Talend-Studio/workspace/CAM/temp/serviceExporter/service3111424330908024568.tmp/temp/CamDataTypes.xsd
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.talend.repository.services.utils.WSDLUtils.getDefinition(WSDLUtils.java:295)
... 56 more
Caused by: java.io.FileNotFoundException: This file was not found: file:/C:/Development/Talend-Studio/workspace/CAM/temp/serviceExporter/service3111424330908024568.tmp/temp/CamDataTypes.xsd
at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
... 66 more
Greetings
Community Manager

Re: Domain Schemas and WSDLs - how to import xsd:schema

Hi
For a more efficient and customized answer, could you open a ticket to our Support portal: http://support.talend.com/otrs/customer.pl
Many thanks
Elisa
One Star

Re: Domain Schemas and WSDLs - how to import xsd:schema

Hi,
After opening up a Ticket, they refered me to the Forum.
Which would you prefer?
Greetings
One Star

Re: Domain Schemas and WSDLs - how to import xsd:schema

Hi, anyone know how to reference an external schema file in a WSDL.
This is apparently possible from 5.3.1.
I cannot find an example of the procedure and i have quite a few services and they all use a base schema.
It is a pain to constantly track the changes
e.g.

rather than






Graham