2011-02-08 46 views
0

我有一个包含以下内容的XSD文件...尝试一个额外的元素添加到XSD文件

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" id="OTA2003A" targetNamespace="http://www.opentravel.org/OTA/2003/05" version="1.000" xmlns="http://www.opentravel.org/OTA/2003/05"> 

    <xs:element name="OTA_VehAvailRateRQ"> 
    <xs:annotation> 
     <xs:documentation>The root tag of OTA_VehAvailRateRQ contains standard payload attributes found in all OTA payload documents. Because the results of the search message could be quite numerous, the request also has an attribute, MaxResponses, indicating the number of replies requested. The attribute ReqRespVersion is a positive integer value that indicates the version number requested for the response message.</xs:documentation> 
    </xs:annotation> 
    <xs:complexType> 
     <xs:sequence> 
     <xs:element name="POS" type="POS_Type"> 
      <xs:annotation> 
      <xs:documentation>Point of Sale Identification. Identification number of the vendor that has made the vehicle availability request and agency number assigned by IATA, ARC, ESRP or TID.</xs:documentation> 
      </xs:annotation> 
     </xs:element> 
     <xs:element name="VehAvailRQCore" type="VehicleAvailRQCoreType"> 
      <xs:annotation> 
      <xs:documentation>Identifies the common, or core, information associated with the request for availability of a rental vehicle.</xs:documentation> 
      </xs:annotation> 
     </xs:element> 
     <xs:element minOccurs="0" name="VehAvailRQInfo" type="VehicleAvailRQAdditionalInfoType"> 
      <xs:annotation> 
      <xs:documentation>Identifies the supplemental information associated with the request for availability of a rental vehicle.</xs:documentation> 
      </xs:annotation> 
     </xs:element> 
     </xs:sequence> 
     <xs:attributeGroup ref="OTA_PayloadStdAttributes"/> 
     <xs:attributeGroup ref="ReqRespVersion"/> 
     <xs:attributeGroup ref="MaxResponsesGroup"/> 
    </xs:complexType> 
    </xs:element> 

我则在WSDL文件中引用此。当我通过类似了SoapUI运行WSDL文件我得到以下输出为SOAP请求......

<soap:Body> 
    <OTA_VehAvailRateRQ EchoToken="XXX1234" Version="1.0" ReqRespVersion="medium" MaxResponses="16" xmlns="http://www.opentravel.org/OTA/2003/05">  
     ... 
     ... 
     ... 
    </OTA_VehAvailRateRQ> 
</soap:Body> 

...到目前为止,一切都很好。现在我需要添加一个元素到XSD文件,以便它会产生以下输出...

<soap:Body> 
    <ns:Request xmlns:ns="http://someurl"> 
     <OTA_VehAvailRateRQ EchoToken="XXX1234" Version="1.0" ReqRespVersion="medium" MaxResponses="16" xmlns="http://www.opentravel.org/OTA/2003/05"> 
      ... 
      ... 
      ... 
     </OTA_VehAvailRateRQ> 
    </ns:Request> 
</soap:Body> 

...注意那里的额外标记。这是我挣扎的地方。有谁知道我应该如何修改原始的XSD来生成额外的标签?当我尝试出现的输出

回答

1

像这样的事情会在外面OTA_VehAvailRateRQ创建请求标签

<xs:schema xmlns:xs=...> 

<xs:element name="Request"> 
<xs:complexType><xs:sequence> 
    <xs:element name="OTA_VehAvailRateRQ"> 
    ... 
    </xs:element> 
</xs:sequence></xs:complexType> 
</xs:element> 
+0

感谢您的答复,因为... 2011-02-08 10:13:33

相关问题