3
votes

I have a requirement of creating SOAP request xml for one operation from wsdl. I researched and tried the solution of the blog "Java: Get Sample Request XML from wsdl" , but I was getting exception "java.lang.NoClassDefFoundError: org/fife/ui/rtextarea/RTextArea" in line "WsdlProject project = new WsdlProject();"

I imported latest jars (soapui-xmlbeans-4.5.0,wsdl-xmlbeans-1.1,soapui-4.5.0) but still throwing exception. Could anybody"http://www.soapui.org/repository/eviware/" please suggest how can I rectify it. Is there any other approach which I can take apart from this?

Thanks in advance !!

1
Use a SOAPUI tool.... it will help you...soapui.org - Sambhav
Thanks for the reply, but SoapUI will be a manual task. I have write code to extract Soap request xml from wsdl. Could you please tell how can I achieve that. - user3365075
I was using below code WsdlProject project = new WsdlProject; WsdlInterface[] wsdls = WsdlImporter.importWsdl(project, "<wsdl url>"); WsdlInterface wsdl = wsdls[0]; for (com.eviware.soapui.model.iface.Operation operation : wsdl.getOperationList()) { WsdlOperation wsdlOperation = (WsdlOperation) operation; System.out.println("OP:"+wsdlOperation.getName()); System.out.println("Request:"); System.out.println(wsdlOperation.createRequest(true)); System.out.println("Response:"); System.out.println(wsdlOperation.createResponse(true)); } } - user3365075

1 Answers

0
votes
1. Create a Java Project: File->New->Other->Java Project. (TestWSDL)
2. Create a WSDL File: File->New->Other->Web Services->WSDL File-> Name the file->Next->finish. (NewWSDLFile.wsdl)
3. Modify the WSDL File: Open NewWSDLFile.wsdl and replace all its content by your desired WSDL file.Save it. (Suppose I have saved my desired wsdl file at D:\sampleWSDL.xml, which i want to convert. Open this xml file using Notepad++,copy all its content and paste it to NewWSDLFile.wsdl)
4. Create Web Service Client: File->New->Other->Web Services->Web Service Client->Next->Browse Service definition and show the path of the NewWSDLFile.wsdl file we created at step 2 ->OK-> 5. Click Client Project(blue colored link at right) and set it to the project we created at step
6. Press Next -> Set Output Folder->Finish.
7. You will have all the converted Java files at the folder you set at step 5.