cancel
Showing results for 
Search instead for 
Did you mean: 

CPI Message Mapping XSD Error

jonaswang
Advisor
Advisor

Hi experts,

I tried to upload an xsd file to a message mapping. But i have an issue - Attribute reference 'http://www.w3.org/XML/1998/namespace#lang' is unresolved

Below is my xsd file. Any ideas would be appreciated.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
    <xs:element name="catalog">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="header">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="image-settings">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="external-location">
                                            <xs:complexType>
                                                <xs:sequence>
                                                    <xs:element type="xs:anyURI" name="http-url"/>
                                                    <xs:element type="xs:string" name="https-url"/>
                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>
                                        <xs:element name="view-types">
                                            <xs:complexType>
                                                <xs:sequence>
                                                    <xs:element type="xs:string" name="view-type" maxOccurs="unbounded" minOccurs="0"/>
                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>
                                        <xs:element type="xs:string" name="variation-attribute-id"/>
                                        <xs:element type="xs:string" name="alt-pattern"/>
                                        <xs:element type="xs:string" name="title-pattern"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="product">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element type="xs:long" name="ean"/>
                            <xs:element type="xs:long" name="upc"/>
                            <xs:element type="xs:string" name="unit"/>
                            <xs:element type="xs:byte" name="min-order-quantity"/>
                            <xs:element type="xs:byte" name="step-quantity"/>
                            <xs:element name="display-name">
                                <xs:complexType>
                                    <xs:simpleContent>
                                        <xs:extension base="xs:string">
                                            <xs:attribute ref="xml:lang"/>
                                        </xs:extension>
                                    </xs:simpleContent>
                                </xs:complexType>
                            </xs:element>
                            <xs:element type="xs:string" name="store-force-price-flag"/>
                            <xs:element type="xs:string" name="store-non-inventory-flag"/>
                            <xs:element type="xs:string" name="store-non-revenue-flag"/>
                            <xs:element type="xs:string" name="store-non-discountable-flag"/>
                            <xs:element type="xs:string" name="online-flag"/>
                            <xs:element type="xs:string" name="available-flag"/>
                            <xs:element type="xs:string" name="searchable-flag"/>
                            <xs:element type="xs:string" name="page-attributes"/>
                            <xs:element name="custom-attributes">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="custom-attribute" maxOccurs="unbounded" minOccurs="0">
                                            <xs:complexType>
                                                <xs:simpleContent>
                                                    <xs:extension base="xs:string">
                                                        <xs:attribute type="xs:string" name="attribute-id" use="optional"/>
                                                        <xs:attribute ref="xml:lang"/>
                                                    </xs:extension>
                                                </xs:simpleContent>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                            <xs:element type="xs:string" name="pinterest-enabled-flag"/>
                            <xs:element type="xs:string" name="facebook-enabled-flag"/>
                            <xs:element name="store-attributes">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element type="xs:string" name="force-price-flag"/>
                                        <xs:element type="xs:string" name="non-inventory-flag"/>
                                        <xs:element type="xs:string" name="non-revenue-flag"/>
                                        <xs:element type="xs:string" name="non-discountable-flag"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute type="xs:int" name="product-id"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:attribute type="xs:string" name="catalog-id"/>
        </xs:complexType>
    </xs:element>
</xs:schema>

Accepted Solutions (1)

Accepted Solutions (1)

MortenWittrock
Active Contributor

Hi Jonas

Download the XML Schema at http://www.w3.org/2001/xml.xsd and upload it as a resource to your iflow. Call it, say, xml.xsd. Then update the xs:import element in your own schema to say schemaLocation="xml.xsd". Then the xml.xsd schema will be loaded from your iflow's local resources, and the message mapping will accept your schema.

Regards,

Morten

jonaswang
Advisor
Advisor

Thanks Morten,

It works! After importing xml.xsd file to iflow as a resource, my xsd is able to pick up the reference.

Yogendra_Ahuja
Explorer
0 Kudos

Hi Morten and Jonas,

I am also facing the same issue with my WSDL. I have imported xml.xsd file to Iflow resources. Then also facing the same issue in mapping. Could you please let me know what should i update in the WSDL after importing xml.xsd to the Iflow-resources? Thanks in advance.

error.png

WSDL:

<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> <s:element name="Update_SalesData"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="ObjSalesData" type="tns:Sales"/> </s:sequence> </s:complexType> </s:element> <s:complexType name="Sales"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Data" type="tns:ArrayOfSalesOffice"/> </s:sequence> </s:complexType> <s:complexType name="ArrayOfSalesOffice"> <s:sequence> <s:element minOccurs="0" maxOccurs="unbounded" name="SalesOffice" nillable="true" type="tns:SalesOffice"/> </s:sequence> </s:complexType> <s:complexType name="SalesOffice">.....

......

<soap12:operation soapAction="http://tempuri.org/Update_ITEAMMASTERData" style="document"/> <wsdl:input> <soap12:body use="literal"/> <soap12:header message="tns:Update_ITEAMMASTERDataAuthHeader" part="AuthHeader" use="literal"/> </wsdl:input> <wsdl:output> <soap12:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="Outbound"> <wsdl:port name="OutboundSoap" binding="tns:OutboundSoap"> <soap:address location="http://localhost:1347/IPL_OutboundService.asmx"/> </wsdl:port> <wsdl:port name="OutboundSoap12" binding="tns:OutboundSoap12"> <soap12:address location="http://localhost:1347/IPL_OutboundService.asmx"/> </wsdl:port> </wsdl:service> </wsdl:definitions>

Regards,

Yogendra

mattisebastian
Participant

Hi Morten,

your answer was super helpful!

To make it more clear for other people having this problem:

We downloaded the xml.xsd you mentioned and then added the bold part to our cXML:

<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>

Thanks again and best regards

Matti

Answers (0)