Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSDL/SOAP Test With soapui

Tags:

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) 
like image 611
samir Avatar asked Jun 05 '11 13:06

samir


People also ask

How do you validate SOAP WSDL?

To validate a SOAP message, open the SOAP message file (screenshot below) and press F8 (or the menu command XML | Validate). Since no WSDL file has been linked to the SOAP message file, the SOAP message is validated according to the rules for SOAP messages.

How do you add SOAP requests in SoapUI?

To do that, click Create SOAP Request in the operation editor. The Open Request dialog will appear. Use it to open one of the existing requests in the project – that is, select a request from the drop-down list, then click OK.


2 Answers

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.

like image 147
Ladislav Mrnka Avatar answered Sep 18 '22 11:09

Ladislav Mrnka


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.

like image 27
Mike Avatar answered Sep 19 '22 11:09

Mike