none
BizTalk WCF Service Consuming Wizard RRS feed

  • Question

  • I've been given a wsdl file that is already in operation in production enviroment.

    When I try to use BizTalk WCF Service Consuming Wizard, I got the following errors:
    "
    Error consuming WCF service metadata.
    A type with the name 'OrderCustomerStatusRequest' already exists.  A type must have a unique name leveling its namespace
    "

    Then I try and generate the C# proxy code using the microsoft wsdl,I got the following errors.

    C:\Temp>wsdl /out:testproxy.cs OrderCustomerStatus_OUT.wsdl
    Microsoft (R) Web Services Description Language Utility
    [Microsoft (R) .NET Framework, Version 2.0.50727.42]
    Copyright (C) Microsoft Corporation. All rights reserved.
    Error: Unable to import binding 'OrderCustomerStatus_OUTBinding' from namespace
    'http://ttt.com/ttt'.
      - Unable to import operation 'OrderCustomerStatusRequest'.
      - The operation binding 'OrderCustomerStatusRequest' from namespace 'http://ttt/ttt had invalid syntax.  Missing soap:operation binding
    .

    If you would like more help, please type "wsdl /?".

    I would hope that this is not a rare occurance and there is a process to overcome this problem.

    Thanks in advance.


    Kerrey [BizTalk Consultant]
    Tuesday, June 9, 2009 4:27 PM

Answers

  • Hey Kerrey,

    I was able to create the proxy class and config file using SvcUtil.exe AFTER doing modifications in the WSDL file. All the declaration for elements like (Salutation, AcademicTitle, FirstName,.....) there were no nameSpace being referred. And svcUtil was not able to find out where they belongs to. So I looked at the WSDL and found that these elements might be belongs to p1 namespace. So I modified them from type="Salutation" to type="p1:Salutation". After doing the modification I was able to add a service reference to a console application.

    However, I was not able to consume this WSDL using "WCF Service consuming wizard" and I got
    "Error consuming WCF service metadata. A type with the name 'orderExport' already exists.  A type must have a unique name leveling its namespace."
    I again checked the WSDL and I see tha portType and message are given same name as "orderExport". And as per http://msdn.microsoft.com/en-us/library/ms996486.aspx#understand_topic5 "Each portType must be given a unique name making it possible to refer to it from elsewhere in the WSDL definition"

    So I changed the name of portType from orderExport to orderExportType and then I was able to run WCF service consuming wizard successfully. I have sent you the WSDL file, please check if it works now.

    But I must say that this WSDL does not seems to as per W3C standards.

    All the best!!!

     

     

     

    Thursday, June 11, 2009 2:40 PM

All replies

  • Is that WSDL file belongs to WCF service?
    Could you please send the WSDL file at chiragpa at microsoft dot com?
    Wednesday, June 10, 2009 11:46 AM
  • Sent to the address you mentioned, thanks.
    Kerrey [BizTalk Consultant]
    Wednesday, June 10, 2009 3:32 PM
  • Hey Kerrey,

    I was able to create the proxy class and config file using SvcUtil.exe AFTER doing modifications in the WSDL file. All the declaration for elements like (Salutation, AcademicTitle, FirstName,.....) there were no nameSpace being referred. And svcUtil was not able to find out where they belongs to. So I looked at the WSDL and found that these elements might be belongs to p1 namespace. So I modified them from type="Salutation" to type="p1:Salutation". After doing the modification I was able to add a service reference to a console application.

    However, I was not able to consume this WSDL using "WCF Service consuming wizard" and I got
    "Error consuming WCF service metadata. A type with the name 'orderExport' already exists.  A type must have a unique name leveling its namespace."
    I again checked the WSDL and I see tha portType and message are given same name as "orderExport". And as per http://msdn.microsoft.com/en-us/library/ms996486.aspx#understand_topic5 "Each portType must be given a unique name making it possible to refer to it from elsewhere in the WSDL definition"

    So I changed the name of portType from orderExport to orderExportType and then I was able to run WCF service consuming wizard successfully. I have sent you the WSDL file, please check if it works now.

    But I must say that this WSDL does not seems to as per W3C standards.

    All the best!!!

     

     

     

    Thursday, June 11, 2009 2:40 PM