|
 |
|
|
hi.. i have encountered the following error while converting WSDL2Java:
java.lang.NoClassDefFoundError: org.apache.axis.wsdl.WSDL2Java
plz help mw with the proper solution and reason for this problem. The classpath is set properly and my Wsdl file is running on Apache axis. regards, prince
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Hi
I am trying to consume a web service from .Net. I have used the wsdl.exe and disco methods and all this has done is created the classes for me and I am still unable to actually discover the java web service has any body got any ideas....
Many Thanks
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
|
Hi all. I'm having a problem while writing a web service client to access a web service installed on a remote computer. The web service is the "SRW" ( Search and Retrieve Web Service ). I've already wrote the client code in Java language (helped by WSDL2JAVA tool with Eclipse), and it works fine. Now i need to write it in C# in another computer, to access SRW on the other one. I'm using Visual Studio 2005.
My problem is, while adding the web reference to my project in VS, Vs doesn't recogzine all the classes of the web-service, and i think that's because the Web Service has some classes that are extended by apache axis, in java. The WSDl was generated by apache axis i think... Visual Studio, doesn't have any means to interacting with apache axis on the client side ?
So, resuming i need to access a web service in java, by a C# web client. Do you know any way of interacting Visual sTUDIO with the apache axis ? I'm saying this because i think the problem comes from there... Here's an example of a class SRWSampleServiceLocator in Java, generated by WSDL2JAVA:
################################# public class SRWSampleServiceLocator extends org.apache.axis.client.Service implements gov.loc.www.zing.srw.srw_sample_service.SRWSampleService {
// Use to get a proxy class for SRW private final java.lang.String SRW_address = "http://insertserver/inserturl/";
public java.lang.String getSRWAddress() { return SRW_address; } ################################
Hope you can help. best regards Guilherme
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
VS.net 2005 consumes web services in a different way than Apache AXIS. VS.net will generate only one proxy class and you can use that like any other local class with few exceptions.
For the above example if you try to consume VS.net will only generate one class HelloWorld with methods for calling HelloWorld.SayHelloWorld() synchrolously and asynchronosly.
Please refer to the following tutorial for consuming web services with VS.net. http://www.west-wind.com/presentations/dotnetwebservices/DotNetWebServices.asp[^]
Hope that helps , Fahad
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi ! I've already began to read the page that you supplied. Thank you for that. Like you said, apache axis consume web services in a different way than .NET, but it is possible what i want ? (access a web service consumed by java apache axis, by a .NET c# client) ?
I think i can access the web service, but there are some issues that i've noticed. There are some methods of the SRW web service that have parameters with apache axis types (ex. NonNegativeInteger; PositiveInteger type). My question is, how am i going to access those methods that are required for what i want, without any integration for apache axis data types...? Is it possible a conversion from NonNegativeInteger to an Int type ? or a PositiveInteger type to an Int type ?
best regards
Guilherme
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
If those are classes, then .Net should generate classes for you to use with provided WSDL. If those are convert into just primitive integer, then you will have to do the data checking on the client but this should not be the case.
Can you please post the signature of the method in .NET C# (VS.net 2005) which takes those arguments (PositiveInteger etc)?
Thanks. Fahad
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I have been using NetBeans5.0,Tomcat 5.0 and latest version of Axis. My target is to consume a web service from www.webserviceX.net. But I am not able to do it. I am getting following error "C:\MyJavaPrograms\MyWebServices\nbproject\build-impl.xml:281: taskdef class com.sun.xml.rpc.tools.ant.Wscompile cannot be found"
Let me share with you the procedure I followed: Step 1: I copied the wsdl file called Global Weather from webserviceX.net Step 2: I used wsdl2 Java and I got four files Step 3: I have written code for consuming the service.
I am putting the code for my Java File and the WSDL command I used.
One more thing. I work in a software company and we have proxy alos so please suggest me a solution. public class Weather { /** Creates a new instance of Weather */ public static void main(String [] args) { String Country="India"; try { GlobalWeatherLocator loc = new GlobalWeatherLocator(); GlobalWeatherSoap port = loc.getGlobalWeatherSoap(); System.out.println(port.getCitiesByCountry(Country)); } catch(Exception e) {System.out.println(e.getMessage());} } } java org.apache.axis.wsdl.WSDL2Java http://localhost:8000/Latest/globalweather.wsdl
But, please remember this service is from teh internet.
Pleaase help me out thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Dear Faheed, I downloaded your example. It worked fine. But after that when I try to replace http://localhost/Helloworld... with java org.apache.axis.wsdl.WSDL2Java http://www.webservicex.net/globalweather.asmx?wsdl than I get the following error.
Error java.net.UnknownHostException: www.webservicex.net at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) at java.net.Socket.connect(Socket.java:507) at java.net.Socket.connect(Socket.java:457) at sun.net.NetworkClient.doConnect(NetworkClient.java:157) at sun.net.www.http.HttpClient.openServer(HttpClient.java:365) at sun.net.www.http.HttpClient.openServer(HttpClient.java:477) at sun.net.www.http.HttpClient.(HttpClient.java:214) at sun.net.www.http.HttpClient.New(HttpClient.java:287) at sun.net.www.http.HttpClient.New(HttpClient.java:299) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLC onnection.java:784) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne ction.java:736) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection .java:661) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java:905)
I think there are some proxy issues but not very sure Thanks a lot for your help
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
I consume web services who return text or .. But I have problems to consume web services who return datatable. yeah i have web services in ASP.NET and I try to consume them in Jbuilder 2005. please contact me in mesbih@gmail.com . Thanks a lot.
Mesbih
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
Hello all, Iam able to access the .Net web service using the java client with the help of access...but it is possible if anonymous access is enabled on remote machine where webservice resides. If anonymous access is disabled then how to pass user credentilas from java client usibg axis.
regards, shamim
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
|
 |
|
|
Hi, I am new to webservices.I need to access .NET webservice in Java.The article was very useful.
I am working on windows system.I followed the procedure as mentioned in the article.Everything is working fine.I am able to accesss the .NET webservice through java. The problem I m facing is,executing the same in the "client's system".Its a Sun OS 5.9.I have deployed following jars in the classpath
axis.jar jaxrpc.jar saaj.jar soap.jar wsdl4j-1.5.1.jar commons-discovery-0.2.jar commons-httpclient-3.0-rc2.jar xerces.jar commons-logging-1.0.4.jar
I have written a JSP to access the webservice(called PPDSWebService).I am getting the following error and the JSp is not getting executed
java.lang.NoSuchMethodError at org.apache.axis.deployment.wsdd.WSDDDocument.setDocument(WSDDDocument.java:136) at org.apache.axis.deployment.wsdd.WSDDDocument.(WSDDDocument.java:65) at org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:179) at org.apache.axis.AxisEngine.init(AxisEngine.java:172) at org.apache.axis.AxisEngine.(AxisEngine.java:156) at org.apache.axis.client.AxisClient.(AxisClient.java:52) at org.apache.axis.client.Service.getAxisClient(Service.java:104) at org.apache.axis.client.Service.(Service.java:113) at com.BrooksInstrument.PPDSWebService.PPDSWebServiceLocator.(PPDSWebServiceLocator.java:12) at _oa__html._XXASOBRKGPSS__Contact._jspService(_XXASOBRKGPSS__Contact.java:56) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:484)
This is the error i get in the remote client machine. but in my local system, it works perfectly fine. Can u please help me in solving it out? Waiting for an answer
Thanks, Gowtam
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi, Can you please check the url field in the generated classes. I bet its localhost . Try to change that to the computer name or the IP address and that should solve the problem.
Thanks, Fahad
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Sir,
Thanks for replying.
Please validate my understanding of your reply. The WebService I am using are 1)PPDSWebService and 2)VASEWebService. Let me talk about PPDSWebService, as the other one is similar. By following the steps as in ur article following .java files were generated with a directory structure(package) of com.ABC.PPDSWebService - PPDSWebService.java - PPDSWebServiceLocator.java - PPDSWebServiceSoap.java - PPDSWebServiceSoapStub.java
and 2 additional classes similar to those in .NET - FluidData.java - FluidInfo.java
Similarly for VASEWebService, 4 java files for webservice and few additional java files(similar to .NET) were generated with a directory structure of com.ABC.VASEWebService
As per your answer, I searched for the url field in all the classes generated as mentioned above.But i did not get any entry called "localhost". In PPDSWebServiceLocator file,there was URL field pointing to the DNS name of the system having .NET WebService.
So, i guess i have not understood your reply properly.Sorry.
And, I apologise for not mentioning the problem properly. I have detailed out the reason.I will be thankful to you if u read the following with enough patience.
Actually,I am working in Oracle APPS. I have placed all the java files(compiled and created as JAR)in the server machine(where ORACLE APPS is installed -142.102.27.244)and have written a JSP to access the WebService.When I execute the JSP in my browser(as client for the server - 142.102.27.188) it is working perfectly fine and it is true with all other client systems.The java files for the webservices are not in my local system.It is in the server. For this to happen I have placed following Apache Axis jars in the classpath in the server.because my JSPs placed in the server in a different directory need to access those jars - axis.jar - jaxrpc.jar - saaj.jar - soap.jar - wsdl4j-1.5.1.jar - commons-logging-1.0.4.jar - commons-discovery-0.2.jar
I have compiled the java classes of webservice and created a JAR called com.jar and have placed it in the classpath.
The problem is, Now we need to use the customer's system as our server. So i placed all JSPs,servlet in the remote server(155.130.2.156) but not JARs
When i accessed the JSP without placing any of the Apache Jars and com.jar(webservice), the error is "PPDSWebServiceLocator class is not found".
Now i placed com.jar in the classpath. When i called JSP again, the next error is "org/apache/axis/client/Service.class not found".Now i placed axis.jar in the classpath
So, when i executed the same JSP again, next error was "javax/xml/rpc/ServiceException.class not found".Now i placed jaxrpc.jar in classpath.
Similarly, next error is "org/apache/commons/discovery/tools/DiscoverSingleton".Now i placed commons-logging-1.0.4.jar.
Similarly, next error is "org/apache/commons/discovery/tools/DiscoverSingleton".I placed commons-discovery-0.2.jar in the classpath.
Next error is "org/xml/sax/ContentHandler". Placed xerces.jar in the classpath.
Next error being "javax/xml/soap/SOAPException". For this I placed saaj.jar.
Now I am getting the error(which i am not able to rectify)
Exception in thread "main" java.lang.NoSuchMethodError at org.apache.axis.deployment.wsdd.WSDDDocument.setDocument(WSDDDocument.java:136) at org.apache.axis.deployment.wsdd.WSDDDocument.(WSDDDocument.java:65) at org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:179) at org.apache.axis.AxisEngine.init(AxisEngine.java:172) at org.apache.axis.AxisEngine.(AxisEngine.java:156) at org.apache.axis.client.AxisClient.(AxisClient.java:52) at org.apache.axis.client.Service.getAxisClient(Service.java:104) at org.apache.axis.client.Service.(Service.java:113) at com.ABC.PPDSWebService.PPDSWebServiceLocator.(PPDSWebServiceLocator.java:12) at XXASOBRKGPSS_Controller.main(XXASOBRKGPSS_Controller.java:11)
I do not know the reason behind this error.The classes shown in the stackTrace are present in "axis.jar" In our server(142.102.27.244), i am using the same "axis.jar" without any probelm.Do not know what is going wrong in accessing the same jar from the customers server.
One difference to note down is that, customers server doesnt ask for "wsdl4j-1.5.1.jar",where as our server asks for it. customer server requires "xerces.jar", where as our local server doesnt ask for it.
Thanks for the time spent for me. Waiting for a good tip of solution from you.
Gowtam.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Gowtam,
I am getting the same problem . the expection message is follows. Failure trying to get the Call object; nested exception is: java.lang.NoSuchMethodError: org.apache.axis.client.Stub._createCall()Lorg/apache/axis/client/Call;
If you find the answer, Please send the solution to the following addresss.
ramesh-it.kumar@db.com
S.Rameshkumar
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi
Im getting the same problem, as ramesh..could ne1 who knows the solution please mail it to me my id is sonalq_84@hotmail.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
.Net has a utility called wsdl.exe to generate C# proxy class from any Web Service WSDL file. please use wsdl /? to find help information on how to generate the proxy classes.
More easire way is to use VS.net.
Go to Project -- > Add Web Reference type the Url of your web service and VS.net will create proxy classes for that web services. This will work for a web service written in any language as long as it uses Web Services standards and has a WSDL file. 
Thanks, Fahad
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
yes, i've done this many times, but in this one case it doesn't work...
can you spot what's wrong here???
http://staging.softcoin.com/services/urn:PromotionInterface?wsdl
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
This is an error with the WSDL file Report from 'WSDL Document' is 'There is an error in XML document (798, 18).'. - Namespace prefix 'impl:urn' is not defined.
Try to correct this and give it another go.
The document at the url http://staging.softcoin.com/services/urn:PromotionInterface?wsdl was not recognized as a known document type. The error message from each known type may help you fix the problem: - Report from 'DISCO Document' is 'Discovery document at the URL http://staging.softcoin.com/services/urn:PromotionInterface?wsdl could not be found.'. - The document format is not recognized. - Report from 'WSDL Document' is 'There is an error in XML document (798, 18).'. - Namespace prefix 'impl:urn' is not defined. - Report from 'XML Schema' is 'The root element of a W3C XML Schema should be and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
ok, thank you very much...i get the exact same error and i just wanted to make sure that i wasn't doing something wrong because the person who generated this swears that other .NET developers havn't had this problem...
so thank you again...
badi WS
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |