I am getting the following exception whenever trying to create proxy classes using WSDL.
Few observations :-
1) My WSDL points out/imports following xsd http://200.123.23.196:9090/TOOLBOX/WSDL/temp/temparature.xsd.
If i use the tempratue.xsd in wsdl from above URL, It always fails and throws
following exception in eclipse.
2) If i try to acess the same XSD from diffrent server it works properly and creates
proxy classes (temparature.xsd is available on diffrent servers).
3)Why same XSD is behaving dieffrently on diffrent servers.
4)One more observation :- when i put this url in browser http://200.123.23.196:9090/TOOLBOX/WSDL/temp/temparature.xsd i can not see the content of xsd in browser directly. Instead using other URL i can see the content directly.
IWAB0399E Error in generating Java from WSDL: WSDLException (at /definitions/types/schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'http://200.123.23.196:9090/TOOLBOX/WSDL/temp/temparature.xsd', relative to 'file:/D:/workspaces/globice/LAS/xsd/my_ice.wsdl'.: no content-type: java.net.UnknownServiceException: no content-type
at java.net.URLConnection.getContentHandler(Unknown Source)
at java.net.URLConnection.getContent(Unknown Source)
at java.net.URL.getContent(Unknown Source)
at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
Waiting for replies :)
Thanks in advance
Sam
This line:
java.net.UnknownServiceException: no content-type
suggest that the server is not setting the content-type header to application/xml or text/xml in response to 'http://200.123.23.196:9090/TOOLBOX/WSDL/temp/temparature.xsd'.
Can you verify that?
Related
I just installed a new version of Android Studio and am trying to create a project using the built in templates.
My environment is:
Windows 7, SP1, 64 bit
In a secure domain environment and I am a domain administrator on my machine.
Here is what I am seeing:
C:\Users\stuz\AndroidStudioProjects\test>gradlew compileDebug --stacktrace
Downloading file://C:/Users/stuz/.gradle/wrapper/dists/gradle-1.10-all.zip
Exception in thread "main" java.lang.RuntimeException: java.net.UnknownHostExcep
tion: C
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.net.UnknownHostException: C
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.ftp.impl.FtpClient.doConnect(Unknown Source)
at sun.net.ftp.impl.FtpClient.tryConnect(Unknown Source)
at sun.net.ftp.impl.FtpClient.connect(Unknown Source)
at sun.net.ftp.impl.FtpClient.connect(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Sour
ce)
at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:60)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
The problem is in your gradle/wrapper/gradle_wrapper.properties file. I'm not sure how it happened, but you have an improper URL in there for the downloadable distribution of Gradle. Change that line from this:
distributionUrl=file://C:/Users/stuz/.gradle/wrapper/dists/gradle-1.10-all.zip
to this:
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
This solution worked for me...
Find the file gradlew.bat on your project directory, in that file change DEFAULT_JVM_OPTS variable as below:
set DEFAULT_JVM_OPTS=-Dhttp.proxyHost=YOUR_HOST -Dhttp.proxyPort=PORT -Dhttp.proxyUser=USERNAME -Dhttp.proxyPassword=PASSWORD -Dhttps.proxyHost=YOUR_HOST -Dhttps.proxyPort=PORT -Dhttps.proxyUser=USERNAME -Dhttps.proxyPassword=PASSWORD
then run gradlew clean build.
Check if you are on secure network - if that is the case than in your gradle/wrapper/gradle_wrapper.properties file
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
this line have https in it which is refused by secure network.
I changed to unsecure network and it started working for me.
under you project folder go to : platforms/android/cordova/lib/builders/GradleBuilder.js
find distributionUrl and Remove https with http and replace "services" with "downloads".
distributionUrl=http\://downloads.gradle.org/distributions/gradle-2.4-all.zip
you need to use the windows style file URI to make it valid
Windows Reference for File URI
distributionUrl=file\:///C\:/Users/<your_path_separated_by_/_chars>/gradle-2.4-all.zip
After changing the distribution url to http://services.gradle.org/distributions/gradle-1.10-all.zip .
If you still get unknown host exception for services.gradle.org, try setting the HTTP / HTTPS proxy to your environmental variables . See the below post
https://stackoverflow.com/a/59045565/4468693
Due to change in server configuration, in my project. We apt to proxy server while calling the webservice which is axis2. But the problem, here is we cannot able to access the the endpoint through the soapui(After configuring the proxy configuration in the preference->proxy setting) but i can access the endpoint through eclipse code after configuring the proxy. Here is the exception i am getting in the soapUI logs
Fri Mar 21 19:09:51 IST 2014:ERROR:java.lang.ClassCastException: org.apache.http.message.BasicHttpRequest cannot be cast to org.apache.http.impl.client.RequestWrapper
java.lang.ClassCastException: org.apache.http.message.BasicHttpRequest cannot be cast to org.apache.http.impl.client.RequestWrapper
at com.eviware.soapui.impl.wsdl.support.http.HeadderRequestInterceptor.process(HeadderRequestInterceptor.java:42)
at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:108)
at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:174)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.preProcess(HttpClientSupport.java:106)
at org.apache.http.impl.client.DefaultRequestDirector.createTunnelToTarget(DefaultRequestDirector.java:830)
at org.apache.http.impl.client.DefaultRequestDirector.establishRoute(DefaultRequestDirector.java:739)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:565)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:236)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:345)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:241)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I'm using SoapUI 4.5.1 and facing the same exception. I almost spend my entire day in dubgging it and later on I downloaded SoapUI 5.0.0 and tested same webservice and that works.
By reading http://sourceforge.net/p/soapui/bugs/636/ this URL I found that it was a bug in SoapUI 4.5.1 version.
So better always use the new verions of tool if they are available :)
I am working with a relativly unknown API. (ScrumWorks Pro) I am using it to export data into a SQL database. My issue is that I have moved my eclipse project from one computer to another and it stopped working. It continues to run fine on the old computer but I am getting the following error
Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://XXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl. It failed with:
Got Server returned HTTP response code: 503 for URL: http://XXXXXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl while opening stream from http://dxzbid01.zhi.com:8080/scrumworks-api/api2/scrumworks?wsdl.
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(Unknown Source)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source)
at javax.xml.ws.Service.<init>(Unknown Source)
at javax.xml.ws.Service.create(Unknown Source)
at com.danube.scrumworks.api2.ScrumWorksService.getConnection(ScrumWorksService.java:53)
at main.connectAPI(main.java:69)
at main.main(main.java:12)
Caused by: java.io.IOException: Got Server returned HTTP response code: 503 for URL: http://XXXXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl while opening stream from http://XXXXXXXXXXXXX.com:8080/scrumworks-api/api2/scrumworks?wsdl
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(Unknown Source)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(Unknown Source)
... 11 more
Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: http://XXXXXXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
... 13 more
It looks like while it's running its failing to connect to the host. But it works completely fine with the exact same credentials on the other computer.
The magic words: Server returned HTTP response code: 503. The answer will be in your server logs.
From https://www.rfc-editor.org/rfc/rfc2616#section-10.5.4:
The server is currently unable to handle the request due to a
temporary overloading or maintenance of the server.
make sure that url
http://XXXXXXXXXX:8080/scrumworks-api/api2/scrumworks?wsdl
is accessible, if not able to access the 8080 port, check your firewall settings in that machine (allow that 8080 port to accessible)
The problem was that the newer computer had a newer version of Java installed which broke parts of the API.
UPDATE: I have submitted my question to the CXF User's mailing list, here.
UPDATE: I have currently signed all of my jars. I still can't seem to get CXF setup in a way that it can find the WSDL. My last attempt was to place the WSDL inside of my WAr file so I can access it through a web browser. I set the wsdllocation inside of the client to the URL (http://www.example.com/app/example.wsdl). I am now getting the following exception:
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at com.sun.xml.internal.ws.util.xml.XmlUtil.createDefaultCatalogResolver(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source)
at javax.xml.ws.Service.<init>(Unknown Source)
Googling has turned up pretty much nothing on this.
I am creating a web service client from a given WSDL using Apache CXF. I am running into problems however when trying to access the service, I get this exception:
Can not initialize the default wsdl from ../resource/example.wsdl
Exception in thread "AWT-EventQueue-0" java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
I am not signing my web start application, and would prefer not to since I am not accessing any resources from the client's machine. The WSDL mentioned is packaged within my jar. The problem is caused by this from the CXF generated client code:
URL url = null;
try {
url = new URL("../resource/example.wsdl");
} catch (MalformedURLException e) {
System.err.println("Can not initialize the default wsdl from ../resource/example.wsdl");
// e.printStackTrace();
}
WSDL_LOCATION = url;
How can I correctly point CXF to this WSDL? I am also worried about the WebService annotation on the class:
#WebServiceClient(name = "Example",
wsdlLocation = "../resource/example.wsdl",
targetNamespace = "http://services.example.com/")
Do I also need to change this?
You are going to need to change that wsdlLocation to a classpath: reference.
use -wsdlLocation as shown here.
After a few mistakes and experimentation, I have managed to get everything to work properly. First, MAKE SURE that cxf.jar and wsdl4j.jar are actually on your classpath. I thought I had verified this, but because I was instantiating the client from inside a jar via webstart that was in itself packed in a WAR, I messed up the placement of the cxf runtime in my build process. Also, when specifying the wsdl location, I had to use "classpath:my.wsdl". I made it easy on myself and just put the wsdl in the same location as my source.
Hope this helps someone who might do the same thing at somepoint!
I have a very simple line of code in my source:
XMLReader xmlReaderFactory = XMLReaderFactory.createXMLReader();
This works flawlessly from an application, however, from an applet, it attempts to load a ".class" file from the server (no classname, just the extension just as you see) and then fails to give me a parser.
Exception in thread "Thread-13" java.lang.ClassFormatError: Incompatible magic value 218762506 in class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.xml.sax.helpers.NewInstance.newInstance(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
What could be the problem?
It looks as if you are attempting to configure the use of a SAX implementation other than that in the JRE. The configuration is pointing to a Windows text files starting with at least two empty lines. SAX implementations may be configured through the system property org.xml.sax.driver or contained in a file within a jar of the name META-INF/services/org.xml.sax.driver.
You might be getting back a 404 error from the server for that class file. See this bug report for details.