Jigeshs Shahs

Greenhorn
+ Follow
since May 28, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jigeshs Shahs

Hi All,
I am a Software Tester and want to verify that the response for my WSDL is correct or not
So I got a piece of code which generates the response for WSDL

Given below is the WSDL , the Request and the Code

WSDL
http://user.rumba.int.pearsoncmg.com/UserLifeCycle/UserLifeCycleReadV3.wsdl

Request

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v3="http://user.rws.pearson.com/doc/V3/">
<soap:Header/>
<soap:Body>
<v3:GetUserByUserNameRequest>
<v3:UserName>rumba_test_1_ynj</v3:UserName>
<!--Optional:-->

</v3:GetUserByUserNameRequest>
</soap:Body>
</soap:Envelope>

Code

package RumbaCom;

import java.net.*;
import java.io.*;

public class PostXml {

public static void main(String[] args) {

try {

String xmldata="<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:v3=\"http://user.rws.pearson.com/doc/V3/\">"+
"<soap:Header/>"+
"<soap:Body>"+
"<v3:GetUserByUserNameRequest>"+
"<v3:UserName>rumba_test_1_ynj</v3:UserName>"+

"</v3:GetUserByUserNameRequest>"+
"</soap:Body>"+
"</soap:Envelope>";



//Create socket
String hostname = "user.rumba.int.pearsoncmg.com";
int port = 80;
InetAddress addr = InetAddress.getByName(hostname);
Socket sock = new Socket(addr, port);

//Send header
String path = "/UserLifeCycle/services/read/V3";
BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream()));
// You can use "UTF8" for compatibility with the Microsoft virtual machine.
wr.write("POST " + path + " HTTP/1.0\r\n");
wr.write("Host: user.rumba.int.pearsoncmg.com\r\n");
wr.write("Content-Length: " + xmldata.length() + "\r\n");
wr.write("Content-Type: text/xml; charset=\"utf-8\"\r\n");
wr.write("\r\n");

//Send data
wr.write(xmldata);
wr.flush();

// Response
BufferedReader rd = new BufferedReader(new InputStreamReader(sock.getInputStream()));
String line;
while((line = rd.readLine()) != null)
System.out.println(line);
} catch (Exception e) {
e.printStackTrace();
}
}
}


When I try to run the code with my WSDL it is giving me the following Error but when I use the same code to Test the WebService which contains WWW it works fine and generates correct Reponse For e.g.http://www.webservicex.net/CurrencyConvertor.asmx?wsdl

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 4758
Date: Mon, 30 Apr 2012 09:29:47 GMT
Connection: close

<html><head><title>Apache Tomcat/6.0.35 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.ws.soap.axiom.AxiomSoapMessageCreationException: Could not create message: Transport level information does not match with SOAP Message namespace URI; nested exception is org.apache.axiom.soap.SOAPProcessingException: Transport level information does not match with SOAP Message namespace URI
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)




I am unable to understand what is going and I dont know much about the WebServices
I want to use this code for My Automation Task and I don't want to use SOAP UI to Test the WebServices
Can anybody please help me on this to resolve the code

Thanks,
Jigesh Shah
Hi All,
I am a Software Tester and want to verify that the response for my WSDL is correct or not
So I got a piece of code which generates the response for WSDL

Given below is the WSDL , the Request and the Code

WSDL
http://user.rumba.int.pearsoncmg.com/UserLifeCycle/UserLifeCycleReadV3.wsdl

Request


When I try to run the code with my WSDL it is giving me the following Error but when I use the same code to Test the WebService which contains WWW it works fine and generates correct Reponse For e.g.http://www.webservicex.net/CurrencyConvertor.asmx?wsdl

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 4758
Date: Mon, 30 Apr 2012 09:29:47 GMT
Connection: close

<html><head><title>Apache Tomcat/6.0.35 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.ws.soap.axiom.AxiomSoapMessageCreationException: Could not create message: Transport level information does not match with SOAP Message namespace URI; nested exception is org.apache.axiom.soap.SOAPProcessingException: Transport level information does not match with SOAP Message namespace URI
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

I am unable to understand what is going and I dont know much about the WebServices
I want to use this code for My Automation Task and I don't want to use SOAP UI to Test the WebServices
Can anybody please help me on this to resolve the code

Thanks,
Jigesh Shah
11 years ago
Hi,
Thanks Tim . Can you please elaborate on this one or can you give me any reference for the same.
11 years ago
Hi All,

I am a Software Tester and want a code through which I can send a SOAP request to a WSDL
So anybody having an idea regarding the code or any reference through which I can do it
I don't wont to do it through SOAP UI tool as I want to embed this thing in my existing Automation code

Below is the WSDL
http://www.webservicex.net/CurrencyConvertor.asmx?wsdl

Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/">
<soapenv:Header/>
<soapenv:Body>
<web:ConversionRate>
<web:FromCurrency>USD</web:FromCurrency>
<web:ToCurrency>EUR</web:ToCurrency>
</web:ConversionRate>
</soapenv:Body>
</soapenv:Envelope>

Response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ConversionRateResponse xmlns="http://www.webserviceX.NET/">
<ConversionRateResult>0.7566</ConversionRateResult>
</ConversionRateResponse>
</soap:Body>
</soap:Envelope>

Thanks
11 years ago
thanks ....i lll take care of it next tym onwards..
is there any solution for the query that I asked
12 years ago
Hi All,
I am using a selenium+cuke4duke tool to perform some GUI Testing and I am facing an issue with annotations

For a particular method i am using an assertion and this method calls another method of a different class
For e.g Method1 of class 1 is using assetion1 and Method1 calls Method2 which is in class2, now when the code is getting executed in method 2 what I want is that it should print the annotation of method1 .
Is there any way through which I can do it
The code for both the files are given below
StuffSteps.java---This file contains anotation



tpcomm ---- this is a temporary file for testing pupose here i tried to print the annonation @Then("I shouldfff have stomach") which is present in method iShouldHaveNCukes()

12 years ago
Hi All,
I am using a selenium+cuke4duke tool to perform some GUI Testing and I am facing an issue with annotations

For a particular method i am using an assertion and this method calls another method of a different class
For e.g Method1 of class 1 is using assetion1 and Method1 calls Method2 which is in class2, now when the code is getting executed in method 2 what I want is that it should print the annotation of method1 .
Is there any way through which I can do it
The code for both the files are given below
StuffSteps.java---This file contains anotation
package com.pearson.psn.fixture.LRD;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import org.junit.AfterClass;
import org.junit.BeforeClass;

import junit.framework.Assert;


import com.pearson.psn.common.SuccessNetCommon;
import com.pearson.psn.dsl.SeleniumUtil;
import com.thoughtworks.selenium.SeleneseTestCase;

import cuke4duke.Given;
import cuke4duke.Then;
import cuke4duke.When;
import cuke4duke.After;
import cuke4duke.Before;

public class StuffSteps extends SeleneseTestCase{

public StuffSteps() throws Exception{
selenium = SuccessNetCommon.selenium;
}


@Given("I haveeee a saussage")
public void intentionallyPending() throws Exception{
}

@Then("I shouldfff have stomach")
public void iShouldHaveNCukes()throws Exception {

tpComm tp1= new tpComm();
tp1.comm();
}
@Given("I haveeee a saussage1")
public void intentionallyPending1() throws Exception{
}
@Then("I shouldfff have stomach1")
public void iShouldHaveNCukes1()throws Exception {

}
}


tpcomm ---- this is a temporary file for testing pupose here i tried to print the annonation @Then("I shouldfff have stomach") which is present in method iShouldHaveNCukes()

package com.pearson.psn.fixture.LRD;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

public class tpComm {



public void comm() throws Exception{

StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
StackTraceElement e=stacktrace[2];


Class clazz =Class.forName(e.getClassName());
System.out.println(clazz.getName());
Method m[] = clazz.getDeclaredMethods();
System.out.println(m[0].getName());
Method m1 = clazz.getMethod(m[0].getName());

Annotation[] annotations = clazz.getAnnotations();

for(Annotation anno : annotations) {

System.out.println("Annotation Type: " + anno.annotationType());

}

System.out.println(m1.getName());
System.out.println(annotations.length);

//System.out.println(m.getName());
String methodName = e.getMethodName();

String ClassName = e.getClassName();

//System.out.println(methodName);
//System.out.println(ClassName);

}
}


12 years ago
I am facing a problem when I try to access a jar file


I have two jar files

selenium-server.jar located at C:\SeleniumRC\JavaServer
and
selenium-java-client-driver.jar located at C:\SeleniumRC\JavaClient

my classpath is C:\junit4.8.1\junit-4.8.1.jar;C:\SeleniumRC\JavaServer\selenium-server.jar;C:\SeleniumRC\JavaClient\selenium-java-client-driver.jar;D:\Selenium\Installation\testng-5.11\testng-5.11\testng-5.11-jdk15.jar;


when I try to access the jar file form C: with the help of following command Java -jar selenium-server.jar -interactive it is not getting opened.earlier when I tried the same thing it did opened .

now every time when I want to access the file i need to go to C:\SeleniumRC\JavaServer and then give the command Java -jar selenium-server.jar.It is acessible from this path ...but when I try to access it from any other path it gives the message "Unable to access jarfile selenium-server.jar"

So cant figure out what is the problem..Please Help
14 years ago
I want to communicate between 2 Servlet.any way through which I can do it.

For e.g.Suppose I have a Html form and I extract some data from this form with the help of the sevlet(I am able to do it).All I want ot know out of this data I want to pass some of the data to another servlet.
So I want to know whether this is possible.
If possible how?

In short i want to know how two servlets can communicate
14 years ago
Hi all,
I am currently learning Servlets and JSp and I am looking forward to learn struts ,spring and Hibernate.
So all I wanted to know is that Is it necessacary to learn EJB for Spring struts and Hibernate or can these 3 technologies directly.
And what should be my approach so that I can also learn at the time should be able to apply it properly.

Thanks in advance.


14 years ago
Hi,
I want to learn about the design patterns.
so can you tell me what should be my approach , so that I can learn Design patterns properly and should be able to apply it well.
can you also name the books which could help me .
How to check whether a particular row(whole row) is duplicate or not..
there is no primary or unique key defined for any colowmn..
is there any function thru which we can check whether the whole row is duplicate..
14 years ago
ch1servlet.class is the class file which is stored on F:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ch1\WEB-INF\Classes\com\examples

web.xml is strored on F:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ch1\WEB-INF

I have used URL as http://localhost:8080/ch1/Serv1

so what else I can do other than this?
14 years ago
I have used URL as http://localhost:8080/ch1/Serv1 but still cant figure out whats is wrong in it.
gives the same error.

and regarding The "not available" result could be due to errors when the server attempted to create an instance of your servlet. The log files should show an error trace. didnt got what you are trying to say..

which log file will provide me the error i information i.e. any naming convention given to that log file and how to resolve it.

I have checked out 1 log file starts with local which gives the following information.

Jul 1, 2009 7:43:36 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet Chapter1 Servlet
java.lang.ClassNotFoundException: com.examples.ch1servlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1095)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Jul 1, 2009 7:43:43 PM org.apache.catalina.core.StandardWrapperValve invoke
INFO: Servlet Chapter1 Servlet is currently unavailable

14 years ago
Hi all,
I m unable to run servlet..
it gives the following error

The requested resource (Servlet Chapter1 Servlet is not available) is not available.

ch1servlet.class is the class file which is stored on F:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ch1\WEB-INF\Classes\com\examples

web.xml is strored on F:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ch1\WEB-INF

The ch1servlet source file is as follow as

package com.examples;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class ch1servlet extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)throws IOException
{
PrintWriter out =response.getWriter();
java.util.Date today=new java.util.Date();
out.println("<html>"+ "<body>"+ "<h1>Chapter1 Servlet </h1>"+ "<br>"+today+"</body>"+"</html>");

}
}


web.xml file is as follow as

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>

<!-- JSPC servlet mappings start -->

<servlet>
<servlet-name>Chapter1 Servlet</servlet-name>
<servlet-class>com.examples.ch1servlet</servlet-class>
</servlet>

<servlet-mapping>
<url-pattern>/Serv1</url-pattern>
<servlet-name>Chapter1 Servlet</servlet-name>
</servlet-mapping>

<!-- JSPC servlet mappings end -->

</web-app>


really cant figure out what is the problem
please help
14 years ago