2011-06-23 12 views
2

XMLSchemaを使用してデータ形式を厳密にする必要がある新しいWebサービスを作成します。しかし、ColdFusion Webサービスでdetail xmlスキーマを適用する方法を見つけることができませんでしたColdFusion Webサービスにxmlスキーマを追加する方法

WebサービスはXMLとして情報を渡しており、XML Schemaで特定されなければならない厳密な形式である必要があります。情報が渡されます。

<wsdl:types> 
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
     <xs:element name="UpdatePendingTicketsRequest"> 
      <xs:complexType> 
       <xs:sequence> 
        <xs:element ref="SIMS_REPLY_NAVISION_TO_INTOUCH"> 
     </xs:element> 
       </xs:sequence> 
      </xs:complexType> 
     </xs:element> 
     <xs:element name="UpdatePendingTicketsResponse"> 
     <xs:simpleType>    
      <xs:restriction base="xs:string"> 
       <xs:enumeration value="OK"/> 
       <xs:enumeration value="ERROR_PROCESSING"/> 
      </xs:restriction> 
     </xs:simpleType> 
     </xs:element> 
     <xs:simpleType name="ST_STATUS"> 
      <xs:restriction base="xs:integer"> 
       <xs:enumeration value="1"/> 
       <xs:enumeration value="2"/> 
       <xs:enumeration value="99"/> 
      </xs:restriction> 
     </xs:simpleType> 
     <xs:element name="TRANSACTIONS"> 
      <xs:complexType> 
       <xs:sequence> 
        <xs:element ref="TRANSACTION" maxOccurs="unbounded"/> 
       </xs:sequence> 
      </xs:complexType> 
     </xs:element> 
     <xs:element name="TRANSACTION"> 
      <xs:complexType> 
       <xs:sequence> 
        <xs:element ref="ORIGINAL_TRANSACTION_ID"/> 
        <xs:element ref="STATUS"/> 
       </xs:sequence> 
      </xs:complexType> 
     </xs:element> 
     <xs:element name="STATUS"> 
      <xs:complexType> 
       <xs:simpleContent> 
        <xs:extension base="ST_STATUS"> 
         <xs:attribute name="description" use="required"> 
          <xs:simpleType> 
           <xs:restriction base="xs:string"> 
            <xs:enumeration value="DUPLICATE"/> 
            <xs:enumeration value="OK"/> 
            <xs:enumeration value="PROBLEM"/> 
           </xs:restriction> 
          </xs:simpleType> 
         </xs:attribute> 
        </xs:extension> 
       </xs:simpleContent> 
      </xs:complexType> 
     </xs:element> 
     <xs:element name="SIMS_REPLY_NAVISION_TO_INTOUCH"> 
      <xs:complexType> 
       <xs:sequence> 
        <xs:element ref="DATETIME"/> 
        <xs:element ref="TRANSACTIONS"/> 
       </xs:sequence> 
      </xs:complexType> 
     </xs:element> 
     <xs:element name="ORIGINAL_TRANSACTION_ID" type="xs:string"/> 
     <xs:element name="DATETIME" type="xs:dateTime"/> 
     <xs:element name="FaultStructure"> 
     <xs:complexType > 
      <xs:sequence> 
       <xs:element type="xs:string" name="FaultCode"/> 
       <xs:element type="xs:string" name="FaultString"/> 
      </xs:sequence> 
     </xs:complexType> 
    </xs:element> 
    </xs:schema> 
</wsdl:types> 

これはペイロードを検証するためのサンプルXMLスキーマです。しかし、私がColdfusionで同じものを作成すると、これがすべて得られます。

<wsdl:types> 
    <schema targetNamespace="http://rpc.xml.coldfusion" xmlns="http://www.w3.org/2001/XMLSchema"> 
    <import namespace="http://xml.apache.org/xml-soap"/> 
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> 
    <complexType name="CFCInvocationException"> 
    <sequence/> 
    </complexType> 
    </schema> 
</wsdl:types> 

私は多くの検索を行い、決して具体的な解決策を見出しませんでした。

答えて

1

これは答えになるかもしれませんが、XML文書を引数として受け取るためにColdFusionでWebサービスを構築しないことを常にお勧めします。その代わりに引数としてxml stringを使用します。これは後でxmlParse()を使用してxmlドキュメントに変換できます。私は過去にこのような経験があり、後でxml文字列引数に変換する必要があります。

ありがとうございました Pritesh

関連する問題