This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Java Client Consuming .NET WCF  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I'm new to the forum and I'm pretty much a novice in JAVA; right now I'm developing a WCF service to be consumed in JAVA applications! I can have WCF and JAVA communicate without security but with security involved it goes to hell in a hand basket!

I keep receiving a WebServiceException thrown from a CertificateException with the problem: "No subject alternative names present". I found a workaround that I want to try just for the sake of learning JAVA which involves overriding that verifies the host name. As such: http://www.coderanch.com/t/134384/Security/Getting-error-No-subject-alternative! I know you're not supposed to use this in production but I would like to play with that. The code is there but how do I apply that with my web service reference classes? I'm using NetBeans 7.0. Client application and WCF service are on the same box.

I've been researching and researching: it seems to me that interoperability between .NET and JAVA is impossible when WCF security settings are configured. Can it be done?

Here are my binding settings if you're familiar with WCF. I can post the WSDL too. I'm using transport security but with message credentials authenticated via username.

 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For testing/dev environment only: Have you found a temp solution?
 
Kibagami Jubei
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

H Paul wrote:For testing/dev environment only: Have you found a temp solution?



Hi Paul, thanks for the reply, no such luck. Moving on to different things. For the sake of everyone's knowledge, has anyone attempted and successfully implemented a JAVA client that consumes a WCF service with WS HTTP security?
 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I did:

create a self-signed certificate with CN=saturn (yes, saturn is my host/machine name)
(this way, there is no need to add any Java code to take care of Host name verification)

1. On WCF side,

a. create a self-signed certificate with CN=saturn (yes, saturn is my host/machine name)
(this way, there is no need to add any Java code to take care of Host name verification)
b. create a self-hosted WCF service + TransportWithMessageCredential + UserName
expose it as https://saturn:portnumber/nameoftheservice

EDITED: add portnumber

2. On Java side, using NETBeans,

a. export the public-key certificate from 1.a (self-signed certificate with CN=saturn)
b. import into trust keystore: glassfish-3.1.1\glassfish\domains\domain1\config\cacerts.jks
This will take care of SSL Handsake between WCF service/server side and GlassFish client side.
c. use Netbeans IDE to wsimport WCF wsdl to have JAX-WS generated class.
d. select the Webservice Reference and right click to add User name/Password using static mode for testing.
(this will take care of username token profile)

That's it.
 
I want my playground back. Here, I'll give you this tiny ad for it:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!