问题
I'm new to web service : I have an attribute of type decimal
and of use optional:
Here's my WSDL:
<xsd:attribute name="taxes" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:totalDigits value="9" />
<xsd:fractionDigits value="2" />
<xsd:maxInclusive value="9999999.99" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
I want to set this attribute, the problem that its value is not modified, when I change use attribute to required the value is changed.
Here' the code :
public partial class CreationFacturationWS : System.Web.UI.Page
{
public string clientID;
protected void Page_Load(object sender, EventArgs e)
{
string clientID = GetClientID("http://*******/axis2/services/****/");
}
public static string GetClientID(string url)
{
//Srd.reponseDisponibiliteReponse[] response = null;
Srd.wsboif service = new Srd.wsboif();
//l'url du service
service.Url = url;
//temps d'attente maximal de la réponse (ms)
service.Timeout = 10000;
demandeCommande depotDeCommande = new demandeCommande();
//Avec Frais de port inclus
//2 produits dans la commande
depotDeCommande.montantPaiementGlobal = 32.48M;// decimal and required ---> works
depotDeCommande.taxes = 7.5M;//
....
}
}
来源:https://stackoverflow.com/questions/17729502/web-service-decimal-attribute-value-cant-be-set