This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Consuming a web service with Mutual Certificates Security Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Consuming a web service with Mutual Certificates Security" Watch "Consuming a web service with Mutual Certificates Security" New topic
Author

Consuming a web service with Mutual Certificates Security

Raj roy
Greenhorn

Joined: Jan 11, 2013
Posts: 18
hello everyone,


I wish to consume a web service which is created in .net. I do not have any code for the service . I have just the WSDL link.

The web service is secured with some Mutual Certificates Security

Kindly let me know the steps to create a web client which can consume the web service.

Raj roy
Greenhorn

Joined: Jan 11, 2013
Posts: 18
no replys yet??

can anyone please help me with this please?

am I violating any rules while asking the question? if yes then please let me know....
Raj roy
Greenhorn

Joined: Jan 11, 2013
Posts: 18
i found out that there is a command keytool through which you can add certificates to the keystore.

i used the following command for creating a keystore:-

keytool -genkey -alias xws-security-client -keyalg RSA -keypass changeit -storepass changeit -keystore keystore.jks

and following aommand to create a teuststore and add a .cer file to it which i have with me

keytool -import -v -trustcacerts -alias xws-security-server -file filename.cer -keystore cacerts.jks -keypass changeit


i executed the command from the jdk/bin directory and the files were generated in the bin folder itself. Then I provided the respective paths in the "Edit WebService Attributes" option in the Netbeans.

After this when I run my client i got following exception :_

Exception in thread "main" java.lang.RuntimeException: com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException: It should be divisible by four
at com.sun.xml.ws.security.impl.policy.CertificateRetriever.digestBST(CertificateRetriever.java:137)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processRequest(SecurityClientTube.java:211)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.client.Stub.process(Stub.java:319)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:157)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at $Proxy43.addTransaction(Unknown Source)
at ARDAPIClient.ARDAPIClient.addTransaction(ARDAPIClient.java:146)
at ARDAPIClient.ARDAPIClient.main(ARDAPIClient.java:78)
Caused by: com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException: It should be divisible by four
at com.sun.xml.wss.impl.misc.Base64.decodeInternal(Base64.java:742)
at com.sun.xml.wss.impl.misc.Base64.decode(Base64.java:730)
at com.sun.xml.ws.security.impl.policy.CertificateRetriever.digestBST(CertificateRetriever.java:134)



The web Service I wish to consume uses symmetric binding. Can anyone tell me what else needs to be done to consume the service?
I also wish to know the meaning of the exception generated. can anyone tell me what i am doing is the right way to go for ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Consuming a web service with Mutual Certificates Security
 
Similar Threads
JSR 172 with CDC application
WS-Security verses SSL and mutual authentication
Select a certificate from a keystore for client authentication
SSL Clarification
Securing jax-ws service on glassfish 3. Good approaches