Saturday, 19 July 2014

Unable to parse xsd because of namspace conflict



I am trying to generate java classes using xjc utility but getting below exception:


[ERROR] src-resolve.4.2: Error resolving component 'act:statusCd'. It was detected that 'act:statusCd' is in namespace 'http://ift.tt/1jKThHh' , but components from this namespace are not referenceable from schema document 'file:/E:/SpringWebServices/BankWebService/xsd/account.xsd'. If this is the incorrect namespace, perhaps the prefix of 'act:statusCd' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/E:/SpringWebServices/BankWebService/xsd/account.xsd'. line 22 of file:/E:/SpringWebServices/BankWebService/xsd/account.xsd



<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://ift.tt/tphNwY"
xmlns:act="http://ift.tt/1jKThHh"
xmlns:xs="http://ift.tt/tphNwY"
targetNamespace="http://ift.tt/1jKTfPF"
elementFormDefault="qualified">

<xs:element name="AccountRequest">
<xs:complexType>
<xs:all>
<xs:element name="AccountNumber" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>

<xs:element name="AccountResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="AccountNumber" type="xs:string"/>
<xs:element name="AccountName" type="xs:string"/>
<xs:element name="AccountBalance" type="xs:double"/>
<xs:element name="AccountStatus" type="act:statusCd"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:simpleType name="statusCd">
<xs:restriction base="xs:string">
<xs:enumeration value="Active"/>
<xs:enumeration value="Inactive"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>


Please let me know where I doing wrong in xsd file. I want to refer "statusCd" simpleType in my response.


No comments:

Post a Comment