Contributions
code to Print SOAP request coming to soapui
Hi All, I am using source distribution of soapui. I am making request to mock service from outside of the soapui.(Making request from JMeter to soapui). Now I want to print soap request's content coming to the soapui. I guess WsdlMockRunner.java class will help me to write some code. I tried out following code in dispatchMockRequest() of WsdlMockRunner.java String requestData = mockRequest.getRequestContent(); System.out.println("SOAP REQUEST "+requestData); but its not working... Can anyone please provide me code to do that. Thanks, Jim1.9KViews0likes1CommentNot able to get data elements in mock response defiend under wsdl:arrayType
Hi All, I have an urgent query. while creating mock response I m not able to get data elements whose are defiend under wsdl:arrayType.. My WSDL looks like this wsdl:arrayType="tns1:License[]" /> And "ArrayOf_tns3_License" is include in one of the operation's response but Elements defined under License[] is not available in mock response. In mock Response its looks like Instead of including all data elements of License. Is there any configuration that I am missing? I will appreciate if any input will be available. Thanks, Jim1.9KViews0likes1CommentRe: Exception in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/Cr
Hi, I found the solution.. when we compile the project using maven.. It create target directory.. In this directory we can find soapui-VersionName.jar I am using soapui 2.0.2 so mine jar file is soapui-2.0.2.jar This jar file contains information about all classes and u have to put the path of this file in classpath then and only then your class will be identify. Does not matter whether u have class file in correct location or not.. make sure u have latest soapui-2.0.2.jar file in ur classpath May be there is alternative solution also but this is working for me now Regards, Jim960Views0likes0CommentsRe: Exception in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/Cr
Hi Ole, I put my class file under following path soapui-2.0.2\target\classes\com\eviware\soapui\CreateWsdlProject.class and my source file is under following path soapui-2.0.2\src\java\com\eviware\soapui\CreateWsdlProject.java and bat file which run CreateWSdlProject class is under soapui-2.0.2\src\dist_standalone\bin\createprojectRunner.bat Looking forward to hear from you. Thanks, Jim960Views0likes0CommentsException in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/Cr
Hi All, I created java program which create mockresponses for web service. I put java file (CreateWsdlProject.java) under com.eviware.soapui and I created bat file under dist_standalone\bin. along with xxxrunner.bat files. I set all classpath as well. My bat file looks like this set JAVA=..\jre\bin\java rem init classpath set CLASSPATH=soapui-2.0.2.jar set CLASSPATH=%CLASSPATH%;..\lib\activation-1.1.jar set CLASSPATH=%CLASSPATH%;..\lib\javamail-1.4.jar ........... ...... set CLASSPATH=%CLASSPATH%;..\lib\bcprov-jdk15-138.jar rem JVM parameters, modify as appropriate set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -Dsoapui.properties=soapui.properties "%JAVA%" %JAVA_OPTS% -cp "%CLASSPATH%" com.eviware.soapui.CreateWsdlProject %* But when I run this bat file it shows me error like Exception in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/CreateWsdlProject I also make sure that class file is also available at above mentioned location.. Is there any other dependencies that I have to look.. I will appreciate if any input will be available. Regards, Jim2.9KViews0likes3CommentsRe: Create MockService through java program rather than using SoapUI GUI
Hi Ole, I am able to generate MockResponse from schema now.. Just need to set one property WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS to true SoapUI.getSettings().setBoolean(WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS ,true); But I have another concern, When I am trying to save project.xml file using Save() method it gives me null pointer excption The problem is public boolean save() { // this give me error because i m not saving project using soapui GUI file = UISupport.getFileDialogs().saveAs(this, "Save project " + getName(), ".xml", "XML Files (*.xml)", new File( path )); ........ //and i cant even call saveIn to bypass save() because saveIn is private method return saveIn(projectFile); } right now i just change the source code and make saveIn to public .. Is there any alternative way to save project? Looking forward to here from you. Thanks, Jim1.1KViews0likes0CommentsRe: generate the MockResponse content from the schema through java program
Hi All, I found one of the approach and its working.. Just set the value of following property to true and its working.. SoapUI.getSettings().setBoolean(WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS ,true); Thanks, Jim673Views0likes0Commentsgenerate the MockResponse content from the schema through java program
Hi All, I am writing script which will generate MockResponse for each MockOperation through java program. I successfully genertated default MockResponse but I want to generate the MockResponse content from the schema.. so it will contain optional element as well. I followed following steps to generate mockresponse. ) create a new WsdlProject 2) added WSDL to the project with the WsdlImporter class 3) added a new WsdlMockService to the project with project.addNewMockService 4) add the desired mockOperation/mockResponses( Here I want MockResponse generated from schema) 5) save the project with project.save(..) I will appreciate if any suggestion will be available. Thanks, Jim1.9KViews0likes1CommentRe: Create MockService through java program rather than using SoapUI GUI
Hi Ole, Thanks for your reply. The steps you mentioned helped me a lot. I have one more concern. I am able to generate MockResponse now. But I want to generate the MockResponse content from the schema.. I guess WsdlMockResponse mockresp =mockope.addNewMockResponse(mockresponseConfig); will do something but not aware how to set mockresponseConfig... Can you please throw some light on this please and provide a couple of line of code which will generate mockresponse from schema.. Thank you for precious time. Regards, Jim1.1KViews0likes0CommentsCreate MockService through java program rather than using SoapUI GUI
Hi, I want to create MockResponse for a particular interface through java program.. I downloaded source code of soapui and successfully build it using maven 1.0.2... Now I am trying to write java program which will create mockservice and save in porject.xml file so later on I can also open in SoapUI as well... I will appreciate if any inpute will available.. Thanks, Jim3.1KViews0likes5Comments