IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

XML to XSD problem Options · View
jbhesl
Posted: Thursday, July 24, 2014 10:59:37 AM
Rank: Newbie

Joined: 7/24/2014
Posts: 5
Location: NL
Hi all!

I am not experienced in xml-issues. o maybe this is a simple question. I hope it is.
Problem is, I have a xml file with soap-envelopes in it. When I use XMLSpy to make an xsd of it, it gives me two files.
Neither of them I can use in a Mapforce mapping to create a mapping.

I'v done this many times with XML's without envelopes, but now I am completely stuck.

Or, Help! Would be greatly appreciated from Holland :) How can I make avalid .xsd of this file in such a way I can use it in a Mapforce mapping?

This is the base xml file concerned:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tbox="http://connect1.transwise.eu/TboxService/">
<SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
<soap:Body>
<tbox:carrierBooking>
<tbox:carrierBookingInfo>
<tbox:version>2.0</tbox:version>
<tbox:status>OK</tbox:status>
<tbox:description/>
</tbox:carrierBookingInfo>
<tbox:shipments>
<tbox:shipmentInfo>
<tbox:customerId>KRUIZINGA</tbox:customerId>
<tbox:costcenter/>
<tbox:carrier>BEN</tbox:carrier>
<tbox:executingCarrier>BEN</tbox:executingCarrier>
<tbox:reference>302172</tbox:reference>
<tbox:awb>0000000070</tbox:awb>
<tbox:description/>
<tbox:instruction>vandaag leveren met caddy normaal tarief zoals vanmorgen besprok</tbox:instruction>
<tbox:value>0.00 EUR</tbox:value>
<tbox:valueCurrency>EUR</tbox:valueCurrency>
<tbox:pickupDate>20140717 van 08:00 tot 16:30</tbox:pickupDate>
<tbox:pickupTime>080000</tbox:pickupTime>
<tbox:pickupTimeTo>163000</tbox:pickupTimeTo>
<tbox:requestedDeliveryDate>20140718</tbox:requestedDeliveryDate>
<tbox:requestedDeliveryTime>080000</tbox:requestedDeliveryTime>
<tbox:requestedDeliveryTimeTo>170000</tbox:requestedDeliveryTimeTo>
<tbox:plannedDeliveryDate>20140718</tbox:plannedDeliveryDate>
<tbox:plannedDeliveryTime>170000</tbox:plannedDeliveryTime>
<tbox:service>NON-DOCS</tbox:service>
<tbox:serviceLevelTime>STANDARD</tbox:serviceLevelTime>
<tbox:serviceLevelOther/>
<tbox:incoterms>CPT</tbox:incoterms>
<tbox:inbound>0</tbox:inbound>
<tbox:noOfPackages>1</tbox:noOfPackages>
<tbox:weight>123.00 KG</tbox:weight>
<tbox:weightUom>KG</tbox:weightUom>
<tbox:price>0.00</tbox:price>
<tbox:salesPrice/>
<tbox:currency>EUR</tbox:currency>
<tbox:trackingUrl/>
<tbox:shipmentStatusCode>NEW</tbox:shipmentStatusCode>
<tbox:additionalReferences/>
<tbox:shipmentLines>
<tbox:shipmentLine>
<tbox:sequence>1</tbox:sequence>
<tbox:lineNo>1</tbox:lineNo>
<tbox:shipmentLineId/>
<tbox:awb>0000000070001</tbox:awb>
<tbox:packageType>PALLET</tbox:packageType>
<tbox:description>transportsupplies</tbox:description>
<tbox:quantity>1</tbox:quantity>
<tbox:genericStatusCode>NEW</tbox:genericStatusCode>
<tbox:carrierStatusCode/>
<tbox:carrierStatusDescription/>
<tbox:acceptedBy/>
<tbox:measurements>
<tbox:length>0.00</tbox:length>
<tbox:width>0.00</tbox:width>
<tbox:height>0.00</tbox:height>
<tbox:weight>123.00</tbox:weight>
</tbox:measurements>
</tbox:shipmentLine>
</tbox:shipmentLines>
<tbox:addresses>
<tbox:address>
<tbox:type>SEND</tbox:type>
<tbox:name>Perensoep B.V.</tbox:name>
<tbox:street1>Zeelaan 15</tbox:street1>
<tbox:street2/>
<tbox:city>Wapenveld</tbox:city>
<tbox:zipCode>8191 JH</tbox:zipCode>
<tbox:state/>
<tbox:countryCode>NL</tbox:countryCode>
<tbox:contact>Dhr. Kees Kater</tbox:contact>
<tbox:telNo>0031 88 1234567</tbox:telNo>
<tbox:faxNo/>
<tbox:email>kees@kater.nl</tbox:email>
<tbox:accountNo>411159</tbox:accountNo>
<tbox:VATNumber/>
</tbox:address>
<tbox:address>
<tbox:type>RECV</tbox:type>
<tbox:name>Balein B.V.</tbox:name>
<tbox:street1>Nieuwegracht 12</tbox:street1>
<tbox:street2/>
<tbox:city>SOEST</tbox:city>
<tbox:zipCode>3763 LB</tbox:zipCode>
<tbox:state/>
<tbox:countryCode>NL</tbox:countryCode>
<tbox:contact/>
<tbox:telNo>035-7400740</tbox:telNo>
<tbox:faxNo/>
<tbox:email/>
<tbox:accountNo/>
<tbox:VATNumber/>
</tbox:address>
</tbox:addresses>
</tbox:shipmentInfo>
</tbox:shipments>
</tbox:carrierBooking>
</soap:Body>
</soap:Envelope>


Thank you very much!
vlad
Posted: Thursday, July 24, 2014 12:51:20 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
Why so complicated? Why don't you take this file itself and give it to MapForce directly - it will create a schema for you automatically.
jbhesl
Posted: Thursday, July 24, 2014 1:39:15 PM
Rank: Newbie

Joined: 7/24/2014
Posts: 5
Location: NL
vlad wrote:
Why so complicated? Why don't you take this file itself and give it to MapForce directly - it will create a schema for you automatically.

Thats what I always do indeed, and usually that works great.
But with this file I file I gte two xsd's: an almost empty one, and the one with the tags etc.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://connect1.transwise.eu/TboxService/" schemaLocation="transsmart-boeking-bymapforce1.xsd"/>
<xs:import namespace="http://schemas.xmlsoap.org/soap/envelope/"/>
</xs:schema>


and


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://connect1.transwise.eu/TboxService/" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="carrierBooking">
<xs:complexType>
<xs:sequence>
<xs:element name="carrierBookingInfo">
<xs:complexType>
<xs:sequence>
<xs:element name="version" type="xs:decimal"/>
<xs:element name="status" type="xs:string"/>
<xs:element name="description">
<xs:complexType/>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="shipments">
<xs:complexType>
<xs:sequence>
<xs:element name="shipmentInfo">
<xs:complexType>
<xs:sequence>
<xs:element name="customerId" type="xs:string"/>
<xs:element name="costcenter">
<xs:complexType/>
</xs:element>
<xs:element name="carrier" type="xs:string"/>
<xs:element name="executingCarrier" type="xs:string"/>
<xs:element name="reference" type="xs:string"/>
<xs:element name="awb" type="xs:byte"/>
<xs:element name="description">
<xs:complexType/>
</xs:element>
<xs:element name="instruction" type="xs:string"/>
<xs:element name="value" type="xs:string"/>
<xs:element name="valueCurrency" type="xs:string"/>
<xs:element name="pickupDate" type="xs:string"/>
<xs:element name="pickupTime" type="xs:int"/>
<xs:element name="pickupTimeTo" type="xs:int"/>
<xs:element name="requestedDeliveryDate" type="xs:int"/>
<xs:element name="requestedDeliveryTime" type="xs:int"/>
<xs:element name="requestedDeliveryTimeTo" type="xs:int"/>
<xs:element name="plannedDeliveryDate" type="xs:int"/>
<xs:element name="plannedDeliveryTime" type="xs:int"/>
<xs:element name="service" type="xs:string"/>
<xs:element name="serviceLevelTime" type="xs:string"/>
<xs:element name="serviceLevelOther">
<xs:complexType/>
</xs:element>
<xs:element name="incoterms" type="xs:string"/>
<xs:element name="inbound" type="xs:byte"/>
<xs:element name="noOfPackages" type="xs:byte"/>
<xs:element name="weight" type="xs:string"/>
<xs:element name="weightUom" type="xs:string"/>
<xs:element name="price" type="xs:decimal"/>
<xs:element name="salesPrice">
<xs:complexType/>
</xs:element>
<xs:element name="currency" type="xs:string"/>
<xs:element name="trackingUrl">
<xs:complexType/>
</xs:element>
<xs:element name="shipmentStatusCode" type="xs:string"/>
<xs:element name="additionalReferences">
<xs:complexType/>
</xs:element>
<xs:element name="shipmentLines">
<xs:complexType>
<xs:sequence>
<xs:element name="shipmentLine">
<xs:complexType>
<xs:sequence>
<xs:element name="sequence" type="xs:byte"/>
<xs:element name="lineNo" type="xs:byte"/>
<xs:element name="shipmentLineId">
<xs:complexType/>
</xs:element>
<xs:element name="awb" type="xs:int"/>
<xs:element name="packageType" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="quantity" type="xs:byte"/>
<xs:element name="genericStatusCode" type="xs:string"/>
<xs:element name="carrierStatusCode">
<xs:complexType/>
</xs:element>
<xs:element name="carrierStatusDescription">
<xs:complexType/>
</xs:element>
<xs:element name="acceptedBy">
<xs:complexType/>
</xs:element>
<xs:element name="measurements">
<xs:complexType>
<xs:sequence>
<xs:element name="length" type="xs:decimal"/>
<xs:element name="width" type="xs:decimal"/>
<xs:element name="height" type="xs:decimal"/>
<xs:element name="weight" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addresses">
<xs:complexType>
<xs:sequence>
<xs:element name="address" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="type" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="street1" type="xs:string"/>
<xs:element name="street2">
<xs:complexType/>
</xs:element>
<xs:element name="city" type="xs:string"/>
<xs:element name="zipCode" type="xs:string"/>
<xs:element name="state">
<xs:complexType/>
</xs:element>
<xs:element name="countryCode" type="xs:string"/>
<xs:element name="contact" type="xs:string"/>
<xs:element name="telNo" type="xs:string"/>
<xs:element name="faxNo">
<xs:complexType/>
</xs:element>
<xs:element name="email" type="xs:string"/>
<xs:element name="accountNo" type="xs:string"/>
<xs:element name="VATNumber">
<xs:complexType/>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
jbhesl
Posted: Thursday, July 24, 2014 1:44:00 PM
Rank: Newbie

Joined: 7/24/2014
Posts: 5
Location: NL
vlad wrote:
Why so complicated? Why don't you take this file itself and give it to MapForce directly - it will create a schema for you automatically.

xcuse me, i closed too early.

problem is that the second xsd doesnt work, errors show up.
about envelop names etc.

when i change them in a way it is accepted, i am getting an empty result.
island
Posted: Tuesday, July 29, 2014 5:09:54 AM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
Hi,

the attached zip contains a mapping. I used Mapforce to autogenerate the schemas from "in.xml". In the mapping, for the "xs:any" element inside the "Body" element I selected "carrierBooking". I then mapped two sub elements to an output text file and it worked without problems. I used version 2014r2sp1 of Mapforce.

File Attachment(s):
forumsoap.zip (4kb) downloaded 1,027 time(s).


Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.