Can't create SOAP client in Netbeans existing project - java

I'm trying to follow these tutorials on how to get Netbeans (v 7.1.1) to automatically create a SOAP web service client:
http://netbeans.org/kb/docs/websvc/client.html
http://blog.jdevelop.eu/2008/02/27/creating-soap-web-services-with-netbeans-6/
But I can't seem to find the Web Service from WSDL file type (as shown below) on some of my projects.
Some of my projects do display that file type and some don't. The particular project for which I need to create the SOAP client does NOT list that file type. Why would this be?
They are all Web Application projects as far as I know of (Struts2 + Spring + Hibernate frameworks). I checked them out of subversion from Netbeans projects created by other programmers. It's possible that the original Netbeans project was created in a previous version of Netbeans - not sure if this matters.
How do I get the Web Service from WSDL new file type to show up for my existing project?

'Web Service from WSDL' option only comes when you choose to create Web projects. In the desktop projects(Java), there is a option 'Web Service Client' in which you can specify the wsdl URL and it will create the web service references for you.

Related

Creating a web-services client in Eclipse

I need to create a web services client in java/Eclipse to interface with a test management tool from my java testing code.
I successfully set up the client in NetBeans. This was a fairly painless process using NetBeans' wizard.
However, Eclipse is our IDE of choice, so I need to get the code over to it. I have found and followed steps to implement a web services client in Eclipse. The process in Eclipse is a lot clunkier IMO, but I successfully generated the client.
However, Netbeans and Eclipse don't seem to agree on what the information in the wsdl file means. NetBeans discovers/creates a larger collection of classes in its 'generated sources' folder than Eclipse does.
I must be missing something?
Looking for anyone who tried to create a ws client in both Netbeans and Eclipse, and is able to shed some light on why there are differences in the code created from the wsdl file, and how to work around it.
Thanks.
When you create a client using the wizard "Web Service Client" Eclipse, you are using a runtime for WS. I'm using Java EE developer version of Eclipse Helios (3.6) + JBoss Tools, With JBoss 6.0 server, and I have 4 different runtimes available.
Apache Axis
Apache Axis2
Apache CXF 2.x
JBossWS
Which runtime (framework) are you using under Netbeans?
Using JBossWS, I generated WS client classes from WSDL, and I'm using them in a maven Java EE 6 application, deployed to a JBoss 6.0, and it works perfectly, inside Eclipse and outside (deployed).

Exception in creating webservices from axis2 with tomcat6 server

I am trying to create a webservice from java application.
I am using tomcat 6 server and axis2 ..i had installed axis2 and set the runtime location for axis2 inside Web services>Axis2 preferences.
This is the exception am getting when am trying to create a webservice..
Exception occurred while reading or writing file {0}The Axis2 facets cannot be installed since the Axis2 runtime location has not been set.
Please go to the Web Services preference page and set the Axis2 runtime location under Axis2 Preferences.
Can anyone give a solution for this?
If u have set axis 2 preferences properly then i think u have not set the configuration properly while creating the project in eclipse.
Follow the below steps..
In eclipse go to File- New- Dynamic Web Project..
In configuration select custom and modify..
Check the Axis2 Web Services and click OK..
Follow normal steps afterwards.. It should work now....
Create a dummy dynamic webproject with axis2 feature and ,
then try the old project of yours
Go to your services java file and
right click and choose webservices -->
create webservice -->
choose webservice runtime to axis2 -->
and continue it should work now

weblogic server Test page for web service is different from wsdl

I have problem with weblogic server Test page for web service which is different from wsdl. If i run from Jdeveloper then i get textfileds which i can enter and press invoke at web there is just xml which is wrong. Why Weblogic create wring WS test?
You are mistaking the capabilities of the JDeveloper IDE with basic web service definitions.
WSDL is an XML file, so when you deploy your WSDL on a target server, it will open up and show you the XML content. This is the same as opening the WSDL file in a browser directly.
JDeveloper as an IDE has additional tools that allow embedded testing of the web service, allowing you to pass parameters and see the output.
For testing your WSDL without JDeveloper, you need to write a client that will call the web service and get the results.

Has anyone gotten jax-ws-catalog.xml to resolve schemaLocation locally on Metro?

I have added a jax-ws-catalog.xml to my .war file in order to resolve the schemaLocation locally instead of remotely in . I've followed the example at
Metro User Guide: 2.10. Developing client application with locally packaged WSDL
When I deploy the .war and use soapUI to validate the web service it gets stuck trying to access the schemaLocation http://somehost:8080/CMDB/schemas/common/1.0/CMDBCommonTypes.xsd
The schema and wsdl both validate in Eclipse (using XML Catalog tool for Eclipse). (I can post the contents of my jax-ws-catalog.xml and the relevant xsd and wsdl if that will help.
A Google search turns up lots of other problems with jax-ws-catalog.xml not working in the Metro stack.
Has anyone gotten a jax-ws-catalog.xml to work in Metro?
Where are you placing the jax-ws-catalog.xml and the WSDL files ?
You mentioned that you're using a WAR, but within a WAR the location of jax-ws-catalog.xml depends on whether you're trying to access it as a WS client or as a WS Endpoint publisher (server).
If you're accessing external Web Services from within your WAR, then your jax-ws-catalog.xml needs to go in app.war/WEB-INF/classes/META-INF directory,
Alternatively if you have a contract first web service deployed within your app, and that has the #WSDLLocation annotation, then for that WSDL, jax-ws looks for jax-ws-catalog.xml in app.jar/META-INF
So for client WSDL location app.war/WEB-INF/classes/META-INF/jax-ws-catalog.xml
for contract first WS Endpoints with #WSDLLocation annotation the app.war/META-INF
If you want to do both, i.e. publish (contract first) as well as consume Web Services, then you need to put jax-ws-catalog.xml + WSDLs in both the locations, i.e. app.jar/WEB-INF/classes/META-INF and app.jar/META-INF
I have successfully used the above approach in many of my projects, which simultaneously publish as well as consume web services, and I can guarantee it works as expected.

How to cache a WSDL with Java-WS

I've created an app that interacts with a SOAP service using java WS. I generate classes and manage the WSDL using the built in netbeans functions.
Every time I run the application, it has to download the WSDL and parse it again. The WSDL is frozen at each version so I don't think this is necessary. I've tried to reference it as a local file, but then my app complains it can't find the file when it's installed on another machine.
Does anyone know how I can stop Java WS needing to re-parse the WSDL, or at least cache it locally?
I've figured it out...
This page has the info
Developing client application with locally packaged WSDL

Categories

Resources