sangram mhatre

+ Follow
since Apr 02, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sangram mhatre

I am using JPA(Hibernate implementation) to store entities in database .

I have a scenario wherein i need to save values to database and also some part of it to
a properties file(maintain preferences for some component). I am using commons configuration
for this .

I want that the transaction consists of both the saves to database and properties file as well .
There is a method in PropertiesConfiguration(commons config object) , save , what i want is
Spring to either call commit on connection and save on PropertiesConfiguration both or none .

How can this be achieved ?

Thanks in advance .
12 years ago

This is how had done it

But i have used simple bean , not the generated code by java2wsdl .

12 years ago
You can do something like this ,

//Look-up the client (it is the one which will have @Webservice annotation
//If not using spring just create the instance
IMyService client = (IMyService) context.getBean("client");

Then call the ws .

// Invoke the Service"Client invoking WS:");
ObjectFactory factory = new ObjectFactory();
NameDataContract name = factory.createNameDataContract();
name.setFirstName( factory.createNameDataContractFirstName("Java"));
String response = client.sayHello(name);"Response: " + response);

Sangram M
12 years ago
Posting a message over http is what you already know .

Webservice is, createing a message in a specific protocol(SOAP envelope which defines an xml format) and then post
it over the http . On the serverside the soap envelope recieved is decoded and then call the corresponding service (maybe
anything not only java) and then again send the response in the xml format to the client .

The advantage is since you are using a predefined xml format , you can communicate between different platforms i.e. a java
program can communicate to a c# program whithout even needing to know that it is talking to a c# program.
12 years ago
Are you aware what an interface in java is ?
13 years ago
You can write your file to root directory of your web app .

and then respond back to your client as below ,
which will prompt the user to select the location to save his file .

InputStream is = ctx.getResourceAsStream("/<urfilename>");
int read = 0 ;
byte[] bytes = new byte[1024];
OutputStream os = response.getOutputStream();
while ((read = != -1) {
os.write(bytes, 0 ,read);

13 years ago
You can store the value in an attribute in ServletContext object and in each of the service method , extract this value and increment it and again
store in same attribute .
13 years ago
Please check setreadOnly() method.,%20boolean)

Else you can write you own wrapper class to control the dirty checking .
No , you dont have to .
you can refer the api at ,

Check for ssh constructor .
Are you able to connect to the database xe with user name scott and password tiger externally using sqlplus ? Also can you provide your tnsnames entry ?
I have used a third party api from jscape and it works fine
and is simple to use . You can try the same .
Every container implements the HttpServletRequest and HttpServletResponse
interfaces , a container actually creates objects of these implementation
objects ,

HttpServletRequest httpServletRequestImpl = new HttpServletRequestImpl();
HttpServletResponse httpServletResponseImpl = new HttpServletResponseImpl();

and populates these and then calls the service method .
13 years ago
Are you able to connect to the database xe with user name scott and password tiger externally using sqlplus ? Also can you provide your tnsnames entry ?
Try using proper combination of
session.evict() and session.clear() before session.update() or
Please check , if the database is running and listener is running and the details you have provided in connection url are correct .