undefined complextype用作复杂类型扩展的基础

时间:2014-04-08 10:17:47

标签: visual-studio soap xsd wsdl ws-i

我的WSDL文件有什么问题? Visual Studio抱怨未定义的复杂类型。

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns1="http://osmc.synium.com/services/presence" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns2="http://types.osqq.syqq.com" xmlns:impl="com.syqq.osqq.services.presence" xmlns:intf="com.syqq.osqq.services.presence" targetNamespace="com.syqq.osqq.services.presence" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://types.osqq.syqq.com">
          <xsd:import namespace="http://osqq.syqq.com/services/presence" />
          <xsd:import namespace="com.syqq.osqq.services.presence" />
          <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
          <xsd:complexType name="SoapBinaryMessage" abstract="true">
            <xsd:sequence>
              <xsd:element name="data64" nillable="true" type="xsd:string" />
              <xsd:element name="version" nillable="true" type="xsd:int" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:schema>
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://osmc.synium.com/services/presence">
          <xsd:import namespace="com.syqq.osqq.services.presence" />
          <xsd:import namespace="http://types.osqq.syqq.com" />
          <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
          <xsd:complexType name="PresenceStatusBinary">
            <xsd:complexContent mixed="false">
              <xsd:extension base="tns2:SoapBinaryMessage">
                <xsd:sequence />
              </xsd:extension>
            </xsd:complexContent>
          </xsd:complexType>
        </xsd:schema>
...
</wsdl:types>

有什么想法吗?

问题出现在 xsd:extension base =“tns2:SoapBinaryMessage

行中

1 个答案:

答案 0 :(得分:2)

你错过了tns2的前缀声明;这需要添加到某个地方,以便它在<xsd:extension base="tns2:SoapBinaryMessage">节点的范围内(就我而言,最好的位置可能是第二个xsd:schema声明):

xmlns:tns2="http://types.osqq.syqq.com"