Creating a gSOAP Client for a Apache CXF Service

Please support our RSS, Web Services and SOAP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Oct 2008
Posts: 1
Reputation: Temeshwarrior is an unknown quantity at this point 
Solved Threads: 0
Temeshwarrior Temeshwarrior is offline Offline
Newbie Poster

Creating a gSOAP Client for a Apache CXF Service

 
0
  #1
Oct 29th, 2008
Hi Com,

I’m currently working on a gSOAP client for an cpache CXF service, who authenticates itself by using RSA-Keys.

But I have no idea how to configure the security header of my client, which is needed by the service

The java code looks similar to this:
RSS, Web Services and SOAP Syntax (Toggle Plain Text)
  1. Map<String,Object> inProps= new HashMap<String,Object>();
  2. inProps.put(WSHandlerConstants.ACTION, "Timestamp Signature Encrypt");
  3. inProps.put(WSHandlerConstants.SIG_PROP_FILE, "wss-server-public.properties");
  4. // only wss-client has private key and can read incoming messages
  5. inProps.put(WSHandlerConstants.DEC_PROP_FILE, "wss-client.properties");
  6. inProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, ClientCallbackHandler.class.getName());
  7.  
  8. Map<String,Object> inProps= new HashMap<String,Object>();
  9. outProps.put(WSHandlerConstants.ACTION, "Timestamp Signature Encrypt");
  10. // only wss-client has private key and can sign outgoing messages
  11. outProps.put(WSHandlerConstants.USER, "wss-client");
  12. outProps.put(WSHandlerConstants.SIG_PROP_FILE, "wss-client.properties");
  13. outProps.put(WSHandlerConstants.ENC_PROP_FILE, "wss-server-public.properties");
  14. outProps.put(WSHandlerConstants.ENCRYPTION_USER, "wss-server");
  15. outProps.put(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
  16. outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, ClientCallbackHandler.class.getName());
  17. outProps.put(WSHandlerConstants.SIGNATURE_PARTS, "{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body");
  18. outProps.put(WSHandlerConstants.ENCRYPTION_PARTS, "{Element}{http://www.w3.org/2000/09/xmldsig#}Signature;{Content}{http://schemas.xmlsoap.org/soap/envelope/}Body");
  19. outProps.put(WSHandlerConstants.ENC_SYM_ALGO, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc");
  20.  
  21.  
  22. WSS4JInInterceptor wssIn = new WSS4JInInterceptor(InProps);
  23. cxfEndpoint.getInInterceptors().add(wssIn);
  24. cxfEndpoint.getInInterceptors().add(new SAAJInInterceptor());
  25.  
  26. WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(OutProps);
  27. cxfEndpoint.getOutInterceptors().add(wssOut);
  28. xfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor());

I already included the wsse Plug-in in my project, but I have no idea how to configure it like my service

Additionally, the service uses a jks file to get private and public key

Could somebody help me or is there any better framework to create C(++)-clients?

I’m looking forward for your ideas

Temesh
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the RSS, Web Services and SOAP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC