2010-07-19 2 views
0

WS-Security를 ​​사용해야하는 WebService 클라이언트에 문제가 있습니다. 나의 고객은 axis2로 작성되었습니다. (물론 내 서버 에뮬레이터와 함께) 암호화를 활성화하지 않으면 작동합니다.signaturePropFile을 사용한 Axis2/rampart 암호화 문제

-Daxis2.xml=axis-repo/conf/axis2.xml -Daxis2.repo=axis-repo 

내가 가진 :

<!--Signature and Encryption : Using the request's certificate--> 
<module ref="rampart" /> 

<parameter name="OutflowSecurity"> 
    <action> 
    <items>Signature</items> 
    <user>mn</user> 
     <passwordCallbackClass>PWCallback</passwordCallbackClass> 
     <signaturePropFile>client.properties</signaturePropFile> 
    <signatureKeyIdentifier>SKIKeyIdentifier</signatureKeyIdentifier> 
    <signatureParts>{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body</signatureParts> 
    </action> 
</parameter> 

을 지금, 나는이 인수 이클립스에서 클라이언트를 호출 할 때 : 나는 axis.xml에 추가하여 암호화 을 활성화

내가 열 수있어
org.apache.axis2.AxisFault: CryptoFactory: Cannot load properties: client.properties 
at org.apache.rampart.handler.WSDoAllSender.processMessage(WSDoAllSender.java:67) 
at org.apache.rampart.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:72) 
at org.apache.axis2.engine.Phase.invoke(Phase.java:318) 
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251) 
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:416) 
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402) 
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) 
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) 
... 
Caused by: java.lang.RuntimeException: CryptoFactory: Cannot load properties: client.properties 
at org.apache.ws.security.components.crypto.CryptoFactory.getProperties(CryptoFactory.java:258) 
at org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:171) 
at org.apache.ws.security.handler.WSHandler.loadSignatureCrypto(WSHandler.java:431) 
at org.apache.ws.security.handler.WSHandler.doSenderAction(WSHandler.java:137) 
at org.apache.rampart.handler.WSDoAllSender.processBasic(WSDoAllSender.java:201) 
at org.apache.rampart.handler.WSDoAllSender.processMessage(WSDoAllSender.java:64) 
... 9 more 
Caused by: java.lang.NullPointerException 
at org.apache.ws.security.components.crypto.CryptoFactory.getProperties(CryptoFactory.java:253) 
... 14 more 

client.properties으로 File 개체입니다. 이 파일을 여러 디렉토리에 넣으려고했으나 Windows에서 작업하는 동안 슬래시 (슬래시, 및 백 슬래시 모두 사용)를 사용하도록 이름이 변경되었지만 아무 도움이되지 않았습니다. 나는이 오류가 발생했습니다 왜

org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 
org.apache.ws.security.crypto.merlin.keystore.type=jks 
org.apache.ws.security.crypto.merlin.keystore.password=mn 
org.apache.ws.security.crypto.merlin.file=mn_keystore.ks 

어떤 생각 :

내 client.properties 파일처럼 보인다?

답변

2

나는 client.propertiesmn_keystore.ks을 에 추가해야한다는 것을 알게되었습니다. 그것이 의도적인지는 모르겠습니다. 내가 선호하는 것은이 .jar 라이브러리에서 두 파일을 모두 가져 오는 것입니다.

EDIT : 다른 환경에서 시도해 보니 별개의 client.properties으로 시도해 보았습니다! 이제 wss4j-1.5.8.jar은 구성 및 키 스토어없이 원래 상태입니다. 내가 왜이 일을 모르는, 그리고이 일을하지 이전 :(

EDIT2

이 :. 이클립스 실행 응용 프로그램이 아마 claaspath하는 프로젝트 디렉토리를 추가하지 않을 때 나는 약간의 .jar에 .properies 파일을 추가 사임하고 이제 메뉴에서 Run-> Debug Configurations를 선택하고 자바 애플리케이션과 클래스 패스 탭을 찾은 다음 오른쪽 패널에서 "User Entries"를 선택하고 "Advanced"버튼을 클릭하고 "Add External Folder"를 선택한다. .properties 파일을 사용하십시오.