• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to acess webservice in java

 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys
I want to access the webservice from one site to my site.Can anybody say me the procedure to add the feature in my struts project.

Thanks in advance

zeet
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this isn't related to JSPs?

There are a lot of different ways to access web services from Java; you might have to be more specific. Or just search the web for web services libraries/projects.
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A lot depends on the kind of information you can get for the web service you want to access.

For example, the big services like Google and Yahoo publish very complete descriptions with example code. Even a published WSDL or WADL file will make your job easier.

Bill
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi William.

I am very new to use the webservice. I want to use wsdl. could you share some basic configuration and procedures to access the webservice. Actually my client has given the url ,classname,methodname and all required details.


Thanks
zeet
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Some basic tutorials to get you started can be found at: http://netbeans.org/kb/trails/web.html
Best wishes!
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ivan
 
hanuman thati
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
if it is an private web service, then get there WSDL document, generate stubs using any wsdl to java tools.
that gives you everything needed for accessing that web service.

 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mr. Thati
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there.

I want to set one string into object by converting into javax.xml.bimd.JAXBElement <t> format.

But I am getting this error
Javax.xml does no exists.


Can anybody help me .??

thanks
zeet
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't say what you're doing when you're getting this error, but the uppercase "J" is suspicious.
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to set one string into one object like


it show the red mark below the bind section.i.e. package javax.xml does not exists
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So ... is that package in your classpath? If not, what have you installed in order to run web services? You need a toolkit like Apache Axis 2 or Metro.
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
should I use the Apache Axis 2 or Metro.jar file ??
But in my netbeans environment it shows the metro library files.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both are good implementations of Java WS, and each has pros and cons. If you already have Metro installed, you might as well use it. Just make sure that it includes are necessary jar files, and that they are always in the classpath when required.

I do not recommend using the WS support of any IDE when starting out learning WS. You will miss out on many details that you will need to understand when developing and debugging WS.
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mr. Dittmer,

Can you say me what necessary jar files are required for WS. which things I should check and what to set in the classpath

Thanks
zeet
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am imported this jar files

soap.jar, activation.jar, mailapi.jar and xerces.jar.

Is there anything more is required to use web service


Thanks in advance
zeet
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anything more is required to use wem service

If everything that you expected to work, is now working, then I guess nothing more is required.
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!