SkeetJon
SkeetJon

Reputation: 1491

Using svcutil to generate xsd files for client proxy

I am trying to use Svcutil to export metadata for proxy generation off a locally hosted service. I dont want to go into visual studio and click 'Add service reference' as this is a learning exercise on my part(!)

I am using svcutil as follows:

Svcutil /d:c:\temp /t:metadata http://localhost/IISCalculatorService/service.svc

This then generates two WSDL files, calculatorservice.wsdl and tempuri.org.wsdl. However I was expecting it to generate two .XSD files as well. Without these .XSD files I cant use svcutil to then generate the client code.

Am I missing something in my use of svcutil or is my understading fauly? Any help appreciated.

Here's the service's web.config

<?xml version="1.0"?>
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
    </system.web>
  <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior>
          <serviceMetadata httpGetEnabled="true"/>
                    <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
        <services>
            <service name="CalculatorService.Calculator">
                <endpoint address="" binding="basicHttpBinding" contract="CalculatorService.Contracts.ICalculator" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            </service>
        </services>
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
</configuration>

Upvotes: 4

Views: 17347

Answers (2)

Amar Palsapure
Amar Palsapure

Reputation: 9680

If you are looking for service reference directly, you can try this

svcutil.exe http://localhost/IISCalculatorService/service.svc?wsdl

Hope this helps you.

Upvotes: 3

Per Kastman
Per Kastman

Reputation: 4504

Use disco.exe to generate XSD files. http://msdn.microsoft.com/en-us/library/cy2a3ybs%28v=vs.80%29.aspx

Open Visual Studio Command Prompt and write disco http://localhost/IISCalculatorService/service.svc

Upvotes: 4

Related Questions