• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Call https .net webservice using Java client

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Friends,

I got a new task to call https .net webservice using Java client.

I could successfully able to call http .net webservice using "wsimport" command and write simple client code to access the service
But in case of https service I am not sure how to proceed after enough search on net.

Have so many doubts like
1. Is it mandatory to use web server like tomcat to call https webservice?
2. Can I import the utility files provided by the web service using wsimport command for https services?
3. I got .pfx certificate from client but not sure how to use it further to access https service
4. Is this version "JAX-WS RI 2.1.1 in JDK 6" suit to call https service

I really appreciate if you could answer these or in simple you just guide me to call https service using java client
Because I do not find any narrow down procedure to do so. And this thread can be followed by people like me.

Thanks in advance.

Thanks,
Bob
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Bob,

I'm relatively new to web services, so don't quote me 100%, but I'll give my best shot at some of your issues.

1. Is it mandatory to use web server like tomcat to call https webservice?
You need to use a web / application server of some sort to host web services (the service end), but you do not need one to call web services (the client end)

2. Can I import the utility files provided by the web service using wsimport command for https services?
I'm not really certain of what you mean by this. All wsimport does is generate artifacts based on the provided WSDL. Any "utility" required should be either made into a public operation (method) on the WSDL, or used in the back-end of the service and not be required by the user.

3. I got .pfx certificate from client but not sure how to use it further to access https service
To use a certificate, you're going to want to read about Java TrustStore and KeyStore. In a nutshell, the process entails using the keytool program (part of the JDK) to install a certificate into your TrustStore, then setting a bunch of TrustStore / KeyStore system properties within your application prior to making your web service call in order to use them.

4. Is this version "JAX-WS RI 2.1.1 in JDK 6" suit to call https service
JAX-WS is the default (basic) web service implementation that comes with the JDK. There are several others out there, though it shouldn't matter to much which one you use. In my limited experience building clients I've used Axis 1 (now quite outdated) and, more recently, Metro.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
1. A web service client can be an application or component running in a Java EE container, it can also be a standalone program running in a Java SE environment. Thus: Your web service client does not need to run in Tomcat, unless you have additional requirements that demands this.
2. Normally, the WSDL is accessed using normal HTTP protocol, while the web service is accessed HTTPS protocol, so you should be able to use wsimport.
If this is not the case then you may run into some problems, especially if the web service require mutual authentication.
3. Check this article: http://www.oracle.com/technology/pub/articles/dev2arch/2006/08/pfx-pem-certificate-formats.html
4. Yes.
Best wishes!
 
Bob Don
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response..

But still I may not able to import the stubs provided by the https web service using wsimport command
I have installed the .pfm certificate on IE
And thorugh cmd mode when I try d:>wsimport https://.../service.asmx?WSDL

Result in error as
parsing WSDL...

[ERROR] Failed to read the WSDL document: https://../service.asmx?WSDL, because 1) could not find the document; /2) the docum
ent could not be read; 3) the root element of the document is not <wsdl:definiti
ons>.
unknown location

Failed to parse the WSDL.


Is this what I am doing is right? Please correct me.

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
It does not help you that you import the certificates in your browser when you later try to use wsimport to generate client artifacts. The wsimport command will not use the browser certificates. However, you can try to download the WSDL using your browser and then run wsimport on a local copy of the WSDL. Be sure to also download any XML schemas imported by the WSDL and modify the WSDL so it imports the local copies.
Best wishes!
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does it make a difference, if I use wsimport or NetBeans of JDeveloper 11g to create the stubs?

I mean, though I am not sure of, but I think, when generated via netbeans, the client code uses annotations, which is not the case with wsimport.

Can anyone please let me know. I really really need to know about all this.
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic