4

Web サービスの作成に AXIS2 フレームワークを使用しています。これで、ramprt を使用して Web サービスを保護することができました。これで、リクエストとレスポンス全体が署名され、暗号化されます。

今私の疑問は、SOAP UIでどのようにテストできるかです。wsdl ファイルをロードすると、以下のようになります。

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soapenvelope"
       xmlns:sam="http://sample03.policy.samples.rampart.apache.org">
    <soap:Header/>
     <soap:Body>
        <sam:echo>
              <!--Optional:-->
              <sam:args0>?</sam:args0>
        </sam:echo>
    </soap:Body>
  </soap:Envelope>

デジタル証明書関連のデータを配置する方法と、軸サーバーに送信するコンテンツを暗号化する方法を教えてください。

ありがとう、ナレンドラ

4

1 に答える 1

2

証明書データは、Outflowsecurity.xml と Inflowsecurity.xml の 2 つの xml ファイルに保存され、次のようになります。

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="action">
        <xs:annotation>
            <xs:documentation>Outflow security 'action' configuration</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="items" type="xs:string"/>
            <xs:element name="user" type="xs:string"/>
            <xs:element name="passwordCallbackClass" type="xs:string" minOccurs="0"/>
            <xs:element name="signaturePropFile" type="xs:string" minOccurs="0"/>
            <xs:element name="encryptionPropFile" type="xs:string" minOccurs="0"/>
            <xs:element name="encryptionPropFile" type="xs:string" minOccurs="0"/>
            <xs:element name="signatureKeyIdentifier" type="xs:string" minOccurs="0"/>
            <xs:element name="encryptionKeyIdentifier" type="xs:string" minOccurs="0"/>
            <xs:element name="encryptionUser" type="xs:string" minOccurs="0"/>
            <xs:element name="signatureParts" type="xs:string" minOccurs="0"/>

            <xs:element name="encryptionParts" type="xs:string" minOccurs="0"/>
            <xs:element name="optimizeParts" type="xs:string" minOccurs="0"/>
            <xs:element name="encryptionSymAlgorithm" type="xs:string" minOccurs="0"/>
            <xs:element name="EmbeddedKeyCallbackClass" type="xs:string" minOccurs="0"/>
            <xs:element name="encryptionKeyTransportAlgorithm" type="xs:string" minOccurs="0"/>
            <xs:element name="EmbeddedKeyName" type="xs:string" minOccurs="0"/>
            <xs:element name="timeToLive" type="xs:string" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

</xs:element>

詳細については、Apache ヘルプ ページを参照してください。

リクエストで認証を使用するには、soap:Header にタグを追加する必要があります

<soapenv:Header>
    <wsse:Security
        soapenv:mustUnderstand="1">
        <wsu:Timestamp
            wsu:Id="Timestamp-31497899">
            <wsu:Created>2008-02-06T13:39:50.943Z</wsu:Created>
            <wsu:Expires>2008-02-06T13:44:50.943Z</wsu:Expires>
        </wsu:Timestamp>
        <wsse:UsernameToken
            wsu:Id="UsernameToken-10697954">
            <wsse:Username>apache</wsse:Username>
            <wsse:Password
                Type="http://...#PasswordText">password</wsse:Password>
        </wsse:UsernameToken>
    </wsse:Security>
</soapenv:Header>

名前空間は次のとおりです。

xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
于 2010-11-16T13:06:28.677 に答える