Contact Us
About Us
News
Home
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome,
Guest
. Please
login
or
register
.
January 09, 2009, 06:41:40 am
Username:
Password:
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forgot your password?
Create MockService through java program rather than using SoapUI GUI
Welcome,
Guest
. Please
login
or
register
.
January 09, 2009, 06:41:40 am
News:
The Forums are up! Welcome to eviware.
Eviware Forum
soapUI
soapUI
Create MockService through java program rather than using SoapUI GUI
« previous
next »
Pages:
[
1
]
Author
Topic: Create MockService through java program rather than using SoapUI GUI (Read 595 times)
apoorva
Newbie
Posts: 16
Create MockService through java program rather than using SoapUI GUI
«
on:
July 16, 2008, 07:57:07 pm »
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,
Jim
Logged
omatzura
Administrator
Hero Member
Posts: 1,666
Re: Create MockService through java program rather than using SoapUI GUI
«
Reply #1 on:
July 17, 2008, 10:26:09 am »
Hi 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
Logged
apoorva
Newbie
Posts: 16
Re: Create MockService through java program rather than using SoapUI GUI
«
Reply #2 on:
July 17, 2008, 11:46:37 pm »
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,
Jim
Logged
omatzura
Administrator
Hero Member
Posts: 1,666
Re: Create MockService through java program rather than using SoapUI GUI
«
Reply #3 on:
July 22, 2008, 08:34:22 am »
Hi Jim,
have you resolved this issue?
regards,
/Ole
eviware.com
Logged
apoorva
Newbie
Posts: 16
Re: Create MockService through java program rather than using SoapUI GUI
«
Reply #4 on:
July 23, 2008, 12:06:02 am »
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,
Jim
Logged
omatzura
Administrator
Hero Member
Posts: 1,666
Re: Create MockService through java program rather than using SoapUI GUI
«
Reply #5 on:
July 23, 2008, 09:37:49 am »
Hi,
no, we'll make saveIn public in the next release.. thanks for pointing this out.
regards,
/Ole
eviware.com
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> eviware general
-----------------------------
soapUI
-----------------------------
=> soapUI
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.2
|
SMF © 2006-2007, Simple Machines LLC
Loading...