Communicating with web service on SSL - web-services

I have a web service which previously was deployed on http. I used to generate stub classes using wsimport using wsimport http://localhost:8080/MiniForumService/MiniForumService?wsdl.
Now I deployed it on SSL. But when I try to generate the stub classes from it using wsimport https://localhost:8443/MiniForumService/MiniForumService?wsdl but I'm getting the following error:
unable to find valid certification path to requested target
I'm using a self-signed certificate on the server. How can I solve this please? I've googled about but haven't found a solution till now
Thanks and regards,
Krt_Malta

Assuming you use Netbeans and Metro, this tutorial may help you.
This trick is to check the "Secure Service" check-box as described.

Related

Stub client generation Apache CXF

I am seeing one behavior while accessing one wsdl. I used Apache Axis 1.3 as well as JAX-WS wsimport tool to generate client stubs, it is successfully generating stubs.
But when I am using apache-cxf-2.7.18 and using wsdl2java command, it's not generating stubs, giving me error.
WSDL is on https. I added proxy in wsdl2java bat file as well. wsdl contains a which is also on https.
Error I am getting like:
enter image description here
It seems to that it's not able to include underlying wsdl.
Can anybody give me any pointer what I am doing wrong?
I believe, when I am doing any service publishing, it can not be client implementation specific like it is supported by Axis but not CXF. or I can do that? Is there any restriction that could be applied?
(Solution in comments)
The error log shows a connection error when downloading the WSDL, probably due to a misconfiguration of the proxy in wsdl2java when using a SSL connection through maven
Maven is not is not able to download imports using the proxy configuration, since you have downloaded the wsdl, you can also download all referenced url resources to local files and change <wsdl:import location= to use each local file. Use a relative path ./yourfile or a URL format file://path/to/the/file

Generating a WCF client for MODIS Web Service

I want to create a WCF client for MODIS Web Service available on this website: http://daac.ornl.gov/MODIS/MODIS-menu/modis_webservice.html There is a link to WSDL file, which can I use to generate proxy class. The problem is, that this file is somehow malformed, I cannot create clients with .NET tools like Add Service Reference, wsdl.exe or svcutil.exe. When I try to generate proxy class through website, I get following response:
I've tried to download the WSDL file and create proxy class from local copy, but then I've got this error:
These errors are the same for Add Service Reference and for console output of wsdl.exe and svcutil.exe utils. Is there any other way to create a WCF client to this service or is it impossible in .NET?
EDIT-----
I've managed that the problem occurs, becouse the WSDL is in RPC/Endoded standard and .NET tools cannot handle it properly. I've tried to convert it to Document/literal standard but it's still not working. Can somebody look at my WSDL file and check what I have wrong? It's available under this link: https://wklej.to/67rR7
removing wsdl:documentation blocks inside the element
tags helps to generating codes via svcutil.exe or wsdl.exe.
Baseline for this solution
Hopes this helps.

WSDL link for testing Web Service

I would like to know, Is there any WSDL link for web service which is running on HTTPS but not HTTP because I would like to test my client project whether it is working or not.
Please send me the link as soon as possible because it is really important for the project.
Thanks!
You can check with this WSDL. Its from Amazon:
https://fps.amazonaws.com/doc/2008-09-17/AmazonFPS.wsdl
I haven't checked it but it is on HTTPS.

Spring Web Services - WSDL

In your wsdl, is it possible to connect directly to the wsdl(i.e - http://(url)?wsdl.
When I copy the wsdl locally to src/main/resources - I am able to connect generate objects including Web Service client, but when I try to connect to the WSDL that I copied from, I cannot generate. Perhaps I am not understanding QName and wsdllocation and even port for that matter.
I have searched fairly extensively on the web and there aren't that many clear cut examples. I know WebServiceTemplate makes things a LOT easier but without connecting to the WSDL, I cannot connect.
All I am trying to do is connect to the client. So it is a question more about Endpoints.
Also is it best practice to copy the WSDL locally. I am asking this because the client that we are working for has a 100 million environments.
Thanks.
Thanks
WSDL url will be like http://localhost:8080/<< Context-Name >>/<< ServiceName >>?wsdl
If you are generating the wsdl by running a server, then localhost:, should be given. If its a direct wsdl file, then try right clicking and opening it using a web browser. It will simply give you the link. You can use the same link to produce client stubs too.

Secure Webservice Client on Glassfish

I have an secure external webservice at URL https://my-webservice-path?wsdl, and i want to connect to use this. This is a 2-way ssl.
I create a webservice client in following:
Create an java application Application1
at Project window, click Application1 icon -> new -> Web service client
paste my URL at WSDL URL, client type is JAX-WS, package: com.mypackage
finish
But an error appears: Error: An I/O error occured. Received fatal alert: handshake_failure
And i can not create Web Service References. I use Glassfish 3.0.1 server.
I tried to replace the alias s1as in keystore.jks and cacerts.jks of the Glassfish by my keypair and certificate, but it still fails.
I also tried to use wsimport parsing wsdl file but fail:(
I posted this question in Oracle Forum at http://forums.oracle.com/forums/thread.jspa?threadID=2214292&tstart=0 but get no answer.
i've tried to solve this for 2 days :(
What can i do now to solve this problem?
Plz help me, thank you!
please check out the answer from Catchwa in Mutual-authentication with web services. The steps to implement a glassfish based mutual authentication are described in detail.