can't generate proxy classes for WCF SDK samples with svcutil

Hi,

I tried to generate a proxy class for GettingStarted service yesterday with FEB CTP svcutil.exe on FEB CTP Vista.

But svcutil failed after reporting a few warning messages.

The GettingStarted Service was running OK and I didn't modify it in any way.

Does anyone know what is it

I've read some known issues concerning FEB CTP svcutil. They do not seem to be relevant to the case.



Answer this question

can't generate proxy classes for WCF SDK samples with svcutil

  • macv3x

    Hi,

    Me too facing the same problem. Can you share the solution to this.

    TIA.



  • Sukh

    Are you able to access the wsdl from a browser

    http://localhost/servicemodelsamples/service.svc wsdl

    Thanks,

    Scott



  • WS_progger_starter

    Hello,

    It looks like svcutil can't find the XML Schema with target namespace http://Microsoft.ServiceModel.Samples.

    Could you please take a look at the WSDL and see if there is a XML schema import statement for the missing target namespace The import should include a location. Try hitting that location with a browser and see if you can retrieve the schema.

    Daniel Roth



  • mdelatonow

    Hi, Scott.

    Thanks for reply.

    I think I understood why that warnings (see below) appeared.

    I observed them on Vista FEB and Win2003 as well.

    The thing is that I installed the winfx runtime first. Tried WPF. Then decided to try WCF.

    I uninstalled the winfx runtime and installed IIS. Then installed the winfx runtime again and winfx sdk.

    And svcutil didn't generate a proxy.

    D:\Program Files\Microsoft SDKs\Windows\v1.0>svcutil.exe http://localhost/servic
    emodelsamples/service.svc wsdl
    Microsoft (R) Service Model Metadata Tool
    [MicrosoftR .NET Framework, Version 3.0.50727.357]
    Copyright (c) Microsoft Corporation. All rights reserved.

    Warning: Unable to import wsdl:portType
    Detail: An exception was thrown while running a WSDL import extension: System.Se
    rviceModel.Description.DataContractSerializerMessageContractConverter
    Error: Schema with target namespace http://Microsoft.ServiceModel.Samples could
    not be found.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://Microsoft.Ser
    viceModel.Samples']/wsdl:portType[@name='ICalculator']

    Warning: Unable to import wsdl:binding
    Detail: There was an error importing a wsdl:portType that the wsdl:binding is de
    pendent on.
    XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://Microsoft.Se
    rviceModel.Samples']/wsdl:portType[@name='ICalculator']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'
    ]/wsdl:binding[@name='WSHttpBinding_ICalculator']

    Warning: Unable to import wsdl:port
    Detail: There was an error importing a wsdl:binding that the wsdl:port is depend
    ent on.
    XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/'
    ]/wsdl:binding[@name='WSHttpBinding_ICalculator']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'
    ]/wsdl:service[@name='CalculatorService']/wsdl:port[@name='WSHttpBinding_ICalcul
    ator']

    Generating files...
    Warning: No code was generated.
    If you were trying to generate a proxy, this could be because the metadata docum
    ents did not contain any valid contracts/services
    or because all contracts/services were discovered to exist in /reference assembl
    ies. Verify that you passed all the metadata documents to the tool.
    Warning: If you would like to generate DataContract types from schemas please ma
    ke sure to include the /dataContractOnly option.


  • Geraint Davies

    Hi Tim,

    This issue appears to be a bug that was fixed in our more recent builds.

    Daniel Roth



  • AlSoft

    Hello, Daniel.

    Sorry, couldn't respond earlier.

    I see a blank page when trying http://localhost/servicemodelsamples/service.svc xsd=xsd0

    and http://xp_oracle.rmstest3.itsecurity/servicemodelsamples/service.svc wsdl=wsdl1 returns

    < xml version="1.0" encoding="utf-8" >

    - <wsdl:definitions targetNamespace="http://Microsoft.ServiceModel.Samples" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsap10="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/09/policy/addressing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:tns="http://Microsoft.ServiceModel.Samples" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing">
    - <wsdl:types>
    - <xsd:schema targetNamespace="http://Microsoft.ServiceModel.Samples/Imports">
    <xsd:import schemaLocation="http://xp_oracle.rmstest3.itsecurity/servicemodelsamples/service.svc xsd=xsd0" namespace="http://Microsoft.ServiceModel.Samples" />
    <xsd:import schemaLocation="http://xp_oracle.rmstest3.itsecurity/servicemodelsamples/service.svc xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
    </xsd:schema>
    </wsdl:types>
    + <wsdl:message name="ICalculator_Add_InputMessage">
    <wsdl:part name="parameters" element="tns:Add" />
    </wsdl:message>
    + <wsdl:message name="ICalculator_Add_OutputMessage">
    <wsdl:part name="parameters" element="tns:AddResponse" />
    </wsdl:message>
    + <wsdl:message name="ICalculator_Divide_InputMessage">
    <wsdl:part name="parameters" element="tns:Divide" />
    </wsdl:message>
    + <wsdl:message name="ICalculator_Divide_OutputMessage">
    <wsdl:part name="parameters" element="tns:DivideResponse" />
    </wsdl:message>
    + <wsdl:message name="ICalculator_Multiply_InputMessage">
    <wsdl:part name="parameters" element="tns:Multiply" />
    </wsdl:message>
    + <wsdl:message name="ICalculator_Multiply_OutputMessage">
    <wsdl:part name="parameters" element="tns:MultiplyResponse" />
    </wsdl:message>
    + <wsdl:message name="ICalculator_Subtract_InputMessage">
    <wsdl:part name="parameters" element="tns:Subtract" />
    </wsdl:message>
    + <wsdl:message name="ICalculator_Subtract_OutputMessage">
    <wsdl:part name="parameters" element="tns:SubtractResponse" />
    </wsdl:message>
    + <wsdl:portType msc:usingSession="false" name="ICalculator">
    - <wsdl:operation name="Add">
    <wsdl:input wsa10:Action="http://Microsoft.ServiceModel.Samples/ICalculator/Add" message="tns:ICalculator_Add_InputMessage" />
    <wsdl:output wsa10:Action="http://Microsoft.ServiceModel.Samples/ICalculator/AddResponse" message="tns:ICalculator_Add_OutputMessage" />
    </wsdl:operation>
    - <wsdl:operation name="Divide">
    <wsdl:input wsa10:Action="http://Microsoft.ServiceModel.Samples/ICalculator/Divide" message="tns:ICalculator_Divide_InputMessage" />
    <wsdl:output wsa10:Action="http://Microsoft.ServiceModel.Samples/ICalculator/DivideResponse" message="tns:ICalculator_Divide_OutputMessage" />
    </wsdl:operation>
    - <wsdl:operation name="Multiply">
    <wsdl:input wsa10:Action="http://Microsoft.ServiceModel.Samples/ICalculator/Multiply" message="tns:ICalculator_Multiply_InputMessage" />
    <wsdl:output wsa10:Action="http://Microsoft.ServiceModel.Samples/ICalculator/MultiplyResponse" message="tns:ICalculator_Multiply_OutputMessage" />
    </wsdl:operation>
    - <wsdl:operation name="Subtract">
    <wsdl:input wsa10:Action="http://Microsoft.ServiceModel.Samples/ICalculator/Subtract" message="tns:ICalculator_Subtract_InputMessage" />
    <wsdl:output wsa10:Action="http://Microsoft.ServiceModel.Samples/ICalculator/SubtractResponse" message="tns:ICalculator_Subtract_OutputMessage" />
    </wsdl:operation>
    </wsdl:portType>
    </wsdl:definitions>

  • MikeBarta411

    Yes.
    And the following output is produced.
     
    ps: The proxy is correctly generated on vmware Windows XP SP2.
         On VistaFEB and Win2003 the above warnings occur.
     
     
    < xml version="1.0" encoding="utf-8" >
    - <wsdl:definitions name="CalculatorService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsap10="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://Microsoft.ServiceModel.Samples" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/09/policy/addressing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:tns="http://tempuri.org/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing">
     
    -..................etc.................
    ... 
      </wsdl:definitions>

  • Justin Is Learning

    I'm not so sure. At least the builds that I've just downloaded over the last week. It is still suffering the same issue. As an immediate solution would rolling back to the Jan CTP be advised
  • Bob Briggs

    Hi,

    I've sent the metadata requested.


  • 1Pierre1

    Can you send the error message/warnings etc

    Thanks!

    Scott



  • Kay2live

    Ok.

    Can you run this to get me the metadata:

    svcutil <your service address> wsdl /target:metadata

    and send the output to me (smason@microsoft.com)

    We can take this offline from there.

    Thanks!

    Scott



  • Glenno

    Shall I understand this as I need to send the metadata to you.

    TIA.



  • CsharpDotnetDeveloper

    Hello again,

    Scott sent me the metadata files.

    Did you try going to http://xp_oracle.rmstest3.itsecurity/servicemodelsamples/service.svc xsd=xsd0 in the browser This should be the location of the missing schema file.

    Daniel Roth



  • can't generate proxy classes for WCF SDK samples with svcutil