header
header
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.
November 23, 2008, 04:24:54 pm
Username: Password:
Login with username, password and session length

Forgot your password?
 
Latest posts of: apoorva
Welcome, Guest. Please login or register.
November 23, 2008, 04:24:54 pm
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

  Show Posts
Pages: [1] 2
1  soapUI / soapUI / code to Print SOAP request coming to soapui on: August 22, 2008, 12:39:39 am
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,
Jim
2  soapUI / soapUI / Not able to get data elements in mock response defiend under wsdl:arrayType on: August 20, 2008, 07:09:38 am
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

 <complexType name="ArrayOf_tns3_License">
  <complexContent>
  <restriction base="soapenc:Array">
  <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:License[]" />
  </restriction>
  </complexContent>
 </complexType>

<complexType name="License">
  <sequence>
  <element name="priceValue" nillable="true" type="soapenc:string" />
  <element name="priceMethod" nillable="true" type="soapenc:string" />
  <element name="type" nillable="true" type="soapenc:string" />
  <element name="priceBasis" nillable="true" type="soapenc:string" />
  <element name="currentEvent" nillable="true" type="tns1:Event" />
  <element name="id" nillable="true" type="soapenc:string" />
  </sequence>
</complexType>

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
<sid xsi:type="urn:ArrayOf_tns3_License" soapenc:arrayType="data:License[]"/>

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,
Jim
3  soapUI / soapUI / Re: Exception in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/Cr on: July 29, 2008, 11:02:54 pm
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,
Jim
4  soapUI / soapUI / Re: Exception in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/Cr on: July 28, 2008, 11:29:23 pm
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,
Jim
5  soapUI / soapUI / Exception in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/Cr on: July 28, 2008, 08:18:57 pm
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,
Jim
6  soapUI / soapUI / Re: Create MockService through java program rather than using SoapUI GUI 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
7  soapUI / soapUI / Re: generate the MockResponse content from the schema through java program on: July 21, 2008, 10:27:43 pm
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,
Jim
8  soapUI / soapUI / generate the MockResponse content from the schema through java program on: July 21, 2008, 07:21:58 pm
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,
Jim
9  soapUI / soapUI / Re: Create MockService through java program rather than using SoapUI GUI 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
10  soapUI / soapUI / 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
11  soapUI / soapUI / Re: Replace "?" with default value in MockResponse using Groovy Script on: July 07, 2008, 09:50:45 pm
Hi Ole,

Thanks for your reply... But I want to replace with specific value, not random one and  I write following script to do this

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "Request 1#Response" )

holder.namespaces["ns"] = "http://sidmgmt.com/xsd"
def res = holder.getNodeValue( "//ns:results" )

def ret = groovyUtils.getXmlHolder(res)
ret.namespaces["ns1"] = "http://service.bds.com/xsd"
def codevalue = ret.getNodeValue( "//ns1:code" )
ret.setNodeValue("//ns1:code", "400") //not sure

I got following error
 com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; java.lang.NullPointerException

Can you please suggest whats the suggested argument value in getXmlHolder to get access to mockResponse..


Thanks,
Jim
12  soapUI / soapUI / Replace "?" with default value in MockResponse using Groovy Script on: July 03, 2008, 10:28:21 pm
Hi All,

I created MockResponse for one of the operation in MockService.

By default, Default value for all elements in MockResponse is "?".
Now I want to insert some value instead of "?" in MockResponse using groovy script...

My MockResponse is looks like below

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:getSidInformationResponse xmlns:ns="http://sidmgmt.com">
         <ns:return type="com.SidInfoResp"    xmlns:ax28="http://dto.group.com/xsd" xmlns:ax22="http://service.bds.com/xsd" xmlns:ax24="http://dto.sidmgmt.com/xsd" xmlns:ax26="http://dto.action.com/xsd" xmlns:ax21="http://sidmgmt.com/xsd">
            <ax21:devices type="com.sidmgmt.dto.Device">
               <ax24:api>?</ax24:api>               
               <ax24:language>?</ax24:language>
               <ax24:lastUsed>?</ax24:lastUsed>
   
               <!-- 1 or more occurence of licenses element -->
               <ax24:licenses type="com.sidmgmt.dto.License">                 
                    <ax24:itemName>?</ax24:itemName>
                    <ax24:itemVersion>?</ax24:itemVersion>
                    <ax24:lastEvent type="com.sidmgmt.dto.Event">                     
                             <ax24:customerId>?</ax24:customerId>
                             <ax24:custType>?</ax24:custType>                     
                             <ax24:eventSource xsi:nil=?  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>                     
                    </ax24:lastEvent>
                    <ax24:price>?</ax24:price>                                   
                    <ax24:priceMethod>?</ax24:priceMethod>
                    <ax24:type xsi:nil=? xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
              </ax24:licenses>
          
            </ax21:devices>
            <ax21:results type="com.Result">
               <ax22:code>?</ax22:code>
               <ax22:message>?</ax22:message>
            </ax21:results>
            <ax21:sid>?</ax21:sid>
         </ns:return>
      </ns:getSidInformationResponse>
   </soapenv:Body>
</soapenv:Envelope>


I will appreciate if any input will be available.

Regards,
Jim
13  soapUI / soapUI / Re: Missing soapUI project file..(Soapui-2.0.2 in unix environment) on: July 03, 2008, 07:52:46 pm
Thanks Robert for your suggestion.

I also found alternate way not good enough but able to start mockservice now..

I removed -m option and simply passing one argument project name..

sh mockservicerunner.sh "/local/mnt/home/camadmin/soapui-2.0.2/SIDManagement-soapui-project.xml"

Regards,
Jim
14  soapUI / soapUI / Missing soapUI project file..(Soapui-2.0.2 in unix environment) on: July 01, 2008, 10:02:58 pm
Hi,

I download soapui2.0.2 in Unix. I copied soapui-project-file.xml from windows environment to unix. And I changed the value of <con:setting id="ProjectSettings@projectRoot"> path-value </con:setting> of soapui-project.xml file corresponding my unix's user path. I gave input fromURL to load WSDL in project.

I dont have GUI environment in Unix. when I try to run mockservice from command line

sh mockservicerunner.sh -m"SidManagementWSSOAP11Binding MockService" "/local/mnt/home/camadmin/soapui-2.0.2/SIDManagement-soapui-project.xml"

I found following error..
================================
=
= SOAPUI_HOME = /home/camadmin/soapui-2.0.2
=
================================
soapUI 2.0.2 MockService Runner
usage: mockservicerunner [options] <soapui-project-file>
 -s    Sets the soapui-settings.xml file to use
 -a    Sets the url path to listen on
 -b    Turns off blocking read for termination
 -m    Specified the name of the MockService to run
 -p    Sets the local port to listen on

Missing soapUI project file..


I will appreciate if anyone provide input please.

Thanks in advance

Regards,
Jim
15  soapUI / soapUI / Re: Failed to find matching operation for request on: June 24, 2008, 01:11:12 am
Hi Ole,

Thank you for your reply.

I tried with other project as well which also contains two inferfaces like 11 and 12. But now I am not able to create MockResponse for 12 interface but able to create in 11 one; which is opposite behaviour of my previous case..

Is there any specific behaviour in the scenario while having two interfaces or we can create mockResponse for only one of the interface.

MockService concept is excellent but surprised with this kind of wierd behaviour..

Thanks,
Jim
Pages: [1] 2


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
header header
header
header