我正在尝试从XSD构建有效负载,但显然缺少某些内容。这是XSD:
<xs:element name="InsuranceProducer" type="InsuranceProducer"/>
<xs:complexType name="InsuranceProducer">
<xs:sequence>
<xs:element name="distributionAgency" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>DGIS
For the exclusive agent network, the distribution agency is the same than the agency code.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="distributionNetwork" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>ExclusiveAgency</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="distributor" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Domain of value:
DGIG
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Agency, Agent, HoldingCode, Brokerage</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="code" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="primaryProducer" type="InsuranceProducer" minOccurs="0" maxOccurs="1"/>
<xs:element name="PartyInfo" type="partySum:PartyInfo" minOccurs="0" maxOccurs="1"/>
<xs:element name="salesPointDescription" type="xs:string" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="salesPointCode" type="xs:string" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Identifies the point of sale responsible for the production of insurance agreements.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SubProducer" type="SubProducer" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:element name="SubProducer" type="SubProducer"/>
<xs:complexType name="SubProducer">
<xs:sequence>
<xs:element name="code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="PartyInfo" type="partySum:PartyInfo" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
这是有效载荷的InsuranceProducer部分:
<InsuranceProducer xmlns="">
<distributionAgency>Something</distributionAgency>
<distributionNetwork>Something</distributionNetwork>
<distributor>Something</distributor>
<type>Something</type>
<code>Something</code>
<salesPointDescription>something</salesPointDescription>
<salesPointCode>Something</salesPointCode>
</InsuranceProducer>
但我收到的只是:org.xml.sax.SAXParseException:cvc-complex-type.2.4.a:发现了以元素“ salesPointDescription”开头的无效内容。预期为“ {primaryProducer,PartyInfo,SubProducer}”之一。,行:3,列:391
答案 0 :(得分:0)
格式很好,问题实际上是在我的JBOSS上运行的发布者使用了那些字段的旧XSD shema。我刚刚上传了他们,瞧!