Reputation: 393
I'm creating a Spring based SOAP web service, and I'm trying to return a custom list called AVAILABLE_PACKAGES which contains multiple PACKAGE_ITEM elements. Each one of these PACKAGE_ITEM elements is made by two strings, PACKAGE_NAME and PACKAGE_PRICE.
I tried with multiple configurations, but I keep receiving an error on the line
<xs:element name="availablePackagesList" type="xs:AvailablePackagesList" />
The error reads as follows:
Multiple annotations found at this line:
- src-resolve: Cannot resolve the name 'xs:AvailablePackagesList' to a(n) 'type definition' component.
- src-resolve.4.2: Error resolving component 'xs:AvailablePackagesList'. It was detected that
'xs:AvailablePackagesList' is in namespace 'http://www.w3.org/2001/XMLSchema', but components from this
namespace are not referenceable from schema document...
This is the code snippet of what I have on my .xsd file
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http:/hello.com/queries"
xmlns:tns="http:/hello.com/queries"
elementFormDefault="qualified">
<!--GetSubscriberAvailablePackages -->
<xs:element
name="MobileGetSubscriberAvailablePackagesRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="network" type="xs:string" />
<xs:element name="username" type="xs:string" />
<xs:element name="password" type="xs:string" />
<xs:element name="subscriberData" type="xs:string" />
<xs:element name="subscriberDataType" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="MobileGetSubscriberAvailablePackagesResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="network" type="xs:string" />
<xs:element name="subscriberData" type="xs:string" />
<xs:element name="subscriberDataType" type="xs:string" />
<xs:element name="response" type="xs:string" />
<xs:element name="responseDetails" type="xs:string" />
<xs:element name="availablePackagesList"
type="xs:AvailablePackagesList" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="AvailablePackagesList">
<xs:sequence>
<xs:element name="AvaillablePackage"
type="xs:AvaillablePackageItem" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="AvaillablePackageItem">
<xs:attribute name="packageName" type="xs:integer"
use="required" />
<xs:attribute name="packagePrice" type="xs:integer"
use="required" />
</xs:complexType>
Upvotes: 1
Views: 940
Reputation: 111561
To eliminate your immediate error and one subsequent error,
change type="xs:AvailablePackagesList"
to type="tns:AvailablePackagesList"
, and
changetype="xs:AvaillablePackageItem"
to type="tns:AvaillablePackageItem"
because both are in the http:/yobitelecom.com/queries
namespace, not the http://www.w3.org/2001/XMLSchema
namespace.
Upvotes: 1