Specified Field Biztalk Web Services Publish Wizzard

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Specified Field Biztalk Web Services Publish Wizzard

Viewing 1 reply thread
  • Author
    Posts
    • #18375

      Hello,

       I have a schema with a boolean field called xpto, this field is used in a schema, used in some transforms and orchestrations.

      When I use Biztalk Web Services Publish Wizzard this field xpto appears as a bollean, but it appears also another field called xptoSpecified (a boolean too).

      This cause me some problems, for example, when I fill xpto with some value this value doesn’t arrive to orchestration. I found a solution, I edit the datatypes.cs file (in the output directory of the Biztalk Web Services Publish Wizzard .\App_Code) search for “specified” and found a declaration:

      private bool xptoFieldSpecified; 

      and another one:

      /// <remarks/>
      [System.Xml.Serialization.XmlIgnoreAttribute()]
      public bool ExisteERPSpecified
              {
                  get
                  {
                      return this.existeERPFieldSpecified;
                  }
                  set
                  {
                      this.existeERPFieldSpecified = value;
                  }
              }

      If I comment this two the problem is solved, until the next time I use Biztalk Web Service Publish Wizzard to deploy this project again.  Don’t forget to comment [System.Xml.Serialization.XmlIgnoreAttribute()] too.

       Does anyone know why this happens? Does anyone had this problem before?

    • #18376

      Update:

      I just discovered that this only happens with bollean fields, I found more fields with this problem. 

      • #18377

        Another Update:

         I just found this in MSDN:

         The XML Schema Definition Tool (Xsd.exe) occasionally generates the XmlIgnoreAttribute when creating classes from a schema file (.xsd). This behavior occurs because value types cannot be set to a null reference (Nothing
        in Visual Basic), but all XML data types can be. Therefore, the tool
        creates two fields when it encounters an XML type that maps to a value
        type: one to hold the value and another special field that takes the
        form of fieldnameSpecified, where the fieldname
        is replaced by the name of the field or property. Notice, however, that
        this special field is generated only when the schema specifies that the
        element has no minimum occurrence (minOccurs = “0”) and that the
        element has no default value.

        Here is my answer… I have a bollean with  minOccurs = “0”. This is the origin of the problem. I just don’t understant why the specified field appear on the interface of my WebService!!! And why the value of the xpto field is not being passed to the orchestration when filled with some value.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.