Generating XML output using XSD structure file in SQL Server - sql-server

I have a quite complex XSD structure file that is supposed to help us generate a report in XML, however the XSD is prone to change and one has to keep updating the base code. Wondering if there's any way to generate XML outputs using the xsd file itself?
The XSD has a lot of nested fields
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://-" " elementFormDefault="qualified" attributeFormDefault="unqualified" version="6-2">
<xs:include schemaLocation="--"/>
<xs:complexType name="Address_Structure">
<xs:choice>
<xs:element name="UnstructuredAddress" type="ns:UnstructuredAddress_Type"/>
<xs:element name="StructuredAddress" type="ns:StructuredAddress_Type" minOccurs="2" maxOccurs="5"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="ClinicalActivity_AE_Structure">
<xs:sequence>
<xs:element name="ClinicalActivityGroupOPCS" type="ns:ClinicalActivityGroupOPCS_Type" minOccurs="0"/>
<xs:element name="ClinicalActivityGroupREAD" type="ns:ClinicalActivityGroupREAD_Type" minOccurs="0"/>
<xs:element name="ClinicalTreatmentGroupAandE" type="ns:ClinicalTreatmentGroupAAndE_Type" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ClinicalActivity_Structure">
<xs:sequence>
<xs:element name="ClinicalActivityGroupOPCS" type="ns:ClinicalActivityGroupOPCS_Type" minOccurs="0"/>
<xs:element name="ClinicalActivityGroupREAD" type="ns:ClinicalActivityGroupREAD_Type" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ClinicalActivityGroupOPCS_Type">
<xs:sequence>
<xs:element name="ProcedureSchemeInUse" type="ns:ProcedureSchemeInUse_Type"/>
<xs:element name="PrimaryProcedureGroupOPCS">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element name="PrimaryProcedure_OPCS" type="ns:PrimaryProcedure_OPCS_Type"/>
<xs:element name="ProcedureDate" type="ns:ProcedureDate_Type" minOccurs="0"/>
<xs:element name="MainOperatingHCP" type="ns:ProfessionalsInvolved_Structure" minOccurs="0"/>
<xs:element name="ResponsibleAnaesthetist" type="ns:ProfessionalsInvolved_Structure" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SecondaryProcedureGroupOPCS" minOccurs="0" maxOccurs="unbounded">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element name="SecondaryProcedure_OPCS" type="ns:Procedure_OPCS_Type"/>
<xs:element name="ProcedureDate" type="ns:ProcedureDate_Type" minOccurs="0"/>
<xs:element name="MainOperatingHCP" type="ns:ProfessionalsInvolved_Structure" minOccurs="0"/>
<xs:element name="ResponsibleAnaesthetist" type="ns:ProfessionalsInvolved_Structure" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

Related

Using SQLXML Bulk Import with complicated schema

I'm trying to figure out how to use SQLXML bulk load for a rather complicated XML schema I have no control over (It's nominally a "standard"). A small example would be:
<RootElement>
<id root="e5404218-250a-4454-98d5-f9feee8a3589" />
<code code="93000" />
<time>
<low value="20140221095400.000" />
<high value="20140221095410.000" />
</time>
</RootElement>
With an AXSD schema of:
<?xml version="1.0"?>
<xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xs:element name="RootElement" sql:relation="re" >
<xs:complexType>
<xs:sequence>
<xs:element name="id" maxOccurs="1" minOccurs="1">
<xs:complexType>
<xs:attribute name="root" type="xs:ID" sql:field="id" sql:identity="useValue"/>
</xs:complexType>
</xs:element>
<xs:element name="code" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:attribute name="code" type="xs:long"/>
</xs:complexType>
</xs:element>
<xs:element name="time" type="timeRange"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="timeRange">
<xs:choice>
<xs:sequence>
<xs:element name="low">
<xs:complexType>
<xs:attribute name="value" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:sequence>
<xs:element name="high">
<xs:complexType>
<xs:attribute name="value" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:choice>
</xs:complexType>
</xs:schema>
My sticking point seems to come from the ID being attached to an attribute on an element, instead of an element value, as no matter what tweaks I use, I get the error Schema: relationship expected on 'id'.. There really is no relationship there, it's just a container, since the committee that designed this schema seems to have really taken a liking to attributes.
All examples I find deal with the values being element content instead of attributes. This includes decorating the element with sql:is-constant (Constant element cannot have attributes), and various permutations of the sql:relation element.
The only option I could think of is to have a pre-processing step that makes attributes child elements, and base the schema on that, but that seems kind of hacky.
Any suggestions on how to convince SQLXML to do my bidding?

Generate from WSDL is failing

I am trying to generate Apex class from WSDL file but I am getting below error:
Apex Generation Failed
Unable to find schema for element; {http://www.w3.org/2001/XMLSchema}string
Any help on this is much appreciated.
Thanks in advance
See below WSDL file:
<?xml version="1.0" encoding="UTF-8"?>
<!--Created by TIBCO WSDL-->
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.example.com/1393912810519" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns0="http://www.tibco.com/schemas/vendorInterface/SharedResource/Schema/Schema.xsd2" xmlns:ns1="http://www.tibco.com/schemas/vendorInterface/SharedResource/Schema/Schema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Untitled" targetNamespace="http://xmlns.example.com/1393912810519">
<wsdl:types>
<xs:schema xmlns="http://www.tibco.com/schemas/vendorInterface/SharedResource/Schema/Schema.xsd" targetNamespace="http://www.tibco.com/schemas/vendorInterface/SharedResource/Schema/Schema.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="VendorInterface">
<xs:complexType>
<xs:sequence>
<xs:element name="Vendor_main">
<xs:complexType>
<xs:sequence>
<xs:element name="LIFNR" type="xs:string"/>
<xs:element name="NAME1" type="xs:string"/>
<xs:element name="SORTL" type="xs:string"/>
<xs:element name="BUS_TYPE" type="xs:string"/>
<xs:element name="ROUTE_CODE" type="xs:string"/>
<xs:element name="VESTYR" type="xs:string" minOccurs="0"/>
<xs:element name="VESTYB" type="xs:string"/>
<xs:element name="ZTERM" type="xs:string"/>
<xs:element name="ZWELS" type="xs:string"/>
<xs:element name="SPERM" type="xs:string"/>
<xs:element name="REPRF" type="xs:string"/>
<xs:element name="WAERS" type="xs:string"/>
<xs:element name="ZAHLS" type="xs:string"/>
<xs:element name="SPRAS" type="xs:string"/>
<xs:element name="ZZ_ACTION" type="xs:string"/>
<xs:element name="STATUS" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Vendor_User">
<xs:complexType>
<xs:sequence>
<xs:element name="LIFNR" type="xs:string"/>
<xs:element name="NAME1" type="xs:string"/>
<xs:element name="NAME2" type="xs:string" minOccurs="0"/>
<xs:element name="ZZ_ACTION" type="xs:string"/>
<xs:element name="STATUS" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Vendor_Tax">
<xs:complexType>
<xs:sequence>
<xs:element name="LIFNR" type="xs:string"/>
<xs:element name="LAND1" type="xs:string"/>
<xs:element name="STCEG" type="xs:string" minOccurs="0"/>
<xs:element name="ITTXAC" type="xs:string"/>
<xs:element name="STENR" type="xs:string"/>
<xs:element name="ITRCVR" type="xs:string"/>
<xs:element name="ZZ_ACTION" type="xs:string"/>
<xs:element name="STATUS" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Vendor_Address">
<xs:complexType>
<xs:sequence>
<xs:element name="LIFNR" type="xs:string"/>
<xs:element name="VASTYP" type="xs:string"/>
<xs:element name="VABFRT" type="xs:string"/>
<xs:element name="STREET1" type="xs:string"/>
<xs:element name="STREET2" type="xs:string"/>
<xs:element name="STREET3" type="xs:string"/>
<xs:element name="STREET4" type="xs:string"/>
<xs:element name="ORT01" type="xs:string"/>
<xs:element name="LAND1" type="xs:string"/>
<xs:element name="WAERS" type="xs:string"/>
<xs:element name="SPRAS" type="xs:string"/>
<xs:element name="PSTLZ" type="xs:string"/>
<xs:element name="SMTP_ADDR" type="xs:string"/>
<xs:element name="KOINH" type="xs:string"/>
<xs:element name="INTAD" type="xs:string"/>
<xs:element name="ZZ_ACTION" type="xs:string"/>
<xs:element name="STATUS" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Vendor_Paymen_Methods">
<xs:complexType>
<xs:sequence>
<xs:element name="LIFNR" type="xs:string"/>
<xs:element name="ZWELS" type="xs:string"/>
<xs:element name="KOINH" type="xs:string"/>
<xs:element name="REMARK" type="xs:string"/>
<xs:element name="BANKA" type="xs:string"/>
<xs:element name="ZZ_ACTION" type="xs:string"/>
<xs:element name="STATUS" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Vendor_ContactPerson">
<xs:complexType>
<xs:sequence>
<xs:element name="LIFNR" type="xs:string"/>
<xs:element name="CNTTYP" type="xs:string"/>
<xs:element name="NAMEV" type="xs:string"/>
<xs:element name="NAME1" type="xs:string"/>
<xs:element name="CNSTYP" type="xs:string"/>
<xs:element name="TEL_NUMBER" type="xs:string"/>
<xs:element name="TEL_EXTENS" type="xs:string"/>
<xs:element name="FAX_NUMBER" type="xs:string"/>
<xs:element name="TEL_NUMBER2" type="xs:string"/>
<xs:element name="TEL_EXTENS2" type="xs:string"/>
<xs:element name="FAX_NUMBER2" type="xs:string"/>
<xs:element name="ZZ_ACTION" type="xs:string"/>
<xs:element name="STATUS" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema xmlns="http://www.tibco.com/schemas/vendorInterface/SharedResource/Schema/Schema.xsd2" targetNamespace="http://www.tibco.com/schemas/vendorInterface/SharedResource/Schema/Schema.xsd2" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="VendorDetails" type="xs:string"/>
</xs:schema>
</wsdl:types>
<wsdl:service name="VendorInterface">
<wsdl:port name="VendorInfoEndpoint" binding="tns:VendorInfoEndpointBinding">
<soap:address location="http://localhost:8050/BusinessProcess/InterfaceImplementation/VendorInterface.serviceagent/VendorInfoEndpoint"/>
</wsdl:port>
</wsdl:service>
<wsdl:portType name="PortType">
<wsdl:operation name="GetVendorInfo">
<wsdl:input message="tns:GetVendorInfo_Request"/>
<wsdl:output message="tns:GetVendorInfo_Respone"/>
<wsdl:fault name="fault1" message="tns:GetVendorInfo_Fault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="VendorInfoEndpointBinding" type="tns:PortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetVendorInfo">
<soap:operation style="document" soapAction="/BusinessProcess/InterfaceImplementation/VendorInterface.serviceagent/VendorInfoEndpoint/GetVendorInfo"/>
<wsdl:input>
<soap:body use="literal" parts="Request"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" parts="Response"/>
</wsdl:output>
<wsdl:fault name="fault1">
<soap:fault use="literal" name="fault1"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:message name="GetVendorInfo_Request">
<wsdl:part name="Request" element="ns0:VendorDetails"/>
</wsdl:message>
<wsdl:message name="GetVendorInfo_Respone">
<wsdl:part name="Response" element="ns1:VendorInterface"/>
</wsdl:message>
<wsdl:message name="GetVendorInfo_Fault">
<wsdl:part name="fault" type="xs:string"/>
</wsdl:message>
</wsdl:definitions>
The type for GetVendorInfo_Request. This has:
<xs:element name="VendorDetails" type="xs:string"/>
Wsdl2Apex doesn't support direct single-standard type requests or responses. Instead it would need to be nested in a complex type within a sequence. E.g.
<xs:schema xmlns="http://www.tibco.com/schemas/vendorInterface/SharedResource/Schema/Schema.xsd2" targetNamespace="http://www.tibco.com/schemas/vendorInterface/SharedResource/Schema/Schema.xsd2" elementFormDefault="qualified" attributeFormDefault="unqualified">
<!--
This isn't supported by wsdl2Apex
<xs:element name="VendorDetails" type="xs:string"/>
-->
<xs:element name="VendorDetails">
<xs:complexType>
<xs:sequence>
<xs:element name="inputParam" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
If you are unable to modify the WSDL then you can make the request directly using an HttpRequest by building up the required Soap XML payload yourself. I've been working with an intern on a tool to automate this. Unfortunately it doesn't directly support single standard type requests/responses yet either. If you are interested, see WSDL Parser and Apex Generator (Disclaimer: I work for the company that creates this tool. It is free).
See also: WSDL2APEX Parse error - Unable to find schema for element; {http://www.w3.org/2001/XMLSchema}string

Camel Validator return entire message

I have a route,
<from uri="a">
<to uri="validator:schema.xsd">
<to uri="b">
Say the XML file being validated is missing two elements, the validator seems to stop once it finds the first missing element and returns a message saying it was missing.
Is it possible to carry on validating the XML file to look for any other missing elements and return that in the error message so the sender doesn't have to keep sending to find out which elements are missing or invalid?
Validator component throws SchemaValidationException, if validation fails. This exception contains method getError() returning List<org.xml.sax.SAXParseException>.
You can use this to transform message to List<org.xml.sax.SAXParseException> in onException block.
Following code catches SchemaValidationException, transforms body to SchemaValidationException.getErrors() and marks exception as continued, to continue routing and return this list on output route.
from("timer:simple?period=1000")
.setBody(constant(XML_INVALID))
.to("direct:a");
from("direct:a")
.onException(SchemaValidationException.class)
.to("direct:validationErrors")
.continued(true)
.end()
.to("validator:test.xsd")
.to("log:result");
from("direct:validationErrors")
.setBody(simple("${property.CamelExceptionCaught.errors}"))
.end();
Note: This example was tested with following resources
XML_INVALID
<?xml version="1.0" encoding="utf-8"?>
<shiporder orderid="str1234">
<orderperson>str1234</orderperson>
<shipto>
<name>str1234</name>
<address>str1234</address>
</shipto>
<item>
<quantity>745</quantity>
<price>123.45</price>
</item>
</shiporder>
test.xsd copied from w3schools.com
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- definition of simple elements -->
<xs:element name="orderperson" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
<xs:element name="title" type="xs:string"/>
<xs:element name="note" type="xs:string"/>
<xs:element name="quantity" type="xs:positiveInteger"/>
<xs:element name="price" type="xs:decimal"/>
<!-- definition of attributes -->
<xs:attribute name="orderid" type="xs:string"/>
<!-- definition of complex elements -->
<xs:element name="shipto">
<xs:complexType>
<xs:sequence>
<xs:element ref="name"/>
<xs:element ref="address"/>
<xs:element ref="city"/>
<xs:element ref="country"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="item">
<xs:complexType>
<xs:sequence>
<xs:element ref="title"/>
<xs:element ref="note" minOccurs="0"/>
<xs:element ref="quantity"/>
<xs:element ref="price"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="shiporder">
<xs:complexType>
<xs:sequence>
<xs:element ref="orderperson"/>
<xs:element ref="shipto"/>
<xs:element ref="item" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute ref="orderid" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>

Having trouble with an XML file and SQL Server 2008 SSIS

I'm trying to use SQL Server 2008 SSIS to read an XML file and put it into a database, but I'm having problems. Everything is green when I run debugging, but no data is actually transferred. Even when a make a simple XML Source -> Flat File output, the flat file is blank after being created.
I'm using the inline schema, but even if I remove the schema SSIS can't generate an XSD file.
Here's the XML:
<?xml version="1.0" encoding="utf-16"?>
<DataSet>
<xs:schema id="Schedule_x0020_Set" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Schedule_x0020_Set" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Schedule_x0020_Table">
<xs:complexType>
<xs:sequence>
<xs:element name="ScheduleDate" type="xs:string" minOccurs="0" />
<xs:element name="StaffLName" type="xs:string" minOccurs="0" />
<xs:element name="StaffFName" type="xs:string" minOccurs="0" />
<xs:element name="TaskName" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<Schedule_x0020_Set>
<Schedule_x0020_Table diffgr:id="Schedule Table1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
<ScheduleDate>1/24/2011</ScheduleDate>
<StaffLName>Smith</StaffLName>
<StaffFName>Josh</StaffFName>
<TaskName>Day Shift</TaskName>
</Schedule_x0020_Table>
<Schedule_x0020_Table diffgr:id="Schedule Table2" msdata:rowOrder="1" diffgr:hasChanges="inserted">
<ScheduleDate>1/24/2011</ScheduleDate>
<StaffLName>Doe</StaffLName>
<StaffFName>Jane</StaffFName>
<TaskName>Night Shift</TaskName>
</Schedule_x0020_Table>
<Schedule_x0020_Table diffgr:id="Schedule Table3" msdata:rowOrder="2" diffgr:hasChanges="inserted">
<ScheduleDate>1/24/2011</ScheduleDate>
<StaffLName>Johnson</StaffLName>
<StaffFName>Barbara</StaffFName>
<TaskName>Off</TaskName>
</Schedule_x0020_Table>
</Schedule_x0020_Set>
</diffgr:diffgram>
</DataSet>
I had to use the following file to get it to work. It only began to work when I changed the schema AND removed the diffgr stuff. Hope this helps.
<DataSet>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="DataSet">
<xs:complexType>
<xs:sequence>
<xs:element ref="Schedule_x0020_Set"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Schedule_x0020_Set">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Schedule_x0020_Table"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Schedule_x0020_Table">
<xs:complexType>
<xs:sequence>
<xs:element ref="ScheduleDate"/>
<xs:element ref="StaffLName"/>
<xs:element ref="StaffFName"/>
<xs:element ref="TaskName"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ScheduleDate" type="xs:string"/>
<xs:element name="StaffLName" type="xs:NCName"/>
<xs:element name="StaffFName" type="xs:NCName"/>
<xs:element name="TaskName" type="xs:string"/>
</xs:schema>
<Schedule_x0020_Set>
<Schedule_x0020_Table>
<ScheduleDate>1/24/2011</ScheduleDate>
<StaffLName>Smith</StaffLName>
<StaffFName>Josh</StaffFName>
<TaskName>Day Shift</TaskName>
</Schedule_x0020_Table>
<Schedule_x0020_Table>
<ScheduleDate>1/24/2011</ScheduleDate>
<StaffLName>Doe</StaffLName>
<StaffFName>Jane</StaffFName>
<TaskName>Night Shift</TaskName>
</Schedule_x0020_Table>
<Schedule_x0020_Table>
<ScheduleDate>1/24/2011</ScheduleDate>
<StaffLName>Johnson</StaffLName>
<StaffFName>Barbara</StaffFName>
<TaskName>Off</TaskName>
</Schedule_x0020_Table>
</Schedule_x0020_Set>
</DataSet>

loading xml into SQL Server 2008 using sqlbulkload component

"Error: Schema: relationship expected on 'headerRecord'."
I get the above error while load xml file to SQL Server 2008 using SQLXMLBulkLoad4 Component , the xml file contains Call Detail records, I have generated schema file from xml file using both , Dataset and XSD.exe tool, but the error remains same., if there is another way to imports xml file with multiple tables that have relationship in each file into SQL Server 2008? .
Here the xml file:
<CallEventDataFile>
<headerRecord>
<productionDateTime>0912021247482B0300</productionDateTime>
<recordingEntity>00</recordingEntity>
<extensions/>
</headerRecord>
<callEventRecords>
<mtSMSRecord>
<recordType>7</recordType>
<serviceCentre>91521230</serviceCentre>
<servedIMSI>36570000031728F2</servedIMSI>
<servedIMEI>53886000707896F0</servedIMEI>
<servedMSISDN>915212454503F2</servedMSISDN>
<msClassmark>3319A1</msClassmark>
<recordingEntity>915212110100</recordingEntity>
<location>
<locationAreaCode>0006</locationAreaCode>
<cellIdentifier>0C6E</cellIdentifier>
</location>
<deliveryTime>0912021535412B0300</deliveryTime>
<systemType>
<gERAN/>
</systemType>
<basicService>
<teleservice>21</teleservice>
</basicService>
<additionalChgInfo>
<chargeIndicator>2</chargeIndicator>
</additionalChgInfo>
<chargedParty>
<calledParty/>
</chargedParty>
<orgRNCorBSCId>8E1A</orgRNCorBSCId>
<orgMSCId>921A</orgMSCId>
<globalAreaID>36F70500060C6E</globalAreaID>
<subscriberCategory>0A</subscriberCategory>
<firstmccmnc>36F705</firstmccmnc>
<smsUserDataType>FF</smsUserDataType>
<origination>8191F2</origination>
<callReference>1605EB2FE1</callReference>
</mtSMSRecord>
<moSMSRecord>
<recordType>6</recordType>
<servedIMSI>36570000238707F9</servedIMSI>
<servedIMEI>53928320195925F0</servedIMEI>
<servedMSISDN>915212159430F2</servedMSISDN>
<msClassmark>3319A2</msClassmark>
<serviceCentre>91521230</serviceCentre>
<recordingEntity>915212110100</recordingEntity>
<location>
<locationAreaCode>001B</locationAreaCode>
<cellIdentifier>6983</cellIdentifier>
</location>
<messageReference>01</messageReference>
<originationTime>0912021535412B0300</originationTime>
<destinationNumber>8111F1</destinationNumber>
<systemType>
<gERAN/>
</systemType>
<basicService>
<teleservice>22</teleservice>
</basicService>
<additionalChgInfo>
<chargeIndicator>2</chargeIndicator>
</additionalChgInfo>
<chargedParty>
<callingParty/>
</chargedParty>
<orgRNCorBSCId>8F1A</orgRNCorBSCId>
<orgMSCId>921A</orgMSCId>
<globalAreaID>36F705001B6983</globalAreaID>
<subscriberCategory>0A</subscriberCategory>
<firstmccmnc>36F705</firstmccmnc>
<smsUserDataType>FF</smsUserDataType>
<callReference>1701BED4FF</callReference>
</moSMSRecord>
<ssActionRecord>
<recordType>10</recordType>
<servedIMSI>36570000636448F8</servedIMSI>
<servedIMEI>53246030714961F0</servedIMEI>
<servedMSISDN>915212056928F8</servedMSISDN>
<msClassmark>3018A1</msClassmark>
<recordingEntity>915212110100</recordingEntity>
<location>
<locationAreaCode>000C</locationAreaCode>
<cellIdentifier>05A5</cellIdentifier>
</location>
<supplService>FF</supplService>
<ssAction>
<ussdInvocation/>
</ssAction>
<ssActionTime>0912021535412B0300</ssActionTime>
<ssParameters>
<unstructuredData>AA5C2E3702</unstructuredData>
</ssParameters>
<callReference>1701BED500</callReference>
<systemType>
<gERAN/>
</systemType>
<ussdCodingScheme>0F</ussdCodingScheme>
<ussdString>
<UssdString>AA5C2E3702</UssdString>
</ussdString>
<ussdRequestCounter>1</ussdRequestCounter>
<additionalChgInfo>
<chargeIndicator>1</chargeIndicator>
</additionalChgInfo>
<orgRNCorBSCId>8E1A</orgRNCorBSCId>
<orgMSCId>921A</orgMSCId>
<globalAreaID>36F705000C05A5</globalAreaID>
<subscriberCategory>0A</subscriberCategory>
<firstmccmnc>36F705</firstmccmnc>
</ssActionRecord>
<moCallRecord>
<recordType>0</recordType>
<servedIMSI>36570000807501F5</servedIMSI>
<servedIMEI>53246030713955F0</servedIMEI>
<servedMSISDN>915212157901F0</servedMSISDN>
<callingNumber>A151911700</callingNumber>
<calledNumber>8151677589</calledNumber>
<roamingNumber>A111113850</roamingNumber>
<recordingEntity>915212110100</recordingEntity>
<mscIncomingROUTE>
<rOUTEName>HWBSC2</rOUTEName>
</mscIncomingROUTE>
<mscOutgoingROUTE>
<rOUTEName>HWBSC2</rOUTEName>
</mscOutgoingROUTE>
<location>
<locationAreaCode>0006</locationAreaCode>
<cellIdentifier>0C2F</cellIdentifier>
</location>
<basicService>
<teleservice>11</teleservice>
</basicService>
<msClassmark>3319A1</msClassmark>
<answerTime>0912021535382B0300</answerTime>
<releaseTime>0912021535422B0300</releaseTime>
<callDuration>4</callDuration>
<radioChanRequested>
<dualFullRatePreferred/>
</radioChanRequested>
<radioChanUsed>
<halfRate/>
</radioChanUsed>
<causeForTerm>0</causeForTerm>
<diagnostics>
<gsm0408Cause>144</gsm0408Cause>
</diagnostics>
<callReference>1701BED501</callReference>
<additionalChgInfo>
<chargeIndicator>2</chargeIndicator>
</additionalChgInfo>
<gsm-SCFAddress>915212110130</gsm-SCFAddress>
<serviceKey>1</serviceKey>
<networkCallReference>171D555132</networkCallReference>
<mSCAddress>915212110100</mSCAddress>
<speechVersionSupported>25</speechVersionSupported>
<speechVersionUsed>21</speechVersionUsed>
<numberOfDPEncountered>3</numberOfDPEncountered>
<levelOfCAMELService>01</levelOfCAMELService>
<freeFormatData>800130</freeFormatData>
<systemType>
<gERAN/>
</systemType>
<classmark3>C000</classmark3>
<chargedParty>
<callingParty/>
</chargedParty>
<mscOutgoingCircuit>1051</mscOutgoingCircuit>
<orgRNCorBSCId>8E1A</orgRNCorBSCId>
<orgMSCId>921A</orgMSCId>
<calledIMSI>36570000635618F8</calledIMSI>
<globalAreaID>36F70500060C2F</globalAreaID>
<subscriberCategory>0A</subscriberCategory>
<firstmccmnc>36F705</firstmccmnc>
<lastmccmnc>36F705</lastmccmnc>
</moCallRecord>
<mtCallRecord>
<recordType>1</recordType>
<servedIMSI>36570000635618F8</servedIMSI>
<servedIMEI>53464010474309F0</servedIMEI>
<servedMSISDN>915212755697F8</servedMSISDN>
<callingNumber>A151911700</callingNumber>
<recordingEntity>915212110100</recordingEntity>
<mscIncomingROUTE>
<rOUTEName>HWBSC2</rOUTEName>
</mscIncomingROUTE>
<mscOutgoingROUTE>
<rOUTEName>HWBSC2</rOUTEName>
</mscOutgoingROUTE>
<location>
<locationAreaCode>0006</locationAreaCode>
<cellIdentifier>0C2D</cellIdentifier>
</location>
<basicService>
<teleservice>11</teleservice>
</basicService>
<supplServicesUsed>
<SuppServiceUsedid>
<ssCode>11</ssCode>
<ssTime>0912021535382B0300</ssTime>
</SuppServiceUsedid>
</supplServicesUsed>
<msClassmark>331981</msClassmark>
<answerTime>0912021535382B0300</answerTime>
<releaseTime>0912021535422B0300</releaseTime>
<callDuration>4</callDuration>
<radioChanRequested>
<dualFullRatePreferred/>
</radioChanRequested>
<radioChanUsed>
<halfRate/>
</radioChanUsed>
<causeForTerm>0</causeForTerm>
<diagnostics>
<gsm0408Cause>144</gsm0408Cause>
</diagnostics>
<callReference>1701BED502</callReference>
<additionalChgInfo>
<chargeIndicator>2</chargeIndicator>
</additionalChgInfo>
<networkCallReference>171D555132</networkCallReference>
<mSCAddress>915212110100</mSCAddress>
<speechVersionSupported>25</speechVersionSupported>
<speechVersionUsed>21</speechVersionUsed>
<systemType>
<gERAN/>
</systemType>
<classmark3>C000</classmark3>
<chargedParty>
<calledParty/>
</chargedParty>
<roamingNumber>A111113850</roamingNumber>
<mscIncomingCircuit>9119</mscIncomingCircuit>
<orgRNCorBSCId>8E1A</orgRNCorBSCId>
<orgMSCId>921A</orgMSCId>
<globalAreaID>36F70500060C2D</globalAreaID>
<subscriberCategory>0A</subscriberCategory>
<firstmccmnc>36F705</firstmccmnc>
<lastmccmnc>36F705</lastmccmnc>
</mtCallRecord>
<incGatewayRecord>
<recordType>3</recordType>
<callingNumber>A17005991565</callingNumber>
<calledNumber>A1853643F7</calledNumber>
<recordingEntity>915212110100</recordingEntity>
<mscIncomingROUTE>
<rOUTEName>ZPSTN</rOUTEName>
</mscIncomingROUTE>
<mscOutgoingROUTE>
<rOUTEName>ZTEBSC3</rOUTEName>
</mscOutgoingROUTE>
<answerTime>0912021535302B0300</answerTime>
<releaseTime>0912021535422B0300</releaseTime>
<callDuration>12</callDuration>
<causeForTerm>0</causeForTerm>
<diagnostics>
<gsm0408Cause>144</gsm0408Cause>
</diagnostics>
<callReference>2203AFBF84</callReference>
<basicService>
<teleservice>11</teleservice>
</basicService>
<additionalChgInfo>
<chargeIndicator>2</chargeIndicator>
</additionalChgInfo>
<roamingNumber>A111111980</roamingNumber>
<mscIncomingCircuit>934</mscIncomingCircuit>
<orgMSCId>921A</orgMSCId>
<mscIncomingRouteAttribute>
<isup/>
</mscIncomingRouteAttribute>
<networkCallReference>22432B5132</networkCallReference>
</incGatewayRecord>
<outGatewayRecord>
<recordType>4</recordType>
<callingNumber>A151012431</callingNumber>
<calledNumber>817026936873</calledNumber>
<recordingEntity>915212110100</recordingEntity>
<mscIncomingROUTE>
<rOUTEName>HWBSC</rOUTEName>
</mscIncomingROUTE>
<mscOutgoingROUTE>
<rOUTEName>ZPSTN</rOUTEName>
</mscOutgoingROUTE>
<answerTime>0912021535192B0300</answerTime>
<releaseTime>0912021535432B0300</releaseTime>
<callDuration>24</callDuration>
<causeForTerm>0</causeForTerm>
<diagnostics>
<gsm0408Cause>144</gsm0408Cause>
</diagnostics>
<callReference>2303B19880</callReference>
<basicService>
<teleservice>11</teleservice>
</basicService>
<additionalChgInfo>
<chargeIndicator>2</chargeIndicator>
</additionalChgInfo>
<mscOutgoingCircuit>398</mscOutgoingCircuit>
<orgMSCId>921A</orgMSCId>
<mscOutgoingRouteAttribute>
<isup/>
</mscOutgoingRouteAttribute>
<networkCallReference>238BE55132</networkCallReference>
</outGatewayRecord>
</callEventRecords>
<trailerRecord>
<productionDateTime>0912021247512B0300</productionDateTime>
<recordingEntity>00</recordingEntity>
<firstCallDateTime>000000000000000000</firstCallDateTime>
<lastCallDateTime>000000000000000000</lastCallDateTime>
<noOfRecords>521</noOfRecords>
<extensions/>
</trailerRecord>
<extensions/>
</CallEventDataFile>
Schema File generated by Dataset:
<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="location">
<xs:complexType>
<xs:sequence>
<xs:element name="locationAreaCode" type="xs:string" minOccurs="0" />
<xs:element name="cellIdentifier" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="systemType">
<xs:complexType>
<xs:sequence>
<xs:element name="gERAN" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="basicService">
<xs:complexType>
<xs:sequence>
<xs:element name="teleservice" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="additionalChgInfo">
<xs:complexType>
<xs:sequence>
<xs:element name="chargeIndicator" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="chargedParty">
<xs:complexType>
<xs:sequence>
<xs:element name="calledParty" type="xs:string" minOccurs="0" />
<xs:element name="callingParty" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="mscIncomingROUTE">
<xs:complexType>
<xs:sequence>
<xs:element name="rOUTEName" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="mscOutgoingROUTE">
<xs:complexType>
<xs:sequence>
<xs:element name="rOUTEName" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="radioChanRequested">
<xs:complexType>
<xs:sequence>
<xs:element name="dualFullRatePreferred" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="radioChanUsed">
<xs:complexType>
<xs:sequence>
<xs:element name="halfRate" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="diagnostics">
<xs:complexType>
<xs:sequence>
<xs:element name="gsm0408Cause" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CallEventDataFile">
<xs:complexType>
<xs:sequence>
<xs:element name="extensions" type="xs:string" minOccurs="0" />
<xs:element name="headerRecord" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="productionDateTime" type="xs:string" minOccurs="0" />
<xs:element name="recordingEntity" type="xs:string" minOccurs="0" />
<xs:element name="extensions" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="callEventRecords" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="mtSMSRecord" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="recordType" type="xs:string" minOccurs="0" />
<xs:element name="serviceCentre" type="xs:string" minOccurs="0" />
<xs:element name="servedIMSI" type="xs:string" minOccurs="0" />
<xs:element name="servedIMEI" type="xs:string" minOccurs="0" />
<xs:element name="servedMSISDN" type="xs:string" minOccurs="0" />
<xs:element name="msClassmark" type="xs:string" minOccurs="0" />
<xs:element name="recordingEntity" type="xs:string" minOccurs="0" />
<xs:element name="deliveryTime" type="xs:string" minOccurs="0" />
<xs:element name="orgRNCorBSCId" type="xs:string" minOccurs="0" />
<xs:element name="orgMSCId" type="xs:string" minOccurs="0" />
<xs:element name="globalAreaID" type="xs:string" minOccurs="0" />
<xs:element name="subscriberCategory" type="xs:string" minOccurs="0" />
<xs:element name="firstmccmnc" type="xs:string" minOccurs="0" />
<xs:element name="smsUserDataType" type="xs:string" minOccurs="0" />
<xs:element name="origination" type="xs:string" minOccurs="0" />
<xs:element name="callReference" type="xs:string" minOccurs="0" />
<xs:element ref="location" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="systemType" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="basicService" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="additionalChgInfo" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="chargedParty" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="moSMSRecord" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="recordType" type="xs:string" minOccurs="0" />
<xs:element name="servedIMSI" type="xs:string" minOccurs="0" />
<xs:element name="servedIMEI" type="xs:string" minOccurs="0" />
<xs:element name="servedMSISDN" type="xs:string" minOccurs="0" />
<xs:element name="msClassmark" type="xs:string" minOccurs="0" />
<xs:element name="serviceCentre" type="xs:string" minOccurs="0" />
<xs:element name="recordingEntity" type="xs:string" minOccurs="0" />
<xs:element name="messageReference" type="xs:string" minOccurs="0" />
<xs:element name="originationTime" type="xs:string" minOccurs="0" />
<xs:element name="destinationNumber" type="xs:string" minOccurs="0" />
<xs:element name="orgRNCorBSCId" type="xs:string" minOccurs="0" />
<xs:element name="orgMSCId" type="xs:string" minOccurs="0" />
<xs:element name="globalAreaID" type="xs:string" minOccurs="0" />
<xs:element name="subscriberCategory" type="xs:string" minOccurs="0" />
<xs:element name="firstmccmnc" type="xs:string" minOccurs="0" />
<xs:element name="smsUserDataType" type="xs:string" minOccurs="0" />
<xs:element name="callReference" type="xs:string" minOccurs="0" />
<xs:element ref="location" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="systemType" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="basicService" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="additionalChgInfo" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="chargedParty" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ssActionRecord" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="recordType" type="xs:string" minOccurs="0" />
<xs:element name="servedIMSI" type="xs:string" minOccurs="0" />
<xs:element name="servedIMEI" type="xs:string" minOccurs="0" />
<xs:element name="servedMSISDN" type="xs:string" minOccurs="0" />
<xs:element name="msClassmark" type="xs:string" minOccurs="0" />
<xs:element name="recordingEntity" type="xs:string" minOccurs="0" />
<xs:element name="supplService" type="xs:string" minOccurs="0" />
<xs:element name="ssActionTime" type="xs:string" minOccurs="0" />
<xs:element name="callReference" type="xs:string" minOccurs="0" />
<xs:element name="ussdCodingScheme" type="xs:string" minOccurs="0" />
<xs:element name="ussdRequestCounter" type="xs:string" minOccurs="0" />
<xs:element name="orgRNCorBSCId" type="xs:string" minOccurs="0" />
<xs:element name="orgMSCId" type="xs:string" minOccurs="0" />
<xs:element name="globalAreaID" type="xs:string" minOccurs="0" />
<xs:element name="subscriberCategory" type="xs:string" minOccurs="0" />
<xs:element name="firstmccmnc" type="xs:string" minOccurs="0" />
<xs:element ref="location" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="ssAction" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ussdInvocation" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ssParameters" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="unstructuredData" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element ref="systemType" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="ussdString" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="UssdString" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element ref="additionalChgInfo" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="moCallRecord" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="recordType" type="xs:string" minOccurs="0" />
<xs:element name="servedIMSI" type="xs:string" minOccurs="0" />
<xs:element name="servedIMEI" type="xs:string" minOccurs="0" />
<xs:element name="servedMSISDN" type="xs:string" minOccurs="0" />
<xs:element name="callingNumber" type="xs:string" minOccurs="0" />
<xs:element name="calledNumber" type="xs:string" minOccurs="0" />
<xs:element name="roamingNumber" type="xs:string" minOccurs="0" />
<xs:element name="recordingEntity" type="xs:string" minOccurs="0" />
<xs:element name="msClassmark" type="xs:string" minOccurs="0" />
<xs:element name="answerTime" type="xs:string" minOccurs="0" />
<xs:element name="releaseTime" type="xs:string" minOccurs="0" />
<xs:element name="callDuration" type="xs:string" minOccurs="0" />
<xs:element name="causeForTerm" type="xs:string" minOccurs="0" />
<xs:element name="callReference" type="xs:string" minOccurs="0" />
<xs:element name="gsm-SCFAddress" type="xs:string" minOccurs="0" />
<xs:element name="serviceKey" type="xs:string" minOccurs="0" />
<xs:element name="networkCallReference" type="xs:string" minOccurs="0" />
<xs:element name="mSCAddress" type="xs:string" minOccurs="0" />
<xs:element name="speechVersionSupported" type="xs:string" minOccurs="0" />
<xs:element name="speechVersionUsed" type="xs:string" minOccurs="0" />
<xs:element name="numberOfDPEncountered" type="xs:string" minOccurs="0" />
<xs:element name="levelOfCAMELService" type="xs:string" minOccurs="0" />
<xs:element name="freeFormatData" type="xs:string" minOccurs="0" />
<xs:element name="classmark3" type="xs:string" minOccurs="0" />
<xs:element name="mscOutgoingCircuit" type="xs:string" minOccurs="0" />
<xs:element name="orgRNCorBSCId" type="xs:string" minOccurs="0" />
<xs:element name="orgMSCId" type="xs:string" minOccurs="0" />
<xs:element name="calledIMSI" type="xs:string" minOccurs="0" />
<xs:element name="globalAreaID" type="xs:string" minOccurs="0" />
<xs:element name="subscriberCategory" type="xs:string" minOccurs="0" />
<xs:element name="firstmccmnc" type="xs:string" minOccurs="0" />
<xs:element name="lastmccmnc" type="xs:string" minOccurs="0" />
<xs:element ref="mscIncomingROUTE" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="mscOutgoingROUTE" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="location" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="basicService" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="radioChanRequested" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="radioChanUsed" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="diagnostics" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="additionalChgInfo" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="systemType" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="chargedParty" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="mtCallRecord" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="recordType" type="xs:string" minOccurs="0" />
<xs:element name="servedIMSI" type="xs:string" minOccurs="0" />
<xs:element name="servedIMEI" type="xs:string" minOccurs="0" />
<xs:element name="servedMSISDN" type="xs:string" minOccurs="0" />
<xs:element name="callingNumber" type="xs:string" minOccurs="0" />
<xs:element name="recordingEntity" type="xs:string" minOccurs="0" />
<xs:element name="msClassmark" type="xs:string" minOccurs="0" />
<xs:element name="answerTime" type="xs:string" minOccurs="0" />
<xs:element name="releaseTime" type="xs:string" minOccurs="0" />
<xs:element name="callDuration" type="xs:string" minOccurs="0" />
<xs:element name="causeForTerm" type="xs:string" minOccurs="0" />
<xs:element name="callReference" type="xs:string" minOccurs="0" />
<xs:element name="networkCallReference" type="xs:string" minOccurs="0" />
<xs:element name="mSCAddress" type="xs:string" minOccurs="0" />
<xs:element name="speechVersionSupported" type="xs:string" minOccurs="0" />
<xs:element name="speechVersionUsed" type="xs:string" minOccurs="0" />
<xs:element name="classmark3" type="xs:string" minOccurs="0" />
<xs:element name="roamingNumber" type="xs:string" minOccurs="0" />
<xs:element name="mscIncomingCircuit" type="xs:string" minOccurs="0" />
<xs:element name="orgRNCorBSCId" type="xs:string" minOccurs="0" />
<xs:element name="orgMSCId" type="xs:string" minOccurs="0" />
<xs:element name="globalAreaID" type="xs:string" minOccurs="0" />
<xs:element name="subscriberCategory" type="xs:string" minOccurs="0" />
<xs:element name="firstmccmnc" type="xs:string" minOccurs="0" />
<xs:element name="lastmccmnc" type="xs:string" minOccurs="0" />
<xs:element ref="mscIncomingROUTE" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="mscOutgoingROUTE" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="location" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="basicService" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="supplServicesUsed" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="SuppServiceUsedid" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ssCode" type="xs:string" minOccurs="0" />
<xs:element name="ssTime" type="xs:string" minOccurs="0" />
</xs:sequence>
Where and how do you want to import this XML file??
SQL Server 2005 and up has pretty extensive support for XQuery, which means you can extract bits of information from your XML using XPath.
Not knowing what you're trying to do, here's just a quick sample_
DECLARE #XmlContent XML
SET #XmlContent = '(put your XML here)'
SELECT
#XmlContent.value('(/CallEventDataFile/headerRecord/productionDateTime)[1]', 'varchar(50)') as 'Production DateTime',
#XmlContent.value('(/CallEventDataFile/headerRecord/recordingEntity)[1]', 'int') as 'Recording Entity'
With this XQuery syntax, you can extract pretty much everything from your XML and easily store it into a table column.
Also, if you need to enumerate a list of XML nodes that are inside a XML tag, you can use the .nodes() function on XML:
SELECT
mtsms.record.value('(recordType)[1]', 'int') as 'Record Type',
mtsms.record.value('(serviceCentre)[1]', 'varchar(100)') as 'Service Centre'
FROM
#XmlContents.nodes('//mtSMSRecord') AS mtsms(record)
With this statement, you could get a "virtual table" of all <mtSMSRecord> nodes in your XML as a table "mtsms" and column "record", and you could then extract detail information for each mtSMSRecord tag and store that into your relational tables, as needed.
A really good introduction to XML support in SQL Server 2005 and up is the An Overview of XML Support in SQL Server 2005 article on 15seconds. It shows you what XML functions are available and how to use them.

Resources