如何处理复杂类型xsd中的重复元素?

时间:2019-07-17 10:22:11

标签: java xml xsd jaxb maven-jaxb2-plugin

  

这是api响应,并尝试使用JAXB创建类,但是   转换时抛出异常,因为它有重复项   元素名称,例如

     

错误:EnvelopeGetResponse.java:[34841,84]无法找到符号
  符号:类EmailNotification
  位置:类   EnvelopeGetResponse.Entity.Recipients.Signers.Element

<xs:element name="envelopeGetResponse">
        <xs:complexType>
          <xs:sequence>
             <xs:element name="entity" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element type="xs:string" name="allowMarkup"/>
                  <xs:element type="xs:string" name="allowReassign"/>
                  <xs:element type="xs:string" name="allowViewHistory"/>
                  <xs:element type="xs:string" name="asynchronous"/>
                  <xs:element type="xs:string" name="attachmentsUri"/>
                  <xs:element type="xs:string" name="authoritativeCopy"/>
                  <xs:element type="xs:string" name="authoritativeCopyDefault"/>
                  <xs:element type="xs:string" name="autoNavigation"/>
                  <xs:element type="xs:string" name="brandId"/>
                  <xs:element type="xs:string" name="brandLock"/>
                  <xs:element type="xs:string" name="certificateUri"/>
                  <xs:element type="xs:string" name="completedDateTime"/>
                  <xs:element type="xs:string" name="createdDateTime"/>
                  <xs:element name="customFields" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="listCustomFields"  maxOccurs="unbounded">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element name="element">
                                <xs:complexType>
                                  <xs:sequence>
                                    <xs:element type="xs:string" name="configurationType"/>
                                    <xs:element name="errorDetails">
                                      <xs:complexType>
                                        <xs:sequence>
                                          <xs:element type="xs:string" name="errorCode"/>
                                          <xs:element type="xs:string" name="message"/>
                                        </xs:sequence>
                                      </xs:complexType>
                                    </xs:element>
                                    <xs:element type="xs:string" name="fieldId"/>
                                    <xs:element name="listItems"  maxOccurs="unbounded">
                                      <xs:complexType>
                                        <xs:sequence>
                                          <xs:element type="xs:string" name="element"/>
                                        </xs:sequence>
                                      </xs:complexType>
                                    </xs:element>
                                    <xs:element type="xs:string" name="name"/>
                                    <xs:element type="xs:string" name="required"/>
                                    <xs:element type="xs:string" name="show"/>
                                    <xs:element type="xs:string" name="value"/>
                                  </xs:sequence>
                                </xs:complexType>
                              </xs:element>
                            </xs:sequence>
                          </xs:complexType>
                        </xs:element>
                        <xs:element name="textCustomFields" maxOccurs="unbounded">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element name="element">
                                <xs:complexType>
                                  <xs:sequence>
                                    <xs:element type="xs:string" name="configurationType"/>
                                    <xs:element name="errorDetails">
                                      <xs:complexType>
                                        <xs:sequence>
                                          <xs:element type="xs:string" name="errorCode"/>
                                          <xs:element type="xs:string" name="message"/>
                                        </xs:sequence>
                                      </xs:complexType>
                                    </xs:element>
                                    <xs:element type="xs:string" name="fieldId"/>
                                    <xs:element type="xs:string" name="name"/>
                                    <xs:element type="xs:string" name="required"/>
                                    <xs:element type="xs:string" name="show"/>
                                    <xs:element type="xs:string" name="value"/>
                                  </xs:sequence>
                                </xs:complexType>
                              </xs:element>
                            </xs:sequence>
                          </xs:complexType>
                        </xs:element>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                  <xs:element type="xs:string" name="customFieldsUri"/>
                  <xs:element type="xs:string" name="declinedDateTime"/>
                  <xs:element type="xs:string" name="deletedDateTime"/>
                  <xs:element type="xs:string" name="deliveredDateTime"/>
                  <xs:element type="xs:string" name="documentsCombinedUri"/>
                  <xs:element type="xs:string" name="documentsUri"/>
                  <xs:element type="xs:string" name="emailBlurb"/>
                  <xs:element name="emailSettings">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="bccEmailAddresses">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element name="element">
                                <xs:complexType>
                                  <xs:sequence>
                                    <xs:element type="xs:string" name="bccEmailAddressId"/>
                                    <xs:element type="xs:string" name="email"/>
                                  </xs:sequence>
                                </xs:complexType>
                              </xs:element>
                            </xs:sequence>
                          </xs:complexType>
                        </xs:element>
                        <xs:element type="xs:string" name="replyEmailAddressOverride"/>
                        <xs:element type="xs:string" name="replyEmailNameOverride"/>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                  <xs:element type="xs:string" name="emailSubject"/>
                  <xs:element type="xs:string" name="enableWetSign"/>
                  <xs:element type="xs:string" name="enforceSignerVisibility"/>
                  <xs:element type="xs:string" name="envelopeId"/>
                  <xs:element type="xs:string" name="envelopeIdStamping"/>
                  <xs:element type="xs:string" name="envelopeUri"/>
                  <xs:element type="xs:string" name="initialSentDateTime"/>
                  <xs:element type="xs:string" name="is21CFRPart11"/>
                  <xs:element type="xs:string" name="isSignatureProviderEnvelope"/>
                  <xs:element type="xs:string" name="lastModifiedDateTime"/>
                  <xs:element name="lockInformation">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="errorDetails">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element type="xs:string" name="errorCode"/>
                              <xs:element type="xs:string" name="message"/>
                            </xs:sequence>
                          </xs:complexType>
                        </xs:element>
                        <xs:element type="xs:string" name="lockDurationInSeconds"/>
                        <xs:element type="xs:string" name="lockToken"/>
                        <xs:element type="xs:string" name="lockType"/>
                        <xs:element type="xs:string" name="lockedByApp"/>
                        <xs:element type="xs:string" name="lockedByUser"/>
                        <xs:element type="xs:string" name="lockedUntilDateTime"/>
                        <xs:element type="xs:string" name="useScratchPad"/>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                  <xs:element type="xs:string" name="messageLock"/>
                  <xs:element name="notification">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="expirations">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element type="xs:string" name="expireAfter"/>
                              <xs:element type="xs:string" name="expireEnabled"/>
                              <xs:element type="xs:string" name="expireWarn"/>
                            </xs:sequence>
                          </xs:complexType>
                        </xs:element>
                        <xs:element name="reminders">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element type="xs:string" name="reminderDelay"/>
                              <xs:element type="xs:string" name="reminderEnabled"/>
                              <xs:element type="xs:string" name="reminderFrequency"/>
                            </xs:sequence>
                          </xs:complexType>
                        </xs:element>
                        <xs:element type="xs:string" name="useAccountDefaults"/>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                  <xs:element type="xs:string" name="notificationUri"/>
                  <xs:element type="xs:string" name="purgeState"/>
                  <xs:element name="recipients">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="agents" maxOccurs="unbounded">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element name="element">
                                <xs:complexType>
                                  <xs:sequence>
                                    <xs:element type="xs:string" name="accessCode"/>
                                    <xs:element type="xs:string" name="clientUserId"/>
                                    <xs:element name="customFields" maxOccurs="unbounded">
                                      <xs:complexType>
                                        <xs:sequence>
                                          <xs:element type="xs:string" name="element"/>
                                        </xs:sequence>
                                      </xs:complexType>
                                    </xs:element>
                                    <xs:element type="xs:string" name="declinedDateTime"/>
                                    <xs:element type="xs:string" name="declinedReason"/>
                                    <xs:element type="xs:string" name="deliveredDateTime"/>
                                    <xs:element type="xs:string" name="deliveryMethod"/>
                                    <xs:element name="documentVisibility" maxOccurs="unbounded">
                                      <xs:complexType>
                                        <xs:sequence>
                                          <xs:element type="xs:string" name="element"/>
                                        </xs:sequence>
                                      </xs:complexType>
                                    </xs:element>
                                    <xs:element type="xs:string" name="email"/>
                                    <xs:element type="xs:string" name="emailNotification"/>
                                    <xs:element type="xs:string" name="emailRecipientPostSigningURL"/>
                                    <xs:element type="xs:string" name="embeddedRecipientStartURL"/>
                                    <xs:element name="errorDetails">
                                      <xs:complexType>
                                        <xs:sequence>
                                          <xs:element type="xs:string" name="errorCode"/>
                                          <xs:element type="xs:string" name="message"/>
                                        </xs:sequence>
                                      </xs:complexType>
                                    </xs:element

0 个答案:

没有答案