Forum Discussion
- omatzuraSuper ContributorHi Jim,
do the following from your Java code:
1) create a new WsdlProject
2) add your WSDL to the project with the WsdlImporter class
3) add a new WsdlMockService to your project with project.addNewMockService
4) add the desired mockOperation/mockResponses
5) save the project with project.save(..)
ok?
regards!
/Ole
eviware.com - apoorvaOccasional ContributorHi 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,
Jim - omatzuraSuper ContributorHi Jim,
have you resolved this issue?
regards,
/Ole
eviware.com - apoorvaOccasional ContributorHi 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,
Jim - omatzuraSuper ContributorHi,
no, we'll make saveIn public in the next release.. thanks for pointing this out.
regards,
/Ole
eviware.com