Difference between revisions of "Development"
From Agility
(→Specifying minOccurs=0 for non-string fields in WSDL generated from C# Web service method) |
(→Pause script execution in chrome) |
||
| Line 31: | Line 31: | ||
1.In the console:, Run: | 1.In the console:, Run: | ||
| − | window.addEventListener('keydown', function(e) { | + | |
| + | <pre>window.addEventListener('keydown', function(e) { | ||
if (e.keyCode == 123) debugger; | if (e.keyCode == 123) debugger; | ||
}); | }); | ||
| + | </pre> | ||
2.Highlight element with inspector | 2.Highlight element with inspector | ||
| + | |||
3.Hit F12 | 3.Hit F12 | ||
| + | |||
4.You can now inspect the element, with JavaScript paused so the DOM won't change. | 4.You can now inspect the element, with JavaScript paused so the DOM won't change. | ||
Latest revision as of 14:45, 15 May 2017
Tips & Tricks
Specifying minOccurs=0 for non-string fields in WSDL generated from C# Web service method
If tthere is a need for Xml element to be optional for non-string field in generated WSDL, the field definition needs to be coupled with the XXXSpecified boolean field definition within the same class. To stop the logical field from being included in the WSDL, [XmlIgnore] attribute can be used. Example below:
/// <remarks/>
public Decimal? PurchaseCost
{
get
{
return this.purchaseCostField;
}
set
{
this.purchaseCostField = value;
}
}
// this has been provided to force WSDL generator to put minoccurs=0 into PurchaseCost element definition
[System.Xml.Serialization.XmlIgnore]
public bool PurchaseCostSpecified
{
get
{
return true;
}
}
Pause script execution in chrome
1.In the console:, Run:
window.addEventListener('keydown', function(e) {
if (e.keyCode == 123) debugger;
});
2.Highlight element with inspector
3.Hit F12
4.You can now inspect the element, with JavaScript paused so the DOM won't change.