unclecake2
Programmer
Hi, I have been given the task of adding and receiving message queue messages (MSMQ) using VB.NET. I have been working on this for a few days, and I just don't get it. I have been given 4 different XSD files, I will post two of them below.
I am told it should produce a result like this:
As well, I have another XSD like this:
Which should produce a result like this:
I am able to write and read a XML formatted message, but not with multiple elements. This is my first experience with XML. I don't totally understand simple and complex type.
If anyone could direct me to where I could find code examples or offer any help it would be appreciated. I am desperate.
-UC
Code:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="Retest" targetNamespace="[URL unfurl="true"]http://tempuri.org/Retest.xsd"[/URL] elementFormDefault="qualified"
xmlns="[URL unfurl="true"]http://tempuri.org/Retest.xsd"[/URL] xmlns:mstns="[URL unfurl="true"]http://tempuri.org/Retest.xsd"[/URL] xmlns:xs="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema">[/URL]
<xs:element name="retest">
<xs:complexType>
<xs:sequence />
</xs:complexType>
</xs:element>
</xs:schema>
I am told it should produce a result like this:
Code:
<retest />
As well, I have another XSD like this:
Code:
<?xml version="1.0" encoding="UTF-16" ?>
<xs:schema xmlns:xs="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="request">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="1">
<xs:element name="job" type="xs:string" minOccurs="1" />
</xs:sequence>
<xs:attribute name="bsn" use="required" type="xs:string"></xs:attribute>
<xs:attribute name="barcode" type="xs:string" use="required" />
<xs:attribute name="jobtype" type="xs:string" use="required" />
<xs:attribute name="jobtype" type="xs:string" use="required" />
<xs:attribute name="message" type="xs:string" use="required" />
<xs:attribute name="testmask" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:schema>
Which should produce a result like this:
Code:
<result>
<job bsn="1234567" barcode="D1234567X01" jobtype="driver" overallresult="pass"></job>
<tester name="tester1" lane="1" version="1.10"></tester>
<tests performed="2006-04-13 13:45:06" cycletime="76.3" faultcode="0001" faultmessage="helpful message">
<test name="continuity" result="pass" value="1" status="1" expectedvalue=”1” lowerlimit="" upperlimit="" units="" ></test>
<test name="straingage" result="pass" value="5.67" expectedvalue=”5.53” status="1" lowerlimit="4.23" upperlimit="6.21" units="volts"></test>
</tests>
</result>
I am able to write and read a XML formatted message, but not with multiple elements. This is my first experience with XML. I don't totally understand simple and complex type.
If anyone could direct me to where I could find code examples or offer any help it would be appreciated. I am desperate.
-UC