Errore nella sincronizzazione XSD

08 May '15, 03:21 PM
2,446 Views
No Forum Badges

Buonasera

Dopo aver realizzato un Web Service SOAP ho provato a mettere in pratica quanto indicato nella lezione "Invoking SOAP Web Service". 

In fase di sincronizzazione del Provider XSD con il modello dati ottengo il seguente errore:

!ENTRY com.webratio.ide.xsd.ui 4 1 2015-05-08 15:20:13.142
!MESSAGE Unable to read XSD resource 'Provincia XSD Resource [xsdp1#xsdr1]'
!STACK 0
java.lang.RuntimeException: com.webratio.lib.apache.ws.commons.schema.XmlSchemaException: An imported schema was announced to have the namespace urn:rsp1, but has the namespace null
    at com.webratio.lib.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1900)
    at com.webratio.lib.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1608)
    at com.webratio.lib.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:225)
    at com.webratio.lib.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:122)
    at com.webratio.lib.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:513)
    at com.webratio.lib.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:386)
    at com.webratio.lib.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:426)
    at com.webratio.lib.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:452)
    at com.webratio.ide.xsd.ui.XsdProviderHelper.getSchemaCollection(XsdProviderHelper.java:128)
    at com.webratio.ide.xsd.ui.XsdProviderHelper.getSchemaCollection(XsdProviderHelper.java:103)
    at com.webratio.ide.xsd.ui.XsdProviderHelper.getSchemaCollection(XsdProviderHelper.java:65)
    at com.webratio.ide.xsd.ui.model.ModelFactory.processXsdProvider(ModelFactory.java:163)
    at com.webratio.ide.xsd.ui.model.ModelFactory.computeSynchronizationModel(ModelFactory.java:138)
    at com.webratio.ide.xsd.ui.actions.SynchronizeXsdAction.run(SynchronizeXsdAction.java:82)
    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.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
    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(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Caused by: com.webratio.lib.apache.ws.commons.schema.XmlSchemaException: An imported schema was announced to have the namespace urn:rsp1, but has the namespace null
    at com.webratio.lib.apache.ws.commons.schema.SchemaBuilder$1.validate(SchemaBuilder.java:1598)
    at com.webratio.lib.apache.ws.commons.schema.SchemaBuilder.setNamespaceAttributes(SchemaBuilder.java:370)
    at com.webratio.lib.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:135)
    at com.webratio.lib.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:122)
    at com.webratio.lib.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:513)
    at com.webratio.lib.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:386)
    at com.webratio.lib.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1894)
    ... 42 more

Il WS esposto è raggiungibile e risponde alle richieste. 

Il wsdl è il seguente:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.webml.org/webservices/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.webml.org/webservices/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:nsx1="urn:slp1" xmlns:nsx2="urn:rsp1">
  <wsdl:types>
    <xsd:schema><xsd:import namespace="urn:slp1" schemaLocation="../xsd.do?res=slp1"/><xsd:import namespace="urn:rsp1" schemaLocation="../xsd.do?res=ExposeWS_SOAP/WebContent/WEB-INF/provincia.xsd"/></xsd:schema>
  </wsdl:types>
  <wsdl:message name="CriterioRicercaResponse">
    <wsdl:part name="DettaglioProvincia" element="Provincia">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="CriterioRicerca">
    <wsdl:part name="CriterioRicerca" type="nsx1:CriterioRicerca">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="CercaProvinciaType">
    <wsdl:operation name="CriterioRicerca">
      <wsdl:input message="tns:CriterioRicerca">
    </wsdl:input>
      <wsdl:output message="tns:CriterioRicercaResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="CercaProvincia" type="tns:CercaProvinciaType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="CriterioRicerca">
      <soap:operation soapAction=""/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="CercaProvincia">
    <wsdl:port name="CercaProvincia_Port" binding="tns:CercaProvincia">
      <soap:address location="http://127.0.0.1/ExposeWS_SOAP/WebService/CercaProvincia.do"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

 

Saluti

 Luca Massimi

 

 
x 0
Follow
Answer Answer at this question and get points!
No Forum Badges

Buongiorno. 

L'errore di sincronizzazione l'ho risolto ed era dovuto ad una errata configurazione. 

Grazie

 

 Luca Massimi

 
x 0
Answer at this question and get points!