XML response fra fragtfirma skal vises i ASP
Har set et lignende indlæg, uden en løsning, men nu prøver jeg alligevel, om der ikke skulle være et pædagoisk XML geni, som kort kan forklare hvad jeg skal gøre.Jeg hare en asp side hvor jeg vider nogle data fra vores SalgsSystem, og vil gerne have et således at kunder kan med et klik se status på hvor deres vare er hos POSTEN/DHL eller hvem det nu er der leverer varer til dem.
Jeg har lavet en request kode som med method=POST i ASP sender data til fragtfirmaet og jeg får derved vist en xml side/kode op på skærmen med XMLSCHEMA øverst og Data nederst.
Hvordan får jeg dette XML monster lavet om til noget jeg kan vise en bruger, når nu koden jeg for smidt i nakken ser således ud:
mvh
Wildthing
<?xml version="1.0" encoding="utf-8" ?>
- <DataSet xmlns="http://wilsonlog.com/webservice">
- <xs:schema id="Document" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="Document" msdata:IsDataSet="true">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="DocumentHeader">
- <xs:complexType>
- <xs:sequence>
<xs:element name="Reference" type="xs:string" minOccurs="0" />
<xs:element name="ReferenceType" type="xs:string" minOccurs="0" />
<xs:element name="Owner" type="xs:string" minOccurs="0" />
<xs:element name="OriginPort" type="xs:string" minOccurs="0" />
<xs:element name="OriginName" type="xs:string" minOccurs="0" />
<xs:element name="ETD" type="xs:dateTime" minOccurs="0" />
<xs:element name="DestinationPort" type="xs:string" minOccurs="0" />
<xs:element name="DestinationName" type="xs:string" minOccurs="0" />
<xs:element name="ETA" type="xs:dateTime" minOccurs="0" />
<xs:element name="Service" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="DocumentDetail">
- <xs:complexType>
- <xs:sequence>
<xs:element name="Pieces" type="xs:decimal" minOccurs="0" />
<xs:element name="Weight" type="xs:decimal" minOccurs="0" />
<xs:element name="Volume" type="xs:decimal" minOccurs="0" />
<xs:element name="WeightQual" type="xs:string" minOccurs="0" />
<xs:element name="VolumeQual" type="xs:string" minOccurs="0" />
<xs:element name="HandlingInstructions1" type="xs:string" minOccurs="0" />
<xs:element name="HandlingInstructions2" type="xs:string" minOccurs="0" />
<xs:element name="HandlingInstructions3" type="xs:string" minOccurs="0" />
<xs:element name="HandlingInstructions4" type="xs:string" minOccurs="0" />
<xs:element name="HandlingInstructions5" type="xs:string" minOccurs="0" />
<xs:element name="ForwardingAgent" type="xs:string" minOccurs="0" />
<xs:element name="ForwardingAgentCity" type="xs:string" minOccurs="0" />
<xs:element name="ReceivingAgent" type="xs:string" minOccurs="0" />
<xs:element name="ReceivingAgentCity" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="DocumentStatus">
- <xs:complexType>
- <xs:sequence>
<xs:element name="Document" type="xs:string" minOccurs="0" />
<xs:element name="Status" type="xs:string" minOccurs="0" />
<xs:element name="Date" type="xs:dateTime" minOccurs="0" />
<xs:element name="Location" type="xs:string" minOccurs="0" />
<xs:element name="Locationdescription" type="xs:string" minOccurs="0" />
<xs:element name="Pieces" type="xs:int" minOccurs="0" />
<xs:element name="Volume" type="xs:decimal" minOccurs="0" />
<xs:element name="VolumeQual" type="xs:string" minOccurs="0" />
<xs:element name="Weight" type="xs:decimal" minOccurs="0" />
<xs:element name="WeightQual" type="xs:string" minOccurs="0" />
<xs:element name="PartyId" type="xs:string" minOccurs="0" />
<xs:element name="Signatory" type="xs:string" minOccurs="0" />
<xs:element name="Reason" type="xs:string" minOccurs="0" />
<xs:element name="FTX" 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">
- <Document xmlns="">
- <DocumentHeader diffgr:id="DocumentHeader1" msdata:rowOrder="0">
<Reference>4590784133</Reference>
<ReferenceType>WEXP</ReferenceType>
<Owner>DHL</Owner>
<OriginPort>CPH</OriginPort>
<OriginName>Copenhagen</OriginName>
<ETD>2004-08-17T00:00:59.0000000+02:00</ETD>
<DestinationPort>OSL</DestinationPort>
<DestinationName>OSLO</DestinationName>
<ETA>2004-08-18T00:00:59.0000000+02:00</ETA>
<Service>WEXDD</Service>
</DocumentHeader>
- <DocumentDetail diffgr:id="DocumentDetail1" msdata:rowOrder="0">
<Pieces>1.000</Pieces>
<Weight>1.500</Weight>
<WeightQual>KGM</WeightQual>
<HandlingInstructions1>OSL NO ****ALT FRANKRIG SKAL MED UPS******* NORGE ZONE 5*****</HandlingInstructions1>
<HandlingInstructions2 />
<HandlingInstructions3>WILSON EXPRESS DOOR-DOOR WEXDD</HandlingInstructions3>
<HandlingInstructions4 />
<HandlingInstructions5>SCI=C/</HandlingInstructions5>
<ForwardingAgent>WDKBLL</ForwardingAgent>
<ForwardingAgentCity>DENMARK</ForwardingAgentCity>
</DocumentDetail>
- <DocumentStatus diffgr:id="DocumentStatus1" msdata:rowOrder="0">
<Document>WEXP</Document>
<Status>Delivered to Consignee</Status>
<Date>2004-08-18T12:33:59.0000000+02:00</Date>
<Location>OSL</Location>
<Locationdescription>OSLO</Locationdescription>
<Pieces>1</Pieces>
<Weight>4.100</Weight>
<WeightQual>KGM</WeightQual>
<PartyId>WDKBLL</PartyId>
<Signatory>B HALVORSEN</Signatory>
</DocumentStatus>
- <DocumentStatus diffgr:id="DocumentStatus2" msdata:rowOrder="1">
<Document>WEXP</Document>
<Status>Received Export Checkpoint</Status>
<Date>2004-08-17T17:53:59.0000000+02:00</Date>
<Location>BLL</Location>
<Locationdescription>BILLUND</Locationdescription>
<Pieces>1</Pieces>
<Weight>1.500</Weight>
<WeightQual>KGM</WeightQual>
<PartyId>WDKBLL</PartyId>
</DocumentStatus>
- <DocumentStatus diffgr:id="DocumentStatus3" msdata:rowOrder="2">
<Document>WEXP</Document>
<Status>Pick Up</Status>
<Date>2004-08-17T17:52:59.0000000+02:00</Date>
<Location>BLL</Location>
<Locationdescription>BILLUND</Locationdescription>
<Pieces>1</Pieces>
<Weight>1.500</Weight>
<WeightQual>KGM</WeightQual>
<PartyId>WDKBLL</PartyId>
</DocumentStatus>
</Document>
</diffgr:diffgram>
</DataSet>