none
Importing WSDL with WS-Security using SvcUtil fails with policy related warning RRS feed

  • Question

  • Hi everyone,

    I have a serious problem generating the proxy classes for a SOAP service, which uses WS-Security and referenced XSDs. The service uses  WS-Security UsernameToken Profile 1.0. I know that WCF does not support this anymore and I already found a workaround for this.

    I know that for WS-Security to work I have to use SvcUtil to generate the proxy classes, but when I do that from local WSDL and XSD files by calling:

    svcutil /l:C# *.wsdl *.xsd

    I get the following Output:

    Microsoft (R) Service Model Metadata Tool
    [Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.17929]
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    Warning: The policy expression was not fully imported because its normalized for
    m was too large.
    XPath:"XPath Unavailable"
    
    
    
    Error: Cannot import wsdl:binding
    Detail: Object reference not set to an instance of an object.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://app.example.com/']/wsdl:binding[@name='MyPortBinding']
    
    
    Error: 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://app.example.com/']/wsdl:binding[@name='MyPortBinding']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://app.example.com/']/wsdl:service[@name='MyService']/wsdl:port[@name='MyPort']
    
    
    Generating files...
    E:\Subversion\Service\MyCoreService.cs

    The resulting Proxy is useless, since no endpoint was generated. I also tried using XmlSerializer, the result keeps the same.

    The output above is from SvcUtil from .Net Framework 4.5, but I also tried it using the one from .Net Framework 3.5 with same results.

    I already searched the web for days to find a solution, but no luck until now. I hope someone will be able to help me with this.

    Regards,

    Bastian



    • Edited by Bastian Noffer Sunday, February 3, 2013 11:03 AM Error in thread title
    Sunday, February 3, 2013 10:48 AM

All replies

  • Hi, which binding are you using? I suspect you have used something that do not supported by svcutil.

    A bug here? http://support.microsoft.com/kb/951111

    Tuesday, February 5, 2013 8:53 AM