WebService in Java using NetBeans - java

guys!
I'm kinda new to WS, as well to Java, and i wondered if you could help me.
I gotta create a WS ( Don't tell me?! ;) ) and a need to deploy it to TomCat but, i "don't" know how to do it. My WS's are meant to do some access to SP's in a database and return the results.
Simple. Its already done. Used NetBeans, developed, published on my own PC and cretead a desktop application in C# and added the WSs reference. Works great.
The thing is: the people that im going to send my WS are in other State, far away from here. I wanted to know how to do it. I saw that i can right click on the webService (The WS it self, localized inside the WebService projects folder "Web Services" generated by NetBeans) and click on "Generate and copy WSDL", get this wsdl file, send to the people that i want and they put it inside the "WebApps" folder on their TomCat Server, and whoever accesses de server can see my services.
Is that correct? If not, how can i do it?
One more thing: i created a class in java to access the database, with the connection string. There is some kinda of ".config" that i can put these information in? I didn't find that on the WebService project i created...
Thanks for the patience!

Just sending WSDL will be not enough since that just defines the protocol and operations of the WS. It does not say anything about implementation. What you need to do is generate a web archive package (.war, think of it as a .jar for webapp) and send that to the customer that you are writing it for. They can then deploy it on to their server.

Related

How do I send data to a WSDL File from my Spring boot project?

Sorry if this question doesnt make sense, but I don't know how else to ask. Let me describe my problem.
There are two projects A and B. Project B team has provided me with a WSDL File and url. They gave a demo of this API in Soap UI in which if you input data like name, age, address, etc., you get a ticket number in return.
Now my project is in Java Spring boot. I have the data name, age, address, etc., in my project A database. I have to send this to Project B using the url they provided and save the ticket number in the response in my database.
So my question is what exactly do I need to search to learn about this Soap UI and WSDL file? How do I send data to this WSDL file? I am a noob so I dont even know what search terms to google to find this answer. Can anyone explain this process if possible?
Do I need to make a rest template calling this url?
The WSDL file you received, it's just a definition (or schema) of how the server should work (in your case it's as a simulation of project B).
SoapUI is just a utility that runs a simple server, and WSDL defines how this server responds.
So, the WSDL file it's like a config of the SoapUI app. And SoapUI it's a web server simulator.
Your Project A should be able to send HTTP requests. Where to send it? - SoapUI
Looks like Project B consumes SOAP requests. Your WSDL file tells you the requests it supports and the format of each request. Spring with help from the maven-jaxb2-plugin can make this easy for you. This plugin will create Java classes that represent the messages in the WSDL and Spring provides classes that make invoking the requests straight forward. See this for a full example of how to do this.
You can generate classes from given wsdl file. And you can see methods which you must send data.
You can try some ways for generate java classes from wsdl. IntelljIdea or Eclipse or Netbeans or other tools.
Or try reficio lib
https://github.com/reficio/soap-ws

Java Code Cleanup: how can I know about the unused webservice in the project

I am new to web service, I got task to clean up unused soap web service. I have list of topdown and bottom up service. How can I know which services are unused and which ones are using. Please help me. Thanks
You can't know just by looking at the server side code since you don't know what the clients are calling. The only way I can think is to check the access logs for the endpoints. You could then tell which ones are being used for sure, but if a client uses an endpoint very infrequently, that wouldn't be logged recently. You're really only guessing unless you have access to the client code that is using your webservices.

Group WebMethods in WebService

I've got question because I didn't find any answer in all internet.
I'm using Wildfly 8.2.0 and JaxWS WebService by Netbeans 8.0.2, and i'm importing this WSDL output to VisualStudio as Service Reference. I know it's maybe not the best way to do WebAPI but but...
Everything's work great except that all WebMethods are in one place. I've got VisualStudio Client() and structure is Client().AllFunctionsHere.
Can I somehow group WebMethods which as result I will get Client().Login.Auth(), Client().Register.AddNew(), Client().Register.ComparePasswords() etc...
It's theoretically very valuable but I couldn't find solution.
P.S.: I don't want to create few WebServices because I've got "Login" method and a few WebServices don't share session unfortunatelly.

creating web service client from eclipse

Hi I am new to SOAP web services and trying to create a client. I am following This tutorial but the problem which I am facing is Sometimes it generates the client stub in the form of .java files and sometimes it generates proper client with some .jsp pages like test.jsp, intput.jsp etc.
I have tried searching a lot on internet. Please let me know why it generates two different kind of clients though I am following the same process.
I have generated my client using wsimport but I just want to know, what is causing eclipse to generate two different clients at different times. may be some bug or some detail that I have missed.
The difference is most likely caused by selecting a different value in step 6 of the tutorial, when you select which kind of client should be generated: Move the Client slider to the Test Client position .
When you run the Eclipse WTP wizard, you get to choose which client you want to have. The JSPs that are generated are simply an input test form to test your web service.

Java web service call from RDz

I don't know how familiar anyone is with RDz, but if you know IBM mainframe stuff and how webservices work, then maybe you can help me.
My MF has a UNIX side, and a CICS side, and I need to put a java appplication on the UNIX side that can be called from CICS in which invokes a web service from the java program on the unix side, then returns some data.
Anyway, I have everything else working, but I need to know how to invoke a webservice with data that is being passed to me through a CommArea CAH parm. I am kind of a newb to webservice, but it's always nice to learn.
EDIT: This java program needs to be independent and be able to run on its own without any manual operation.
Invoking a web service from a CICS application is done via the INVOKE SERVICE CICS API.
In order for this to work, you begin with the WSDL for the web service you wish to invoke. You run the WSDL through an IBM-supplied program DFHWS2LS (DFH is the IBM abbreviation for all things CICS, WS2LS means Web Service to Language Structure). DFHWS2LS is part of what IBM calls the Web Services Assistant.
Out of DFHWS2LS you will get a web services binding (WSBIND) file and language structures. The language structures you include in your program and move the data from the commarea into them. The WSBIND file you provide to your CICS Systems Programmer so they can include it in the pickup directory for your pipeline. You must also create a pipeline configuration file.
All of which is to say you have asked a very large question. :) There are multi-day courses and books on this subject.

Categories