Searching the Java RunTime for Vista 64-bit

I had a hard time finding the correct JRE for my Vista 64-bit installation. Apparantly it’s not on the Www.Java.Com site, at least I couldn’t find it on the downloads page, and don’t get me started on the automated detection/installation procedure at that site. I had more luck on the Sun-site, follow the path of downloads, category, Java, Java 2 Platform Standard Edition, Latest Release (in the top blue header part) for some reason it redirects me first to the Java 5 downloads, Java Runtime 6 update X and there on the bottom the 64-bit for Windows AMD.

BizTalk Web Service Publishing Wizard Error: Method not found: System.Xml.Serialization.XmlMapping.get_ElementName()

I was stunned, I had defined a Request schema and a Response schema to be used by a Web Service I wanted to implement in BizTalk 2004. The Request schema was straightforward, just some fields which made up a Service Request. The response would be a collection of 0 to N “Records”.

I had the Response Schema defined somewhere around the lines of this:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://BizTalk_Webservice_Publishing_issue.Schema2"
  xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
  targetNamespace="http://BizTalk_Webservice_Publishing_issue.Schema2"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Root">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Record">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Field1" type="xs:string" />
              <xs:element name="Field2" type="xs:string" />
              <xs:element name="Field3" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Looks sensible right? It compiles okay, I can make an Orchestration with a Request-Response port, everything looks fine, until the Web Service Publishing Wizard gives me:

Failed to create project http://localhost/BizTalk_Webservice_Publishing_issue_Proxy.
[Microsoft.BizTalk.WebServices.PublishingException] Failed to construct code for schema "http://BizTalk_Webservice_Publishing_issue.Schema2".
Method not found: System.String System.Xml.Serialization.XmlMapping.get_ElementName().
I didn't get it, what was wrong? After searching the internet (in which I obviously found one of [Patrick's blogpost](http://bloggingabout.net/blogs/wellink/archive/2007/05/22/solving-the-microsoft-biztalk-webservices-publishingexception-with-imported-schema-s.aspx) which didn't help in this case as I had no imported schema's) I began some experiments. I determined that the cause lies in the multiplicity on the **Record** element. It didn't matter what values I used, as soon as the schema allowed more than one **Record** element to be a part of the message, the Wizard failed on me. I don't remember how I got the idea, but the solution is rather simple. It appears that the Wizard doesn't like the multiplicity _on the **element**_. So, let's put the multiplicity one level higher, **_around_** the element, like this:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://BizTalk_Webservice_Publishing_issue.Schema2"
  xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
  targetNamespace="http://BizTalk_Webservice_Publishing_issue.Schema2"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Root">
    <xs:complexType>
      <xs:sequence>
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
          <xs:element name="Record">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Field1" type="xs:string" />
                <xs:element name="Field2" type="xs:string" />
                <xs:element name="Field3" type="xs:string" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

So after encapsulating the Record element in a Sequence on which I added the multiplicity, all was well. I don’t think I fully understand why the Wizard (or XSD.exe which is running the show in the background) fails on the first version, but now I do know how to solve this.

Update: fixed the formatting of the XML Schema’s for readability.