This project is read-only.

Cannot import wsdl:portType on VS2008 SP1

Nov 26, 2010 at 9:32 AM

Hi
i have a problem with WSCF.blue V1.0.10 on VS 2008 SP1 and WSDL's with fault's. The same WSDL and XSD on VS 2010 works fine.

Any ideas?
Thanks

Christoph

Nov 29, 2010 at 12:16 PM

Hi Christoph,

Can you describe the problem that you are having?

Cheers,

Alex.

Nov 30, 2010 at 2:07 PM

hi alex
If i wan't to generate server stub classes from my wsdl with wscf.blue on vs2008 sp1 gives me the error "Cannot impoort wsdl:portType". The same operation on VS2010 works fine.
The WSDL has some Fault's in it.

Example:

WSDL:

<?xml version="1.0" encoding="utf-8"?>
<definitions name="Courses_v1.wsdl"
  targetNamespace="http://myurl.to/courses_v1.wsdl"
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
  xmlns:tns="http://myurl.to/courses_v1.wsdl"
  xmlns:v1_0="http://myurl.to/courses_v1.0.wsdl"
  xmlns:fault="http://myurl.to/fault_v1.0.xsd"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <types>
    <schema targetNamespace="http://myurl.to/courses_v1.0.wsdl"
      xmlns="http://www.w3.org/2001/XMLSchema"
      xmlns:courses="http://myurl.to/courses_v1.0.xsd">
      <import namespace="http://myurl.to/courses_v1.0.xsd"
        schemaLocation="./Courses_v1.xsd"/>

      <element name="saveCourse">
        <complexType>
          <sequence>
            <element name="course" type="courses:course"/>
          </sequence>
        </complexType>
      </element>
      <element name="saveCourseResponse">
        <complexType>
          <sequence>
            <element name="id" type="long"/>
          </sequence>
        </complexType>
      </element>
      <element name="deleteCourse">
        <complexType>
          <sequence>
            <element name="courseId" type="long"/>
            <element name="organisationId" type="long"/>
          </sequence>
        </complexType>
      </element>
      <element name="deleteCourseResponse">
        <complexType>
          <sequence/>
        </complexType>
      </element>
      <element name="fromDateInThePastFault">
        <complexType>
          <sequence />
        </complexType>
      </element>
      <element name="fromDateAfterToDateFault">
       <complexType>
        <sequence />
       </complexType>
      </element>     
      <element name="departmentNotFoundFault">
       <complexType>
        <sequence />
       </complexType>
      </element>     
      <element name="enrollmentFromInThePastFault">
       <complexType>
        <sequence />
       </complexType>
      </element>     
      <element name="enrollmentFromAfterEnrollmentToFault">
       <complexType>
        <sequence />
       </complexType>       
      </element>     
      <element name="courseCodeNotFoundFault">
       <complexType>
        <sequence />
       </complexType>       
      </element>     
      <element name="keywordIdNotFoundFault">
       <complexType>
        <sequence />
       </complexType>       
      </element>     
      <element name="municipalIdNotFoundFault">
       <complexType>
        <sequence />
       </complexType>       
      </element>     
      <element name="userDoesNotHavePermissionsFault">
       <complexType>
        <sequence />
       </complexType>       
      </element>    
      <element name="organisationIdNotAllowedForCurrentUserFault">
       <complexType>
        <sequence />
       </complexType>       
      </element>    
      <element name="fieldRequiredFault">
       <complexType>
        <sequence />
       </complexType>       
      </element>    

      <element name="getMunicipalities">
        <complexType>
          <sequence />
        </complexType>
      </element>
      <element name="getMunicipalitiesResponse">
        <complexType>
          <sequence>
            <element name="municipalities" type="courses:municipality" minOccurs="0" maxOccurs="unbounded" />
          </sequence>
        </complexType>
      </element>
     
      <element name="getDepartments">
        <complexType>
          <sequence />
        </complexType>
      </element>
      <element name="getDepartmentsResponse">
        <complexType>
          <sequence>
            <element name="deparments" type="courses:department" minOccurs="0" maxOccurs="unbounded" />
          </sequence>
        </complexType>
      </element>
     
   <element name="getKeyWords">
    <complexType>
     <sequence />
    </complexType>
   </element>
   <element name="getKeyWordsResponse">
    <complexType>
     <sequence>
      <element name="keyWords" type="courses:keyWord" minOccurs="0" maxOccurs="unbounded" />      
     </sequence>
    </complexType>
   </element>
  
   <element name="setKeyWordIds">
    <complexType>
     <sequence>
      <element name="courseId" type="xsd:long" />
      <element name="organisationId" type="xsd:long" />
      <element name="keyWordIds" type="xsd:long" minOccurs="1" maxOccurs="unbounded"/>
      <element name="mainKeyWordId" type="xsd:long"/>
     </sequence>
    </complexType>
   </element>  
   <element name="setKeyWordIdsResponse">
    <complexType>
     <sequence />
    </complexType>
   </element>
      <element name="courseIdNotFoundFault">
       <complexType>
        <sequence />
       </complexType>       
      </element>      
      <element name="mainKeywordNotInKeywordListFault">
       <complexType>
        <sequence />
       </complexType>       
      </element>      
  
   <element name="getCodes">
    <complexType>
     <sequence />     
    </complexType>
   </element>
   <element name="getCodesResponse">
    <complexType>
     <sequence>
      <element name="codes" type="courses:courseCode" minOccurs="0" maxOccurs="unbounded" />
     </sequence>
    </complexType>
   </element>

   <element name="getOrganisations">
    <complexType>
     <sequence />     
    </complexType>
   </element>
   <element name="getOrganisationsResponse">
    <complexType>
     <sequence>
      <element name="organisations" type="courses:organisation" minOccurs="0" maxOccurs="unbounded" />
     </sequence>
    </complexType>
   </element>

    </schema>
  </types>

  <message name="saveCourse">
    <part element="v1_0:saveCourse" name="parameters"/>
  </message>
  <message name="saveCourseResponse">
    <part element="v1_0:saveCourseResponse" name="parameters"/>
  </message>
  <message name="deleteCourse">
    <part element="v1_0:deleteCourse" name="parameters"/>
  </message>
  <message name="deleteCourseResponse">
    <part element="v1_0:deleteCourseResponse" name="parameters"/>
  </message>
  <message name="fromDateInThePastFault">
    <part element="v1_0:fromDateInThePastFault" name="fault"/>
  </message>
  <message name="fromDateAfterToDateFault">
    <part element="v1_0:fromDateAfterToDateFault" name="fault" />
  </message>
  <message name="departmentNotFoundFault">
    <part element="v1_0:departmentNotFoundFault" name="fault"/>
  </message>
  <message name="enrollmentFromInThePastFault">
    <part element="v1_0:enrollmentFromInThePastFault" name="fault"/>
  </message>
  <message name="enrollmentFromAfterEnrollmentToFault">
    <part element="v1_0:enrollmentFromAfterEnrollmentToFault" name="fault"/>
  </message>
  <message name="courseCodeNotFoundFault">
   <part element="v1_0:courseCodeNotFoundFault" name="fault"/>
  </message>
  <message name="keywordNotFoundFault">
   <part element="v1_0:keywordIdNotFoundFault" name="fault"/>
  </message>
  <message name="userDoesNotHavePermissionsFault">
   <part element="v1_0:userDoesNotHavePermissionsFault" name="fault"/>
  </message> 
  <message name="organisationIdNotAllowedForCurrentUserFault">
   <part element="v1_0:organisationIdNotAllowedForCurrentUserFault" name="fault"/>
  </message> 
  <message name="municipalIdNotFoundFault">
   <part element="v1_0:municipalIdNotFoundFault" name="fault"/>
  </message> 
  <message name="fieldRequiredFault">
   <part element="v1_0:fieldRequiredFault" name="fault"/>
  </message> 
 
  <message name="getMunicipalities">
   <part element="v1_0:getMunicipalities" name="parameters"/>
  </message>
  <message name="getMunicipalitiesResponse">
   <part element="v1_0:getMunicipalitiesResponse" name="parameters"/>
  </message>

  <message name="getDepartments">
   <part element="v1_0:getDepartments" name="parameters"/>
  </message>
  <message name="getDepartmentsResponse">
   <part element="v1_0:getDepartmentsResponse" name="parameters"/>
  </message>

  <message name="getKeyWords">
   <part element="v1_0:getKeyWords" name="parameters"/>
  </message>
  <message name="getKeyWordsResponse">
   <part element="v1_0:getKeyWordsResponse" name="parameters"/>
  </message> 
 
  <message name="setKeyWordIds">
   <part element="v1_0:setKeyWordIds" name="parameters"/>
  </message> 
  <message name="setKeyWordIdsResponse">
   <part element="v1_0:setKeyWordIdsResponse" name="parameters"/>
  </message>
  <message name="courseIdNotFoundFault">
   <part element="v1_0:courseIdNotFoundFault" name="fault"/>
  </message>
  <message name="mainKeywordNotInKeywordListFault">
   <part element="v1_0:mainKeywordNotInKeywordListFault" name="fault"/>
  </message>
 
  <message name="getCodes">
   <part element="v1_0:getCodes" name="parameters"/>
  </message>
  <message name="getCodesResponse">
   <part element="v1_0:getCodesResponse" name="parameters"/>
  </message>

  <message name="getOrganisations">
   <part element="v1_0:getOrganisations" name="parameters"/>
  </message>
  <message name="getOrganisationsResponse">
   <part element="v1_0:getOrganisationsResponse" name="parameters"/>
  </message>


  <portType name="Courses_v1_0">
    <operation name="saveCourse">
      <input message="tns:saveCourse" name="saveCourse"/>
      <output message="tns:saveCourseResponse" name="saveCourseResponse"/>
      <fault name="fromDateInThePastFault" message="tns:fromDateInThePastFault" />
      <fault name="fromDateAfterToDateFault" message="tns:fromDateAfterToDateFault" />
      <fault name="enrollmentFromInThePastFault" message="tns:enrollmentFromInThePastFault" />
      <fault name="enrollmentFromAfterEnrollmentToFault" message="tns:enrollmentFromAfterEnrollmentToFault" />
      <fault name="departmentNotFoundFault" message="tns:departmentNotFoundFault" />
      <fault name="courseCodeNotFoundFault" message="tns:courseCodeNotFoundFault" />
      <fault name="keywordNotFoundFault" message="tns:keywordNotFoundFault" />
      <fault name="userDoesNotHavePermissionsFault" message="tns:userDoesNotHavePermissionsFault" />
      <fault name="organisationIdNotAllowedForCurrentUserFault" message="tns:organisationIdNotAllowedForCurrentUserFault" />
      <fault name="municipalIdNotFoundFault" message="tns:municipalIdNotFoundFault" />
      <fault name="fieldRequiredFault" message="tns:fieldRequiredFault" />
    </operation>
    <operation name="deleteCourse">
      <input message="tns:deleteCourse" name="deleteCourse"/>
      <output message="tns:deleteCourseResponse" name="deleteCourseResponse"/>
      <fault name="courseIdNotFoundFault" message="tns:courseIdNotFoundFault"/>
    </operation>
    <operation name="getKeyWords">
     <input message="tns:getKeyWords" name="getKeyWords"/>
     <output message="tns:getKeyWordsResponse" name="getKeyWordsResponse"/>
    </operation>
    <operation name="getDepartments">
     <input message="tns:getDepartments" name="getDepartments"/>
     <output message="tns:getDepartmentsResponse" name="getDepartmentsResponse"/>
    </operation>
    <operation name="getMunicipalities">
     <input message="tns:getMunicipalities" name="getMunicipalities"/>
     <output message="tns:getMunicipalitiesResponse" name="getMunicipalitiesResponse"/>
    </operation>
    <operation name="setKeyWordIds">
     <input message="tns:setKeyWordIds" name="setKeyWordIds"/>
     <output message="tns:setKeyWordIdsResponse" name="setKeyWordIdsResponse"/>
       <fault name="userDoesNotHavePermissionsFault" message="tns:userDoesNotHavePermissionsFault" />
       <fault name="courseIdNotFoundFault" message="tns:courseIdNotFoundFault" />
       <fault name="keywordNotFoundFault" message="tns:keywordNotFoundFault" />
       <fault name="mainKeywordNotInKeywordListFault" message="tns:mainKeywordNotInKeywordListFault" />
    </operation>
   <operation name="getCourseCodes">
    <input message="tns:getCodes" name="getCourseCodes"/>
    <output message="tns:getCodesResponse" name="getCourseCodesResponse"/>
   </operation>
   <operation name="getOrganisations">
    <input message="tns:getOrganisations" name="getOrganisations"/>
    <output message="tns:getOrganisationsResponse" name="getOrganisationsResponse"/>
   </operation>
  </portType>
 

  <binding name="Courses_v1_0_SOAP11Binding" type="tns:Courses_v1_0">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />

    <operation name="saveCourse">
      <soap:operation style="document" soapAction="http://myurl.to/courses_v1/saveCourse"/>
      <input name="saveCourse">
        <soap:body use="literal"/>
      </input>
      <output name="saveCourseResponse">
        <soap:body use="literal"/>
      </output>
      <fault name="fromDateInThePastFault">
        <soap:fault use="literal" name="fromDateInThePastFault"/>
   </fault>
      <fault name="fromDateAfterToDateFault">
        <soap:fault use="literal" name="fromDateAfterToDateFault"/>
   </fault>
      <fault name="enrollmentFromInThePastFault">
        <soap:fault use="literal" name="enrollmentFromInThePastFault"/>
   </fault>
      <fault name="enrollmentFromAfterEnrollmentToFault">
        <soap:fault use="literal" name="enrollmentFromAfterEnrollmentToFault"/>
   </fault>
      <fault name="departmentNotFoundFault">
        <soap:fault use="literal" name="departmentNotFoundFault"/>
   </fault>
      <fault name="courseCodeNotFoundFault">
        <soap:fault use="literal" name="courseCodeNotFoundFault"/>
   </fault>
      <fault name="keywordNotFoundFault">
        <soap:fault use="literal" name="keywordNotFoundFault"/>
   </fault>
      <fault name="userDoesNotHavePermissionsFault">
        <soap:fault use="literal" name="userDoesNotHavePermissionsFault"/>
   </fault>  
      <fault name="organisationIdNotAllowedForCurrentUserFault">
        <soap:fault use="literal" name="organisationIdNotAllowedForCurrentUserFault"/>
   </fault>  
      <fault name="municipalIdNotFoundFault">
        <soap:fault use="literal" name="municipalIdNotFoundFault"/>
   </fault>  
      <fault name="fieldRequiredFault">
        <soap:fault use="literal" name="fieldRequiredFault"/>
   </fault>  
    </operation>
    <operation name="deleteCourse">
      <soap:operation style="document" soapAction="http://myurl.to/courses_v1/deleteCourse"/>
      <input name="deleteCourse">
        <soap:body use="literal"/>
      </input>
      <output name="deleteCourseResponse">
        <soap:body use="literal"/>
      </output>
      <fault name="courseIdNotFoundFault">
        <soap:fault use="literal" name="courseIdNotFoundFault"/>
   </fault>
    </operation>
   
    <operation name="getKeyWords">
     <soap:operation style="document" soapAction="http://myurl.to/courses_v1/getKeyWords"/>
     <input name="getKeyWords">
      <soap:body use="literal"/>
     </input>
     <output name="getKeyWordsResponse">
      <soap:body use="literal"/>
     </output>
    </operation>
   
    <operation name="getMunicipalities">
     <soap:operation style="document" soapAction="http://myurl.to/courses_v1/getMunicipalities"/>
     <input name="getMunicipalities">
      <soap:body use="literal"/>
     </input>
     <output name="getMunicipalitiesResponse">
      <soap:body use="literal"/>
     </output>
    </operation>
   
    <operation name="getDepartments">
     <soap:operation style="document" soapAction="http://myurl.to/courses_v1/getDepartments"/>
     <input name="getDepartments">
      <soap:body use="literal"/>
     </input>
     <output name="getDepartmentsResponse">
      <soap:body use="literal"/>
     </output>
    </operation>
   
    <operation name="getCourseCodes">
     <soap:operation style="document" soapAction="http://myurl.to/courses_v1/getCourseCodes"/>
     <input name="getCourseCodes">
      <soap:body use="literal"/>
     </input>
     <output name="getCourseCodesResponse">
      <soap:body use="literal"/>
     </output>
    </operation>
   
    <operation name="getOrganisations">
     <soap:operation style="document" soapAction="http://myurl.to/courses_v1/getOrganisations"/>
     <input name="getOrganisations">
      <soap:body use="literal"/>
     </input>
     <output name="getOrganisationsResponse">
      <soap:body use="literal"/>
     </output>
    </operation>
   
    <operation name="setKeyWordIds">
     <soap:operation style="document" soapAction="http://myurl.to/courses_v1/setKeyWordIds"/>
     <input name="setKeyWordIds">
      <soap:body use="literal"/>
     </input>
     <output name="setKeyWordIdsResponse">
      <soap:body use="literal"/>
     </output>
       <fault name="userDoesNotHavePermissionsFault">
           <soap:fault use="literal" name="userDoesNotHavePermissionsFault"/>
    </fault>  
       <fault name="courseIdNotFoundFault">
           <soap:fault use="literal" name="courseIdNotFoundFault"/>
    </fault> 
     <fault name="keywordNotFoundFault">
        <soap:fault use="literal" name="keywordNotFoundFault"/>
  </fault>
     <fault name="mainKeywordNotInKeywordListFault">
        <soap:fault use="literal" name="mainKeywordNotInKeywordListFault"/>
  </fault>
    </operation>
   
  </binding>

  <service name="Courses_v1_0">
    <port binding="tns:Courses_v1_0_SOAP11Binding" name="SOAPOverHTTP">
      <soap:address location="http://myurl.to/myNameSpace/Service.svc"/>
    </port>
  </service>
 
</definitions>

 

XSD:

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="http://myurl.to/courses_v1.0.xsd"
  targetNamespace="http:///myurl.to/courses_v1.0.xsd">


  <xsd:complexType name="course">
    <xsd:sequence>
      <xsd:element name="id" type="xsd:long"/>
      <xsd:element name="organisationId" type="xsd:long" />
      <xsd:element name="departmentId" type="xsd:long" />
      <xsd:element name="courseCodeId" type="xsd:long" />
      <xsd:element name="title" type="str255" />
      <xsd:element name="dateFrom" type="xsd:date" />
      <xsd:element name="dateTo" type="xsd:date" />
      <xsd:element name="timeFrom" type="xsd:dateTime" minOccurs="0" />
      <xsd:element name="timeTo" minOccurs="0" type="xsd:dateTime" />
      <xsd:element name="municipalId" type="xsd:long" />
      <xsd:element name="place" minOccurs="0" type="str255" />
      <xsd:element name="enrollmentFrom" type="xsd:date" />
      <xsd:element name="enrollmentTo" type="xsd:date" />
      <xsd:element name="timeTxt" minOccurs="0" type="str2000" />
      <xsd:element name="nrUnits" type="xsd:int"/>
      <xsd:element name="minutesPerUnit" type="xsd:int" />
      <xsd:element name="days" type="xsd:decimal"/>
      <xsd:element name="subTitle" minOccurs="0" type="str2000"/>
      <xsd:element name="targetGroup1" minOccurs="0" type="str75" />
      <xsd:element name="targetGroup2" minOccurs="0" type="str75" />
      <xsd:element name="targetGroup3" minOccurs="0" type="str75" />
      <xsd:element name="courseCosts1" minOccurs="0" type="str75" />
      <xsd:element name="courseCosts2" minOccurs="0" type="str75" />
      <xsd:element name="referent1" minOccurs="0" type="str75" />
      <xsd:element name="referent2" minOccurs="0" type="str75" />
      <xsd:element name="referent3" minOccurs="0" type="str75" />
      <xsd:element name="keyWordIds" minOccurs="1" maxOccurs="unbounded" type="xsd:long" />
      <xsd:element name="mainKeyWordId" type="xsd:long"/>
      <xsd:element name="numberWeeks" type="xsd:long" />
      <xsd:element name="isOnMonday" type="xsd:boolean" />
      <xsd:element name="isOnTuesday" type="xsd:boolean" />
      <xsd:element name="isOnWednesday" type="xsd:boolean" />
      <xsd:element name="isOnThursday" type="xsd:boolean" />
      <xsd:element name="isOnFriday" type="xsd:boolean" />
      <xsd:element name="isOnSaturday" type="xsd:boolean" />
      <xsd:element name="isOnSunday" type="xsd:boolean" />
      <xsd:element name="frequenceTxt" type="str1000" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="department">
    <xsd:sequence>
      <xsd:element name="id" type="xsd:long" />
      <xsd:element name="nameD" type="str255" />
      <xsd:element name="nameI" type="str255" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="municipality">
    <xsd:sequence>
      <xsd:element name="id" type="xsd:long" />
      <xsd:element name="nameD" type="str80" />
      <xsd:element name="nameI" type="str80" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="organisation">
    <xsd:sequence>
      <xsd:element name="id" type="xsd:long" />
      <xsd:element name="nameD" type="str255" />
      <xsd:element name="nameI" type="str255" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="keyWord">
    <xsd:sequence>
      <xsd:element name="id" type="xsd:long" />
      <xsd:element name="nameD" type="str80" />
      <xsd:element name="nameI" type="str80" />
    </xsd:sequence>
  </xsd:complexType>
 
  <xsd:complexType name="courseCode">
    <xsd:sequence>
      <xsd:element name="id" type="xsd:long" />
      <xsd:element name="nameD" type="str80" />
      <xsd:element name="nameI" type="str80" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:simpleType name="str75">
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="75"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="str80">
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="80"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="str255">
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="255"/>
    </xsd:restriction>
  </xsd:simpleType>
 
  <xsd:simpleType name="str1000">
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="1000"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="str2000">
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="2000"/>
    </xsd:restriction>
  </xsd:simpleType>
 
</xsd:schema>

 

Thanks Christoph

Dec 1, 2010 at 2:34 PM

Hi Christoph,

Thanks for the extra information. It does not like you declaring the fault type as an anonymous type definition.

First declare your type explicitly.

<xsd:complexType name="fromDateInThePastFault" />

 

Then reference it in your element.


<element name="fromDateInThePastFault" type="courses:fromDateInThePastFault" />

Cheers,

Alex.