简体   繁体   English

WSDL中对xsd:decimal的限制

[英]Restrictions for xsd:decimal in WSDL

We are creating a SOAP Web Service using WCF, to be consumed by SAP. 我们正在使用WCF创建SOAP Web服务,以供SAP使用。
From the SAP side they are asking that we specify restrictions for the decimal values in the XSD types declaration inside the WSDL. 从SAP方面,他们要求我们在WSDL的XSD类型声明中为十进制值指定限制。 The problem is that WCF generates the Web Service without restrictions, and I don't know how to tell WCF to generate these restrictions (with attributes or something similar). 问题在于WCF可以无限制地生成Web服务,而且我不知道如何告诉WCF生成这些限制(具有属性或类似属性)。
We want the xsd types to look like this: 我们希望xsd类型看起来像这样:

    <xsd:simpleType name="LpgPorcType">
        <xsd:restriction base="xsd:decimal">
                  <xsd:totalDigits value="5" />
                  <xsd:fractionDigits value="2" />
        </xsd:restriction>
    </xsd:simpleType>

Instead of this, the values in the WSDL are mapped directly to xsd:decimal 取而代之的是,WSDL中的值直接映射到xsd:decimal
Is there any way to indicate to WCF that I need these restrictions (without manually editting the WSDL file)? 有什么方法可以向WCF指示我需要这些限制(无需手动编辑WSDL文件)吗?
Thanks 谢谢

WCF does not support emitting this kind of restriction. WCF不支持发出这种限制。 You could put it yourself into the WSDL using IWSDLExportExtension . 您可以使用IWSDLExportExtension将其自己放入WSDL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM