2010-11-16 73 views
4

我正在使用AXIS2框架来创建我的webservices。现在我使用ramprt来保护我的web服务。现在整个请求和响应将被签名和加密。在SOAP UI中测试安全的webservivce

现在我的疑问是如何在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> 

现在何W能我把数字证书相关的数据,我怎么可以加密我想发送到Axis服务器的内容。

感谢, 纳伦德拉

回答

2

证书数据存储在两个XML文件中的Outflowsecurity.xml和Inflowsecurity.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> 

的更多信息,请到到the Apache help Page

要在请求中使用认证,您需要添加一个标签到AP:头

<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" 
当然,这仅仅是架构的实际的XML具有不同elementnames
+0

? – almightyBob 2010-11-16 13:07:53

+0

我该如何使用它肥皂UI的 – Narendra 2010-11-18 04:15:48

+0

我在http://wso2.org/library/3190#With_security上找到了这个信息,所以如果有什么不清楚的地方,请尝试在那里寻找。事实上,你只应该看看那里,它有一步一步的指导与Apache垒工作。 greez – almightyBob 2010-11-18 09:46:44