2

Hi I have an XSD file that explain what are the required fields i have to use.

Using that XSD schema, I have to Build and XML Request and route to a third party service provider and once my XML request is validated, system (third-party) will return a response and Again I have to read that XML response and do rest of the Logic implementation.

I have no clue where to start with building XML using this XSD

Can any one point me to a right place or provide some sort of examples that i can use to build XML using XSD

Here is part of my XSD

    <?xml version="1.0" encoding="utf-8"?>
   <xs:schema xmlns="http://www.ncpdp.org/schema/SCRIPT" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ncpdp.org/schema/SCRIPT" elementFormDefault="qualified">
        <!-- Message -->
        <xs:element name="Message" type="MessageType"/>
<xs:element name="RxHistoryRequest">
        <xs:complexType>
            <xs:sequence>
                <xs:annotation>
                    <xs:documentation>UIH-020</xs:documentation>
                    <xs:documentation>UIH-030-1</xs:documentation>
                    <xs:documentation>PVD-P2</xs:documentation>
                </xs:annotation>
                <xs:element ref="RxReferenceNumber" minOccurs="0"/>
                <!--UIH.2.1-->
                <xs:element ref="PrescriberOrderNumber" minOccurs="0"/>
                <!--UIH.3.1-->
                <xs:element name="Pharmacy" type="OptionalPharmacyType" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>PVD-P2</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--PVD-->
                <xs:element name="Prescriber" type="OptionalPrescriberType">
                    <xs:annotation>
                        <xs:documentation>PVD-PC</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--PVD-->
                <xs:element name="Patient" type="HistoryRequestPatientType">
                    <xs:annotation>
                        <xs:documentation>PTT</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--PTT-->
                <xs:element name="BenefitsCoordination" type="BenefitsCoordinationRequestType" maxOccurs="3">
                    <xs:annotation>
                        <xs:documentation>COO</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--COO-->
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="RxHistoryResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:annotation>
                    <xs:documentation>UIH-020</xs:documentation>
                    <xs:documentation>UIH-030-1</xs:documentation>
                    <xs:documentation>PVD-P2</xs:documentation>
                </xs:annotation>
                <xs:element ref="RxReferenceNumber" minOccurs="0"/>
                <!--UIH.2.1-->
                <xs:element ref="PrescriberOrderNumber" minOccurs="0"/>
                <!--UIH.3.1-->
                <xs:element name="Response" type="HistoryResponseType">
                    <xs:annotation>
                        <xs:documentation>RES</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--RES-->
                <xs:element name="Pharmacy" type="OptionalPharmacyType" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>PVD-P2</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--PVD-->
                <xs:element name="Prescriber" type="HistoryPrescriberType">
                    <xs:annotation>
                        <xs:documentation>PVD-PC</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--PVD-->
                <xs:element name="Patient" type="HistoryResponsePatientType">
                    <xs:annotation>
                        <xs:documentation>PTT</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--PTT-->
                <xs:element name="BenefitsCoordination" type="BenefitsCoordinationResponseType" maxOccurs="3">
                    <xs:annotation>
                        <xs:documentation>COO</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <!--COO-->
                <xs:choice minOccurs="0">
                    <xs:element name="MedicationDispensed" type="HistoryDispensedMedicationType" maxOccurs="300">
                        <xs:annotation>
                            <xs:documentation>DRU-D</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <!--DRU-->
                    <xs:element name="MedicationPrescribed" type="HistoryPrescribedMedicationType" maxOccurs="300">
                        <xs:annotation>
                            <xs:documentation>DRU-P</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <!--DRU-->
                </xs:choice>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
.
.
.
.
..
.
continues

using <xs:element name="RxHistoryRequest"> I have to Build XML and

using <xs:element name="RxHistoryResponse"> I have to Read the response

Thank you for your time for helping me with this.

HaBo
  • 13,999
  • 36
  • 114
  • 206

1 Answers1

0

You can use programs that can provied sample xml from that xsd. For instance Stylus Studio.

If you provide me the XSD I can make a sample XML for you

Jester
  • 3,069
  • 5
  • 30
  • 44
  • this should happen dynamically on web up on each user request i have to build a new XML request with that particular user values and send the Request – HaBo Mar 26 '12 at 21:47