0

当我尝试在 Netbeans 中将 WSDL 和 XSD 转换为 Java 时出现此错误。

严重:Woden[Error],0:0,WSDL520,Extension element "{ http://www.w3.org/ns/wsdl }type" 在 "org.apache.woden.wsdl20.xml.DescriptionElement" 的上下文中不得位于 WSDL 2.0 命名空间中。2017 年 3 月 16 日 12:43:12 EM org.apache.woden.internal.ErrorHandlerImpl 警告

每个文件的描述部分如下:

WSDL 文件

<?xml version="1.0" encoding="utf-8" ?> 
<description
    targetNamespace="http://www.spads.lfv.se/2017/service/afip"
    xmlns="http://www.w3.org/ns/wsdl"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://www.w3.org/ns/wsdl" 
    xmlns:tns="http://www.spads.lfv.se/2017/service/wsdl/publisher"
    xmlns:wsoap="http://www.w3.org/ns/wsdl/soap"
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
    xmlns:wsdlx="http://www.w3.org/ns/wsdl-extensions"
    xmlns:inboundOutboundFlight="http://www.spads.lfv.se/2017/service/flightElements"
    xmlns:FID="http://www.spads.lfv.se/2017/service/FlightID">  

XSD 文件

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.spads.lfv.se/2017/service/flightElements"
           xmlns:inboundOutboundFlight = "http://www.spads.lfv.se/2017/service/flightElements"> 
4

1 回答 1

0

XSD 和 WSDL 之间的链接应该正确建立。因此,描述部分需要改变和保证。Altova 软件对于生成可用于创建其他操作的简单 WSDL 文件非常有帮助。

Altova 软件

此外,描述应采用以下语法:

WSDL 文件

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:description
    targetNamespace="http://new.webservice.namespace"
    xmlns:wsdl="http://www.w3.org/ns/wsdl"
    xmlns:wsoap="http://www.w3.org/ns/wsdl/soap"
    xmlns:whttp="http://www.w3.org/ns/wsdl/http"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http://new.webservice.namespace"
    xmlns:inboundOutboundFlight="http://www.spads.lfv.se/2017/service/flightElements"
    xmlns:wsdlx="http://www.w3.org/ns/wsdl-extensions">
<wsdl:types>
    <xs:import namespace="http://www.spads.lfv.se/2017/service/flightElements" schemaLocation="AirportFlightInformationElements.xsd"/>
</wsdl:types>

XSD 文件

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.spads.lfv.se/2017/service/flightElements"> 
于 2017-03-17T13:59:21.607 回答