Error in SOAP-UI while loading the wsdl hosted in localhost - web-services

I am getting the following error while loading a localhost wsdl. If I try other wsdls which are not hosted locally it works fine. Please help.
Error loading [http://localhost:7001/xyz?wsdl]: java.lang.Exception: Failed to load url; http://localhost:7001/xyz?wsdl, 0
Errors from the log
ERROR:com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException
com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlLoader.makeInvalidDefinitionException(WsdlLoader.java:119)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlLoader.loadXmlObject(WsdlLoader.java:112)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:488)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:477)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionCache.update(AbstractDefinitionCache.java:94)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:209)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:131)
at java.lang.Thread.run(Unknown Source)
I have gone through this link and it did not solve the problem.
soapUI failed to load url error when loading wsdl

Based on the errors you're getting, here is a list of possible solutions that come to mind:
Check the URL of the WSDL in a browser. Does it open? If not, your server is not started and the WSDL contract is unreachable.
Make sure you are not using a proxy and you don't have some proxy option set in the SOAP UI preferences
There might be a problem with the validity of your WSDL, but it is impossible to tell without inspecting it.
Hope this helps!

In may case the problem was I was trying to load the .xsd instead the .wsdl
-as both are very similar when open in browser.. is easy to make the mistake.

Added the following parameters to the .vmoptions file, and restarted SoapU helped resolve this for me.
-Dsoapui.https.protocols=TLSv1.2
-Djsse.enableSNIExtension=false
-Djava.net.preferIPv4Stack=true

Related

org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error

I have installed SOAP UI 5.3 in my university system. While loading web services to a new project the following error is appearing:
org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error
I have done all possible solutions given on the Internet.
I was getting two errors:
org.apache.xmlbeans.XmlException:org.apache.xmlbeans.XmlException: error: does not close tag.
I resolved it by soapUI: Error does not close tag.
But I am unable to resolve below one.
https://community.smartbear.com/t5/SoapUI-NG/Resolved-error-does-not-close-tag/td-p/29309, set none in proxy setting in my system.
The error descriptions are misleading. Please suggest if anyone can help me.
I have tried with the following web services:
https://www.w3schools.com/xml/tempconvert.asmx?op=CelsiusToFahrenheit and used other web services as well, but I am unable to load in the SOAPUI project.
In my case, this problem solution was really simple, you just need to add ?wsdl in web service url.
http://localhost/service?wsdl
Seems like Error was misleading

Call JBoss Webservice from another JBoss instance

I was trying to call Webservice on JBoss(A) from another JBoss server(B).
I can invoke Webservice deployed on JBoss(A) nicely from the Webservice Client which I created with source code made by "wsimport".
But when I deploy this client onto JBoss(B) and called from Servlet, the client threw exception.
Root of the exception is
Caused by: javax.xml.ws.WebServiceException: Could not find service named {http://searchrequest}HotelSearchWebService in wsdl http://xxxxxx:8080/schedule_jsf/HotelSearchWebService?wsdl
I double checked urls and names, nothing is wrong.(I mean same names and addresses with local client which works fine)
I was thinking simply deploy Websevice Client on Server and it will work happy forever.
But it seems like some specific configuration needed.
Does someone have any idea?
Or if somebody knows any example source code on the web.
I will be happy with any information.
I have solved the problem.
Somehow my pojo parameters that created by jaxb had empty element name.
When I added annotation attribute, it worked fine.
Now everything is OK, my server is working beautiful.
Thanks for your visit and have a nice day, everyone.

Weblogic WebService client dependencies

I would like to ask which would be the correct jar files needed to a functional ws client to an authenticated weblogic JAX-RPC.
Situation:
I created the same WS client on Jdeveloper and on OEPE. When I run in the IDE, my client only works on Jdeveloper. Then I generated a Jar file from Jdeveloper and the same error from OEPE ocurrs when I run that jar.
I suppose this happens because there are some libs missing. I really need help! After putting many libs on the classpath, this is the mistake:
"Exception in thread "main" javax.xml.rpc.ServiceException: Failed to
parse WSDL htp://url?WSDL weblogic.wsee.wsdl.WsdlException: Failed to
read wsdl file from url due to -- java.net.ConnectException:
Connection refused: connect
at weblogic.wsee.jaxrpc.ServiceImpl.throwServiceException(ServiceImpl.java:185)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:492)
at weblogic.wsee.jaxrpc.ServiceImpl.(ServiceImpl.java:126)
at br.com.scopus.teste.ServicoAssinaturaImplService_Impl.(ServicoAssinaturaImplService_Impl.java:21)
at br.com.scopus.teste.Client.main(Client.java:26) Caused by: weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url d
ue to -- java.net.ConnectException: Connection refused: connect
at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:313)
at weblogic.wsee.wsdl.internal.WsdlDefinitionsImpl.parse(WsdlDefinitions
Impl.java:432)
at weblogic.wsee.wsdl.internal.WsdlDefinitionsImpl.parse(WsdlDefinitions
Impl.java:417)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:81)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:68)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:
483)
... 3 more"
Maybe Important information:
These are the jar I am using: wlfullclient.jar wsclient.jar adf-config.xml weblogic.jar wseeclient.jar wsclient_extended.jar glassfish.jaxws.rt_1.2.0.0_2-1-5.jar
Weblogic version: 10.3.5
Thanks!
This is probably not a library issue.
You are getting "java.net.ConnectException: Connection refused". So the web service stack managed to perform the call to the WSDL URL but couldn't get through. One reason could be that your URL is incorrect, referring the incorrect interface (localhost rather than actual hostname or vice versa) or anything else.
Try to copy-paste the URL it is telling you it can't access in a web-browser and you should see the same problem.

WSDL/SOAP Test With soapui

I have tested my web services (wsdl/soap) with soapui. and i have the errors :
http/log : error 400 BAD REQUEST.
What can be the error please with my wsdl ?
error/log :
un Jun 05 14:10:37 CEST 2011:ERROR:javax.wsdl.WSDLException: WSDLException (at /html): faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions'.
javax.wsdl.WSDLException: WSDLException (at /html): faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions'.
at com.ibm.wsdl.xml.WSDLReaderImpl.checkElementName(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 com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:48)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:66)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:30)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:264)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:44)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:230)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:140)
at java.lang.Thread.run(Thread.java:637)
definitions is a root element of WSDL so it looks like you are not loading WSDL.
Edit:
I tested it and it looks like the whole problem is with your web server. Your web server returns WSDL to browser but it doesn't return it to any tool because these tools are using very minimalistic HTTP requests without many HTTP headers. One of missing headers is Accept. Once this header is not included in the request your server throws HTTP 400 Bad request.
The easy approach to continue is opening WSDL in the browser, save the wsdl to a file and import that file to soapUI instead of the WSDL from URL.
Another possibility is that you need to add ?wsdl at the end of your service url for SoapUI.
That one got me as I'm used to WCFClient which didn't need it.
You can try opening the wsdl in web browser and saving with .wsdl extension. And set the WSDL in SOAP UI project to this .wsdl file.
This really works.
yes, first ensure you added "?wsdl" to your "http......whatever.svc" link.
That didn't fix my problem, though. I had to create a new WCF project from the beginning and manually copy the code. That fixed it. Good luck.
And most important!!!
When you change a namespace in your code, also make sure you change it in web.config!
I faced the same exception while trying to test my web-services deployed to WSO2 ESB.
WSO2 generated both wsdl and wsdl2. I tried to pass a wsdl2 URL and got the above exception. Quick googling showed me, that one of differences between wsdl1.1 and wsdl2.0 is replacing 'definitions' element with 'description'. Also, I found out, that SoapUI does not support wsdl2.
Therefore, for me the solution was to use wsdl1 url instead of wsdl2.
A likely possibility is that your browser reaches your web service through a proxy, and SoapUI is not configured to use that proxy. For example, I work in a corporate environment and while my IE and FireFox can access external websites, my SoapUI can only access internal web services.
The easy solution is to just open the WSDL in a browser, save it to a .xml file, and base your SoapUI project on that. This won't work if your WSDL relies on external XSDs that it can't get to, however.
For anyone hitting this issue in the future: the specific situation here ("the server isn't sending back the WSDL properly") may or may not always be relevant, but two key aspects should always be:
The message faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions' means that the actual content returned is not XML with a base element of "definitions" in the WSDL namespace.
The message WSDLException (at /html) tells you an important clue about what it did find — for this example, /html strongly implies that a normal webpage was returned, rather than a WSDL. Another common situation is seeing something like /soapenv:Reason, which would indicate that the server was trying to treat it as a SOAP call — for example, this can happen if your URL is for the "base" service URL rather than the WSDL.
I had the same problem, and the solution (for me) was to:
open SoapUI Preferences
click on SSL Settings
clear out the KeyStore and KeyStore Password text boxes
untick the bottom checkbox for Client Authentication, requires client authentication.
On AspNet services with .svc endding you must terminate URL as "?wsdl".
Otherwise, SoapUI will try to read the land page HTML of the Service (that is not a WSDL, right?)
Eg.:
http://localhost:1234/WebServices/WsBlahBlahBlah.svc?wsdl

Invalid WSDL request message (HTTP 405) on WSDL request (Glassfish v3)

I've a web service, which is basically a #Stateless EJB annotated with #WebService, and other JAX-WS related annotations. I can deploy this bean on my machine's glassfish instance, and see its WSDL through Glassfish's administrative GUI. I can also call its methods without any problems, from a SE client.
When I deploy this web service to a server instance in any other machine, I can no longer browse its WSDL through glassfish, and the client fails to connect to the server. The message displayed is:
Invalid WSDL request: http://ip:port/context/serviceEndpoint?wsdl
The HTTP error returned by Glassfish on such request is 405 (method not allowed).
I browsed around, and couldn't get anything directly related to glassfish v3. There are issues open on Glassfish's bugzilla for version 2, meaning they're old and have been labelled as CLOSED/FIXED already.
Anyone ran into this before? Any help or any clues about what could be happening here?
Thanks in advance!
For the sake of those who might come across this problem one day: I had OpenSSO on the target server. And by many obvious reasons, it was a classpath clashing problem that prevented the WSDL to be generated by glassfish.
Once OpenSSO has been removed of the equation, everything worked as it was supposed too. So, even if you're not an OpenSSO user, check your classpath for multiple Metro instances, or any other JAX related library that might be conflicting with glassfish's own on your domain.