Errors on single service - multi operations

Dec 3, 2009 at 5:09 PM
Edited Dec 14, 2009 at 12:58 PM

Hi, I seem to be having some issues,

 

There was a validation error on a schema generated during export:
    Source: 
    Line: 4 Column: 3
   Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentShedualType' has already been declared.
---------------------------------------------------------------------------------
There was a validation error on a schema generated during export:
    Source: 
    Line: 11 Column: 3
   Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:ContactDetailsType' has already been declared.
---------------------------------------------------------------------------------
There was a validation error on a schema generated during export:
    Source: 
    Line: 21 Column: 3
   Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AddressType' has already been declared.
---------------------------------------------------------------------------------
There was a validation error on a schema generated during export:
    Source: 
    Line: 31 Column: 3
   Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:MeterType' has already been declared.
---------------------------------------------------------------------------------
There was a validation error on a schema generated during export:
    Source: 
    Line: 38 Column: 3
   Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:SupplierType' has already been declared.
---------------------------------------------------------------------------------
There was a validation error on a schema generated during export:
    Source: 
    Line: 44 Column: 3
   Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:CustomerType' has already been declared.
---------------------------------------------------------------------------------
There was a validation error on a schema generated during export:
    Source: 
    Line: 53 Column: 3
   Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentType' has already been declared.
---------------------------------------------------------------------------------

These errors result when using the WSCF.blue 'Generate Web Service code. . . ' context menu on the WSDL file (below) in solution explorer. These files exist within a VS2008 'Visual C#\Web\WCF Service Application' project type.

Note: Relative path - All the XSD's live within the same directory as the WSDL.

 

<?xml version="1.0"?>
<!-- edited with XMLSpy v2006 rel. 3 sp1 (http://www.altova.com) by Zoey Coates (E.ON UK Plc) -->
<xs:schema xmlns="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes">
          <xs:complexType name="AppointmentShedualType">
                   <xs:all>
                             <xs:element name="UTC_Date" type="xs:date"/>
                             <xs:element name="UTC_StartTime" type="xs:time"/>
                             <xs:element name="UTC_EndTime" type="xs:time"/>
                   </xs:all>
          </xs:complexType>
          <xs:complexType name="ContactDetailsType">
                   <xs:all>
                             <xs:element name="Name"/>
                             <xs:element name="Address" type="AddressType"/>
                             <xs:element name="Telephone1" type="xs:int"/>
                             <xs:element name="Telephone2" type="xs:string"/>
                             <xs:element name="TelephoneMobile1" type="xs:string"/>
                             <xs:element name="EmailAddress" type="xs:string"/>
                   </xs:all>
          </xs:complexType>
          <xs:complexType name="AddressType">
                   <xs:all>
                             <xs:element name="Line1" type="xs:string"/>
                             <xs:element name="Line2" type="xs:string"/>
                             <xs:element name="Line3" type="xs:string"/>
                             <xs:element name="Line4" type="xs:string"/>
                             <xs:element name="Line5" type="xs:string"/>
                             <xs:element name="PostCode" type="xs:string"/>
                   </xs:all>
          </xs:complexType>
          <xs:complexType name="MeterType">
                   <xs:all>
                             <xs:element name="MPAN" type="xs:int"/>
                             <xs:element name="SerialNumber" type="xs:string"/>
                             <xs:element name="Location" type="xs:string"/>
                   </xs:all>
          </xs:complexType>
          <xs:complexType name="SupplierType">
                   <xs:all>
                             <xs:element name="ID"/>
                             <xs:element name="Name"/>
                   </xs:all>
          </xs:complexType>
          <xs:complexType name="CustomerType">
                   <xs:all>
                             <xs:element name="ID"/>
                             <xs:element name="Meter" type="MeterType"/>
                             <xs:element name="Appointment" type="AppointmentType" minOccurs="0"/>
                             <xs:element name="ContactDetails" type="ContactDetailsType"/>
                             <xs:element name="Supplier" type="SupplierType"/>
                   </xs:all>
          </xs:complexType>
          <xs:complexType name="AppointmentType">
                   <xs:all>
                             <xs:element name="ID"/>
                             <xs:element name="ContactDetails" type="ContactDetailsType"/>
                             <xs:element name="AdditionalInformation" type="xs:string" minOccurs="0"/>
                             <xs:element name="Meter" type="MeterType"/>
                             <xs:element name="Shedual" type="AppointmentShedualType"/>
                   </xs:all>
          </xs:complexType>
</xs:schema>


The web services are;


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://Eonuk.EnergyServices/WEAB/1.0/Services/CreateAppointment" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" targetNamespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/CreateAppointment" elementFormDefault="qualified" attributeFormDefault="unqualified">
          <xs:import namespace="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" schemaLocation="BaseTypes.xsd"/>
          <xs:element name="CreateAppointment_Request">
                   <xs:complexType>
                             <xs:all>
                                      <xs:element name="Appointment" type="ns1:AppointmentType"/>
                             </xs:all>
                   </xs:complexType>
          </xs:element>
          <xs:element name="CreateAppointment_Response">
                   <xs:complexType>
                             <xs:all>
                                      <xs:element name="Successfull" type="xs:boolean"/>
                             </xs:all>
                   </xs:complexType>
          </xs:element>
</xs:schema>

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetAvailableTimes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" targetNamespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetAvailableTimes" elementFormDefault="qualified" attributeFormDefault="unqualified">
          <xs:import namespace="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" schemaLocation="BaseTypes.xsd"/>
          <xs:element name="GetAvailableTimes_Response">
                   <xs:complexType>
                             <xs:all>
                                      <xs:element name="AvailableTimes">
                                                <xs:complexType>
                                                          <xs:sequence>
                                                                   <xs:element name="Shedual" type="ns1:AppointmentShedualType" minOccurs="0" maxOccurs="unbounded"/>
                                                          </xs:sequence>
                                                </xs:complexType>
                                      </xs:element>
                             </xs:all>
                   </xs:complexType>
          </xs:element>
          <xs:element name="GetAvailableTimes_Request">
                   <xs:complexType>
                             <xs:all>
                                      <xs:element name="Appointment" type="ns1:AppointmentType"/>
                                      <xs:element name="UTC_Date" type="xs:date"/>
                             </xs:all>
                   </xs:complexType>
          </xs:element>
</xs:schema>

<?xml version="1.0"?>
<xs:schema xmlns:ns0="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" xmlns="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetCustomer" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetCustomer" elementFormDefault="qualified" attributeFormDefault="unqualified" id="GetCustomer">
          <xs:import namespace="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" schemaLocation=".\basetypes.xsd"/>
          <xs:element name="GetCustomer_Request">
                   <xs:complexType>
                             <xs:all>
                                      <xs:element name="MPAN" type="xs:string"/>
                                      <xs:element name="WEAB_ID" type="xs:string"/>
                             </xs:all>
                   </xs:complexType>
          </xs:element>
          <xs:element name="GetCustomer_Response">
                   <xs:complexType>
                             <xs:all>
                                      <xs:element name="Customer" type="ns0:CustomerType"/>
                             </xs:all>
                   </xs:complexType>
          </xs:element>
</xs:schema>

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetMeterLocations" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" targetNamespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetMeterLocations" elementFormDefault="qualified" attributeFormDefault="unqualified">
          <xs:import namespace="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" schemaLocation="BaseTypes.xsd"/>
          <xs:element name="GetMeterLocations_Response">
                   <xs:complexType>
                             <xs:sequence>
                                      <xs:element name="MeterLocation" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                             </xs:sequence>
                   </xs:complexType>
          </xs:element>
          <xs:element name="GetMeterLocations_Request"/>
</xs:schema>

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 rel. 3 sp1 (http://www.altova.com) by Zoey Coates (E.ON UK Plc) -->
<xs:schema xmlns="http://Eonuk.EnergyServices/WEAB/1.0/Services/LogLastScreen" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/LogLastScreen" elementFormDefault="qualified" attributeFormDefault="unqualified">
          <xs:element name="LogLastScreen_Request">
                   <xs:complexType>
                             <xs:all>
                                      <xs:element name="ScreenName" type="xs:string"/>
                             </xs:all>
                   </xs:complexType>
          </xs:element>
</xs:schema>

 

 

 

Dec 3, 2009 at 5:27 PM

NB

WSCF.blue version - V1.0.5

Visual Studio 2008 V3.0.907291 SP

.NET 3.5 SP1

 

Dec 3, 2009 at 5:34 PM
Edited Dec 14, 2009 at 12:55 PM

Due to Message length is too long  error, separate post for WSDL file ...

 

 

<!--WSDL generated by thinktecture WSCF; version 1.0.5.0-->
<!--Thursday, 03-12-2009 - 03:27 PM-->
<definitions xmlns:import5="http://Eonuk.EnergyServices/WEAB/1.0/Services/LogLastScreen" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:import1="http://Eonuk.EnergyServices/WEAB/1.0/Services/CreateAppointment" xmlns:import0="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" xmlns:tns="http://Eonuk.EnergyServices/WEAB/1.0/Services" xmlns:import2="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetAvailableTimes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:import3="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetCustomer" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:import4="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetMeterLocations" name="WEAB" targetNamespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" xmlns="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
  <types>
    <xsd:schema>
      <xsd:import schemaLocation="BaseTypes.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" />
      <xsd:import schemaLocation="CreateAppointment.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/CreateAppointment" />
      <xsd:import schemaLocation="GetAvailableTimes.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetAvailableTimes" />
      <xsd:import schemaLocation="GetCustomer.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetCustomer" />
      <xsd:import schemaLocation="GetMeterLocations.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/GetMeterLocations" />
      <xsd:import schemaLocation="LogLastScreen.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services/LogLastScreen" />
    </xsd:schema>
  </types>
  <message name="createAppointmentIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:CreateAppointment_Request" />
  </message>
  <message name="createAppointmentOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:CreateAppointment_Response" />
  </message>
  <message name="getAvailableTimesIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import2:GetAvailableTimes_Request" />
  </message>
  <message name="getAvailableTimesOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import2:GetAvailableTimes_Response" />
  </message>
  <message name="getCustomerIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import3:GetCustomer_Request" />
  </message>
  <message name="getCustomerOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import3:GetCustomer_Response" />
  </message>
  <message name="getMeterLocationsIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import4:GetMeterLocations_Request" />
  </message>
  <message name="getMeterLocationsOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import4:GetMeterLocations_Response" />
  </message>
  <message name="logLastScreenIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import5:LogLastScreen_Request" />
  </message>
  <portType name="WEABInterface">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <operation name="CreateAppointment">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="tns:createAppointmentIn" />
      <output message="tns:createAppointmentOut" />
    </operation>
    <operation name="GetAvailableTimes">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="tns:getAvailableTimesIn" />
      <output message="tns:getAvailableTimesOut" />
    </operation>
    <operation name="GetCustomer">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="tns:getCustomerIn" />
      <output message="tns:getCustomerOut" />
    </operation>
    <operation name="GetMeterLocations">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="tns:getMeterLocationsIn" />
      <output message="tns:getMeterLocationsOut" />
    </operation>
    <operation name="LogLastScreen">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="tns:logLastScreenIn" />
    </operation>
  </portType>
  <binding name="BasicHttpBinding_WEABInterface" type="tns:WEABInterface">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="CreateAppointment">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:createAppointmentIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="GetAvailableTimes">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:getAvailableTimesIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="GetCustomer">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:getCustomerIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="GetMeterLocations">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:getMeterLocationsIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="LogLastScreen">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:logLastScreenIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
    </operation>
  </binding>
  <service name="WEABPort">
    <port name="WEABPort" binding="tns:BasicHttpBinding_WEABInterface">
      <soap:address location="http://localhost/WEAB" />
    </port>
  </service>
</definitions>

 

Developer
Dec 6, 2009 at 1:08 PM

Hi Terry,

Sorry for the delay in reply. Please comment out the reference to the BaseTypes.xsd in the WEAB.wsdl file.

 

<xsd:import schemaLocation="BaseTypes.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes" />

 

I believe this is causing the types to be imported twice, since they are already referenced in each of the other XSD files. That should sort the problem out for you.

Cheers,

Alex.

 

Dec 14, 2009 at 12:31 PM
Edited Dec 14, 2009 at 1:06 PM

Thank you very much for that, that worked a treat, I now have successful code generation, so now i have all the files.

trpc77553tfa22a8rdgk.jpg

 

Unfortunately there is a problem when browsing the svc file. Having added an implementation class (WEABServices.cs) for the abstract class and modified the svc file to point to WEABServices.cs, and merged the output.config and modified the service name to point to the new class 'EonUK.WEAB.WS.Proxy.Implimentation.WEABServices'.

 


 

Server Error in '/' Application.

No protocol binding matches the given address 'http://localhost/WEAB'. Protocol bindings are configured at the Site level in IIS or WAS configuration.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: No protocol binding matches the given address 'http://localhost/WEAB'. Protocol bindings are configured at the Site level in IIS or WAS configuration.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[InvalidOperationException: No protocol binding matches the given address 'http://localhost/WEAB'. Protocol bindings are configured at the Site level in IIS or WAS configuration.]
   System.ServiceModel.Channels.TransportChannelListener.OnOpening() +11513378
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +229
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +72

[InvalidOperationException: The ChannelDispatcher at 'http://localhost/WEAB' with contract(s) '"IWEAB"' is unable to open its IChannelListener.]
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +118
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +107
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

[ServiceActivationException: The service '/WEAB.svc' cannot be activated due to an exception during compilation.  The exception message is: The ChannelDispatcher at 'http://localhost/WEAB' with contract(s) '"IWEAB"' is unable to open its IChannelListener..]
   System.ServiceModel.AsyncResult.End(IAsyncResult result) +11531006
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75



Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3

 


 

Now im not sure why this is happening since im new to WCF, but its very upsetting.

 

my svc file:

 

<%@ ServiceHost Service="EonUK.WEAB.WS.Proxy.Implimentation.WEABServices" %>

 

web config:

 

<?xml version="1.0"
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">


    <configSections>
      <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
          <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
            <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
            <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
            <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          </sectionGroup>
        </sectionGroup>
      </sectionGroup>
    </configSections>  


    <appSettings/>
    <connectionStrings/>

    <system.web>
        <!--
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
        <compilation debug="false">

          <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </assemblies>

        </compilation>
        <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
        <authentication mode="Windows" />
        <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->


      <pages>
        <controls>
          <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </controls>
      </pages>

      <httpHandlers>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      </httpHandlers>
      <httpModules>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </httpModules>


    </system.web>

    <system.codedom>
      <compilers>
        <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
                  type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <providerOption name="CompilerVersion" value="v3.5"/>
          <providerOption name="WarnAsError" value="false"/>
        </compiler>
      </compilers>
    </system.codedom>

    <system.web.extensions>
      <scripting>
        <webServices>
          <!--
              Uncomment this section to enable the authentication service. Include 
              requireSSL="true" if appropriate.

          <authenticationService enabled="true" requireSSL = "true|false"/>
          -->
          <!--
              Uncomment these lines to enable the profile service, and to choose the 
              profile properties that can be retrieved and modified in ASP.NET AJAX 
              applications.

          <profileService enabled="true"
                          readAccessProperties="propertyname1,propertyname2"
                          writeAccessProperties="propertyname1,propertyname2" />
          -->
          <!--
              Uncomment this section to enable the role service.

          <roleService enabled="true"/>
          -->
        </webServices>
        <!--
        <scriptResourceHandler enableCompression="true" enableCaching="true" />
        -->
      </scripting>
    </system.web.extensions>
    <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
        <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </modules>
      <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
             type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
             type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </handlers>
    </system.webServer>


	<system.serviceModel>
		<behaviors>
			<serviceBehaviors>
				<behavior name="metadataServiceExtension">
					<metadataService metadataUrl="wsdl" rootMetadataFileLocation="Contracts\WEAB.wsdl" />
				</behavior>
			</serviceBehaviors>
		</behaviors>
		<bindings>
			<basicHttpBinding>
				<binding name="BasicHttpBinding_WEABInterface" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
					<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
					<security mode="None">
						<transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
						<message clientCredentialType="UserName" algorithmSuite="Default" />
					</security>
				</binding>
			</basicHttpBinding>
		</bindings>
		<extensions>
			<behaviorExtensions>
				<add name="metadataService" type="Thinktecture.ServiceModel.Extensions.Metadata.StaticMetadataBehaviorElement, Thinktecture.ServiceModel.Extensions.Metadata, Version=1.0.5.0, Culture=neutral, PublicKeyToken=20fb7cabbfb92df4" />
			</behaviorExtensions>
		</extensions>
		<services>
			<service behaviorConfiguration="metadataServiceExtension" name="EonUK.WEAB.WS.Proxy.Implimentation.WEABServices">
				<endpoint address="http://localhost/WEAB" behaviorConfiguration=""
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_WEABInterface"
                    contract="IWEAB" />
			</service>
		</services>
	</system.serviceModel>
</configuration>

 

My solution structure;

Dec 14, 2009 at 2:35 PM
Edited Dec 14, 2009 at 2:57 PM

ok, I think i may have solved the issue... you so need to know the intricacies of WCF before jumping in ah...

Well i basically blanked the endpoint address value thus;

 

 

			<service behaviorConfiguration="metadataServiceExtension" name="EonUK.WEAB.WS.Proxy.Implimentation.WEABServices">
				<endpoint address="" behaviorConfiguration=""
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_WEABInterface"
                    contract="IWEAB" />
			</service>

 

not sure yet why this fixes it, perhaps i need to purchase a WCF book, however, this seems to have resulted in at least a browsable web service in both the Cassini web server and from IIS 6.

Now on to testing it.

 

 

Dec 14, 2009 at 2:56 PM
Edited Dec 14, 2009 at 3:00 PM

Ok, first things are that the WSDL appers not to be 'published' so i get the error 'System.InvalidOperationException: The HTML document does not contain Web service discovery information' in web service studio.

Metadata publishing for this service is currently disabled. note in browser.

Not sure what the metadataService (Thinktecture.ServiceModel.Extensions.Metadata.StaticMetadataBehaviorElement) should be doing to mitigate this but there is no WSDL available.

 

Dec 14, 2009 at 5:31 PM

I have gone back to the XSDs, each XSD has a different namespace;

http://Eonuk.EnergyServices/WEAB/1.0/Services/CreateAppointment

http://Eonuk.EnergyServices/WEAB/1.0/Services/GetCustomer

and so on.

 

i have made them all the same http://Eonuk.EnergyServices/WEAB/1.0/Services

Now the tool generates the WSDL and code. I still had to hack the output.config since now it missed of the endpoint for some reason. I also had to change

			<serviceBehaviors>
				<behavior name="metadataServiceExtension">
					<metadataService metadataUrl="wsdl" rootMetadataFileLocation="D:\TFS01\WEAB\Main\Solutions\EonUK.WEAB.WS.Proxy\Contracts\WEAB.wsdl" />
				</behavior>
			</serviceBehaviors>

since it does not work, to;

 

				<behavior name="metadataServiceExtension">
					<serviceMetadata httpGetEnabled="True" policyVersion="Policy15" />
					<serviceDebug includeExceptionDetailInFaults="true"/>
				</behavior>
now i can connect and execute the service... at last lol

 

 

 

 

 

Dec 15, 2009 at 10:19 AM

Anyway, this is not the desired outcome, from this we are relying on the WCF framwork generated WSDL not the contract first. So no cigar!

So reverting back to the generated config.

When testing the service using WCF Test Client or WCFStorm 1.1.7 we get the errors

Error: Cannot obtain Metadata from http://localhost/EonUK.WEAB.WS.Proxy/WEAB.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: http://localhost/EonUK.WEAB.WS.Proxy/WEAB.svc    Metadata contains a reference that cannot be resolved: 'http://localhost/EonUK.WEAB.WS.Proxy/WEAB.svc'.    Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost/EonUK.WEAB.WS.Proxy/WEAB.svc.  The client and service bindings may be mismatched.    The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..HTTP GET Error    URI: http://localhost/EonUK.WEAB.WS.Proxy/WEAB.svc    The HTML document does not contain Web service discovery information.

or

The HTML document does not contain Web service discovery information.

respectively.

Think i'm going to give up and say it just don't work out the box without all kinds of pain.


WSDL

 

<?xml version="1.0" encoding="utf-8"?>
<!--WSDL generated by thinktecture WSCF; version 1.0.5.0-->
<!--Monday, 14-12-2009 - 06:00 PM-->
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:import1="http://Eonuk.EnergyServices/WEAB/1.0/Services" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="WEAB" targetNamespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" xmlns="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
  <types>
    <xsd:schema>
      <xsd:import schemaLocation="CreateAppointment.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
      <xsd:import schemaLocation="GetAvailableTimes.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
      <xsd:import schemaLocation="GetCustomer.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
      <xsd:import schemaLocation="GetMeterLocations.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
      <xsd:import schemaLocation="LogLastScreen.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
    </xsd:schema>
  </types>
  <message name="createAppointmentIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:CreateAppointment_Request" />
  </message>
  <message name="createAppointmentOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:CreateAppointment_Response" />
  </message>
  <message name="getAvailableTimesIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetAvailableTimes_Request" />
  </message>
  <message name="getAvailableTimesOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetAvailableTimes_Response" />
  </message>
  <message name="getCustomerIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetCustomer_Request" />
  </message>
  <message name="getCustomerOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetCustomer_Response" />
  </message>
  <message name="getMeterLocationsIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetMeterLocations_Request" />
  </message>
  <message name="getMeterLocationsOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetMeterLocations_Response" />
  </message>
  <message name="logLastScreenIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:LogLastScreen_Request" />
  </message>
  <portType name="WEABInterface">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <operation name="CreateAppointment">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:createAppointmentIn" />
      <output message="import1:createAppointmentOut" />
    </operation>
    <operation name="GetAvailableTimes">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:getAvailableTimesIn" />
      <output message="import1:getAvailableTimesOut" />
    </operation>
    <operation name="GetCustomer">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:getCustomerIn" />
      <output message="import1:getCustomerOut" />
    </operation>
    <operation name="GetMeterLocations">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:getMeterLocationsIn" />
      <output message="import1:getMeterLocationsOut" />
    </operation>
    <operation name="LogLastScreen">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:logLastScreenIn" />
    </operation>
  </portType>
  <binding name="BasicHttpBinding_WEABInterface" type="import1:WEABInterface">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="CreateAppointment">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:createAppointmentIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="GetAvailableTimes">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:getAvailableTimesIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="GetCustomer">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:getCustomerIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="GetMeterLocations">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:getMeterLocationsIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="LogLastScreen">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:logLastScreenIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
    </operation>
  </binding>
</definitions>

 

WEB.config

<?xml version="1.0" encoding="utf-8"?>
<!--
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
	<configSections>
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
					<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
				</sectionGroup>
			</sectionGroup>
		</sectionGroup>
	</configSections>
	<appSettings/>
	<connectionStrings/>
	<system.web>
		<!--
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
		<compilation debug="true">
			<assemblies>
				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			</assemblies>
		</compilation>
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authentication mode="Windows"/>
		<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
		<pages>
			<controls>
				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			</controls>
		</pages>
		<httpHandlers>
			<remove verb="*" path="*.asmx"/>
			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
		</httpHandlers>
		<httpModules>
			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</httpModules>
	</system.web>
	<system.codedom>
		<compilers>
			<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
				<providerOption name="CompilerVersion" value="v3.5"/>
				<providerOption name="WarnAsError" value="false"/>
			</compiler>
		</compilers>
	</system.codedom>
	<system.web.extensions>
		<scripting>
			<webServices>
				<!--
              Uncomment this section to enable the authentication service. Include 
              requireSSL="true" if appropriate.

          <authenticationService enabled="true" requireSSL = "true|false"/>
          -->
				<!--
              Uncomment these lines to enable the profile service, and to choose the 
              profile properties that can be retrieved and modified in ASP.NET AJAX 
              applications.

          <profileService enabled="true"
                          readAccessProperties="propertyname1,propertyname2"
                          writeAccessProperties="propertyname1,propertyname2" />
          -->
				<!--
              Uncomment this section to enable the role service.

          <roleService enabled="true"/>
          -->
			</webServices>
			<!--
        <scriptResourceHandler enableCompression="true" enableCaching="true" />
        -->
		</scripting>
	</system.web.extensions>
	<!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
	<system.webServer>
		<validation validateIntegratedModeConfiguration="false"/>
		<modules>
			<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</modules>
		<handlers>
			<remove name="WebServiceHandlerFactory-Integrated"/>
			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</handlers>
	</system.webServer>
	
	
	<system.serviceModel>
		<behaviors>
			<serviceBehaviors>
				<behavior name="metadataServiceExtension">
					<metadataService metadataUrl="wsdl" rootMetadataFileLocation="D:\TFS01\WEAB\Main\Solutions\EonUK.WEAB.WS.Proxy\Contracts\WEAB.wsdl" />
				</behavior>
				<!--<behavior name="metadataServiceExtension">
					<serviceMetadata httpGetEnabled="True" externalMetadataLocation="..\Contracts\WEAB.wsdl"  />
					--><!--<serviceMetadata httpGetEnabled="True" policyVersion="Policy15"  />--><!--

					<serviceDebug includeExceptionDetailInFaults="true"/>
				</behavior>-->
			</serviceBehaviors>
		</behaviors>
		<bindings>
			<basicHttpBinding>
				<binding name="BasicHttpBinding_WEABInterface" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
					<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
					<security mode="None">
						<transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
						<message clientCredentialType="UserName" algorithmSuite="Default" />
					</security>
				</binding>
			</basicHttpBinding>
		</bindings>
		<extensions>
			<behaviorExtensions>
				<add name="metadataService" type="Thinktecture.ServiceModel.Extensions.Metadata.StaticMetadataBehaviorElement, Thinktecture.ServiceModel.Extensions.Metadata, Version=1.0.5.0, Culture=neutral, PublicKeyToken=20fb7cabbfb92df4" />
			</behaviorExtensions>
		</extensions>
		<services>
			<!--<service behaviorConfiguration="metadataServiceExtension" name="EonUK.WEAB.WS.Proxy.WEAB" >
				<endpoint address=""
binding="basicHttpBinding"
contract="IWEAB"/>
			</service>-->
			<service behaviorConfiguration="metadataServiceExtension" name="EonUK.WEAB.WS.Proxy.WEAB">
				<endpoint address="http://localhost/EonUK.WEAB.WS.Proxy" behaviorConfiguration=""
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_WEABInterface"
                    contract="IWEAB" />
			</service>
		</services>
	</system.serviceModel>
</configuration>

 

 

 

Developer
Dec 15, 2009 at 8:55 PM

Thanks for your feedback. If this is an IIS hosted file, you can try to remove our metadata service and use externalMetadataLocation attribute in standard metdataService behavior to specify the WSDL file you have.

http://msdn.microsoft.com/en-us/library/ms731317.aspx

Our Metadata service is created for non-IIS hosted scenarios. Let us know if that doesn't help.

 

Cheers,

-Buddhike

Dec 16, 2009 at 10:39 AM
Edited Dec 16, 2009 at 10:50 AM

Hi, thanks for the reply.

I hope this does not sound in anyway disingenuous.

I would perhaps recommend that since the add-in is for visual studio, could we amuse that the end user is going to be targeting the visual studio Cassini web-server first and foremost, then I would think that perhaps 98% of the time, IIS would be the chosen weapon of choice for the average Microsoft .NET programmer.

Saying that, i would think that IIS should perhaps support such a generic expression of things in any case, but perhaps IIS falls short in this regard?

However, the issue does replicate in exactly the same fashion within the visual studio Cassini web-server.

I really appreciate your input and I will report back as soon as I have made some changes.

Cheers.

 

 

 

 

 

Dec 16, 2009 at 12:24 PM
Edited Dec 16, 2009 at 12:27 PM

Modified the serviceMetadata element thus;

 

 
<behaviors>
			<serviceBehaviors>
				<behavior name="WEABmetadataService">
					<!--<metadataService metadataUrl="wsdl" rootMetadataFileLocation="D:\TFS01\WEAB\Main\Solutions\EonUK.WEAB.WS.Proxy\Contracts\WEAB.wsdl" />-->
					<serviceDebug includeExceptionDetailInFaults="true"/>
					<serviceMetadata httpGetEnabled="True" externalMetadataLocation="..\Contracts\WEAB.wsdl"  />
					<!--<serviceMetadata httpGetEnabled="True" policyVersion="Policy15"  />-->
				</behavior>
			</serviceBehaviors>
</behaviors>

 

So now the service successfully exposes the WSCF generated WSDL file.

 

But now errors ensue on discovery suggesting that the WSDL is incomplete in some way.

 

Discovering http://localhost:22465/WEAB.svc
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 3 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentShedualType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 10 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:ContactDetailsType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 20 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AddressType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 30 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:MeterType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 37 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:SupplierType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 43 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:CustomerType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 52 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentType' has already been declared.


Re-importing metadata with IgnoreWsdlError set to true...


Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 3 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentShedualType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 10 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:ContactDetailsType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 20 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AddressType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 30 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:MeterType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 37 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:SupplierType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 43 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:CustomerType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 52 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentType' has already been declared.
Generating proxy code.
Done.
Compiling...
Done.
Endpoint is invalid. Make sure that the service has an exposed MEX (wsdl) endpoint.
Discovering http://localhost:22465/WEAB.svc
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 3 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentShedualType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 10 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:ContactDetailsType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 20 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AddressType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 30 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:MeterType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 37 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:SupplierType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 43 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:CustomerType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 52 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentType' has already been declared.
Generating proxy code.
Done.
Compiling...
Done.
Endpoint is invalid. Make sure that the service has an exposed MEX (wsdl) endpoint.

 

The WSDL

 

<!--WSDL generated by thinktecture WSCF; version 1.0.5.0-->
<!--Tuesday, 15-12-2009 - 12:53 PM-->
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:import1="http://Eonuk.EnergyServices/WEAB/1.0/Services" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="WEAB" targetNamespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" xmlns="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
  <types>
    <xsd:schema>
      <xsd:import schemaLocation="CreateAppointment.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
      <xsd:import schemaLocation="GetAvailableTimes.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
      <xsd:import schemaLocation="GetCustomer.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
      <xsd:import schemaLocation="GetMeterLocations.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
      <xsd:import schemaLocation="LogLastScreen.xsd" namespace="http://Eonuk.EnergyServices/WEAB/1.0/Services" />
    </xsd:schema>
  </types>
  <message name="createAppointmentIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:CreateAppointment_Request" />
  </message>
  <message name="createAppointmentOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:CreateAppointment_Response" />
  </message>
  <message name="getAvailableTimesIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetAvailableTimes_Request" />
  </message>
  <message name="getAvailableTimesOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetAvailableTimes_Response" />
  </message>
  <message name="getCustomerIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetCustomer_Request" />
  </message>
  <message name="getCustomerOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetCustomer_Response" />
  </message>
  <message name="getMeterLocationsIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetMeterLocations_Request" />
  </message>
  <message name="getMeterLocationsOut">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:GetMeterLocations_Response" />
  </message>
  <message name="logLastScreenIn">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <part name="parameters" element="import1:LogLastScreen_Request" />
  </message>
  <portType name="WEABInterface">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
    <operation name="CreateAppointment">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:createAppointmentIn" />
      <output message="import1:createAppointmentOut" />
    </operation>
    <operation name="GetAvailableTimes">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:getAvailableTimesIn" />
      <output message="import1:getAvailableTimesOut" />
    </operation>
    <operation name="GetCustomer">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:getCustomerIn" />
      <output message="import1:getCustomerOut" />
    </operation>
    <operation name="GetMeterLocations">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:getMeterLocationsIn" />
      <output message="import1:getMeterLocationsOut" />
    </operation>
    <operation name="LogLastScreen">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      <input message="import1:logLastScreenIn" />
    </operation>
  </portType>
  <binding name="BasicHttpBinding_WEABInterface" type="import1:WEABInterface">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="CreateAppointment">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:createAppointmentIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="GetAvailableTimes">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:getAvailableTimesIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="GetCustomer">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:getCustomerIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="GetMeterLocations">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:getMeterLocationsIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="LogLastScreen">
      <soap:operation soapAction="http://Eonuk.EnergyServices/WEAB/1.0/Services:logLastScreenIn" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
    </operation>
  </binding>
</definitions>

 

 

 

Developer
Dec 16, 2009 at 9:04 PM

It's in our list use "externalMetadataLocation" if code gen happens in a web project.

Another thing you need to make sure is, all the WSDL/XSD includes/imports in the in every document should now use a resolvable path.  It seems like the errors you get now are the same ones you originally posted to this thread. Did you already try what Alex is suggesting above?

Dec 17, 2009 at 10:27 AM
Edited Dec 17, 2009 at 11:32 AM

Hi,

I did remove the base types from the WSDL file. The latest WSDL is shown above. I also removed references to the WSCF custom metadataService extension from the Web.config as suggested.

You should be able to download the solution here; Web services.zip

I should clarify that the errors are occurring from within web service tools trying to connect.  If I use config below all works fine;

 

			<serviceBehaviors>
<behavior name="WEABmetadataService">
<serviceDebug includeExceptionDetailInFaults="true"/>
<!--<serviceMetadata httpGetEnabled="True" externalMetadataLocation="..\Contracts\WEAB.wsdl" />-->
<serviceMetadata httpGetEnabled="True" policyVersion="Policy15" />
</behavior>
</serviceBehaviors>

However when we use the WSDL file WSCF generated;

 

		        <serviceBehaviors>
<behavior name="WEABmetadataService">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="True" externalMetadataLocation="..\Contracts\WEAB.wsdl" />
<!--<serviceMetadata httpGetEnabled="True" policyVersion="Policy15" />-->
</behavior>
</serviceBehaviors>

 

The service and WSDL is browsable, however any consumer appears to fail with the aforementioned list of errors. Within Webservice Studio I get.

 

Initializing
Generating WSDL
System.NullReferenceException: Object reference not set to an instance of an object.
at WebServiceStudio.Wsdl.AddDocument(String path, Object document, XmlSchemas schemas, ServiceDescriptionCollection descriptions)
at WebServiceStudio.Wsdl.ProcessRemoteUrls(DiscoveryClientProtocol client, StringCollection urls, XmlSchemas schemas, ServiceDescriptionCollection descriptions)
at WebServiceStudio.Wsdl.Generate()

 

and WCF Storm shows more detail.

 

Discovering http://localhost:22465/WEAB.svc
Generating proxy code.
Done.
Compiling...
Done.
The service contains the following endpoints...
Binding:BasicHttpBinding_IWEAB, Address: http://localhost:22465/WEAB.svc, Namespace: http://Eonuk.EnergyServices/WEAB/1.0/Services
Elapsed : 2.3009483 sec
Reflecting assembly. idc32usw, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null at time 17/12/2009 10:22:59
Found method : CreateAppointment
Found method : GetAvailableTimes
Found method : GetCustomer
Found method : GetMeterLocations
Found method : LogLastScreen
Elapsed : 0.5178499 sec
Discovering http://localhost:22465/WEAB.svc

Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 3 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentShedualType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 9 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:ContactDetailsType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 19 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AddressType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 29 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:MeterType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 36 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:SupplierType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 42 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:CustomerType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 51 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentType' has already been declared.


Re-importing metadata with IgnoreWsdlError set to true...


Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 3 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentShedualType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 9 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:ContactDetailsType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 19 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AddressType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 29 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:MeterType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 36 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:SupplierType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 42 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:CustomerType' has already been declared.
Import Error : There was a validation error on a schema generated during export:
Source: http://localhost:22465/Contracts/BaseTypes.xsd
Line: 51 Column: 3
Validation Error: The complexType 'http://Eonuk.EnergyServices/WEAB/1.0/Ref/BaseTypes:AppointmentType' has already been declared.
Generating proxy code.
Done.
Compiling...
Done.
Endpoint is invalid. Make sure that the service has an exposed MEX (wsdl) endpoint.

 

 

 

 

 

Developer
Dec 20, 2009 at 10:34 AM

I tried to download the solution but was redirected to an access denied page. You can email the solution to me if you like.

Aug 18, 2010 at 10:33 AM

I had the same problem. Since I'm using IIS I replaced Thinktecture.ServiceModel.Extensions.Metadata.StaticMetadataBehaviorElement (wich didn't work in my case) with Microsofts externalMetadataLocation. 

Added this in the <service>-tag:

 

<host>
  <baseAddresses>
    <add baseAddress="http://localhost:4444/Service"/>
  </baseAddresses>
</host>

 

and this to the endpoint:

<identity>
   <dns value="localhost"/>
</identity>

and changed address to "" in the <endpoint>-element.

not sure if this helps anyone (old post), but it worked for me =)