.NET Framework Developer Center > .NET Framework Forums > Windows Communication Foundation (WCF) > Failed to generate code for the service reference 2

Answered Failed to generate code for the service reference 2

  • Monday, May 04, 2009 3:06 PM
     
     
    Hello,
     I work at the moment on a project in VB and I would like to connect to a Web service. When i try to connect to the Web service of decison deck :
    WSDL : 
    http://ernst-schroeder.uni.lu/rubisServer/Version-1.0/rubisServer-1.0-3.wsdl
    i am getting an error and many warning...


    Erreur :
    Error    10    Custom tool error: Failed to generate code for the service reference 'ServiceReference1'.  Please check other error and warning messages for details.    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\
    TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD

    Warnings :
    Warning    1    Custom tool warning: There was an error verifying some XML Schemas generated during export:
    Type 'http://www.w3.org/2001/XMLSchema:id ' is not declared.    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD
    Warning    2    Custom tool warning: Style Document inferred from messages in operation hello does not match expected style Rpc specified via bindings.    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD
    Warning    3    Custom tool warning: Style Document inferred from messages in operation submitProblem does not match expected style Rpc specified via bindings.    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD
    Warning    4    Custom tool warning: Style Document inferred from messages in operation submitRubisProblem does not match expected style Rpc specified via bindings.    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD
    Warning    5    Custom tool warning: Style Document inferred from messages in operation requestOutrankingDigraph does not match expected style Rpc specified via bindings.    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD
    Warning    6    Custom tool warning: Style Document inferred from messages in operation requestRandomPerformanceTableau does not match expected style Rpc specified via bindings.    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD
    Warning    7    Custom tool warning: Cannot import wsdl:portType
    Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
    Error: An item with the same key has already been added.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://ernst-schroeder.uni.lu/rubisServer/Version-1.0']/wsdl:portType[@name='rubisServerPortType ']    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD
    Warning    8    Custom tool warning: Cannot import wsdl:binding
    Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
    XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://ernst-schroeder.uni.lu/rubisServer/Version-1.0']/wsdl:portType[@name='rubisServerPortType ']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://ernst-schroeder.uni.lu/rubisServer/Version-1.0']/wsdl:binding[@name='rubisServerBinding ']    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD
    Warning    9    Custom tool warning: Cannot import wsdl:port
    Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
    XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://ernst-schroeder.uni.lu/rubisServer/Version-1.0']/wsdl:binding[@name='rubisServerBinding ']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://ernst-schroeder.uni.lu/rubisServer/Version-1.0']/wsdl:service[@name='rubisServer']/wsdl:port[@name='rubisServerPortType ']    C:\Users\Ghjuvan' Battì\Documents\Visual Studio 2008\Projects\TestWebServiceDD\TestWebServiceDD\Service References\ServiceReference1\Reference.svcmap    1    1    TestWebServiceDD

    Information : this is a phyton web service

    Please Help Me !!!
    Thank you


Answers

  • Monday, May 04, 2009 9:53 PM
     
     Answered
    This web service uses the rpx/literal pattern which is not supprted in .Net in all cases. In particular "part" elements in the wsdl should have "type" attribute and not "element". It might be possible to do hard work and fix this wsdl but it can take time.

    I suggest you will get a sample request soap message (either from the servie author or from a python client) and use .Net to send raw http messages based on this sample.

    http://webservices20.blogspot.com/
    WCF Security, Performance And Testing Blog
    • Marked As Answer by Marco Zhou Wednesday, May 06, 2009 5:42 AM
    •