3

What is the problem in my WSDL file? The Visual Studio complains about an undefined complex type.

<?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>

Any ideas?

The problem occurs in line xsd:extension base="tns2:SoapBinaryMessage

cateof
  • 6,608
  • 25
  • 79
  • 153

1 Answers1

3

You're missing the prefix declaration for tns2; this needs to be added somewhere such that it'll be in scope for the <xsd:extension base="tns2:SoapBinaryMessage"> node (the best place as far as I am concerned might be the second xsd:schema declaration):

xmlns:tns2="http://types.osqq.syqq.com"
Petru Gardea
  • 21,373
  • 2
  • 50
  • 62
  • The tns2 is included in the WSDL. I have selected only some lines from my WSDL in order to be more readable for you. Sorry for the confusion. – cateof Apr 08 '14 at 10:45
  • @cateof, please post the whole WSDL, or a significant subset, that reproduces the problem; try to make sure that "editing" your WSDL doesn't introduces artificial problems (hence the preference for the whole WSDL and its external dependencies, if any). – Petru Gardea Apr 08 '14 at 10:47
  • @cateof, can you also add a pair of messages, a binding and a service, to make it usable in VS? BTW, which version of VS are you referring to? – Petru Gardea Apr 08 '14 at 11:03
  • Visual Studio 2013, Premium. Perhaps the problem is simpler, ie SoapBinaryMessage is not declared as a type. – cateof Apr 08 '14 at 11:05
  • @cateof, it is a type: ; try to move the tns2 prefix declaration at the second schema level, see if it makes a difference; otherwise, please update your WSDL so that I can run it myself through VS2013 – Petru Gardea Apr 08 '14 at 12:46