samarjit samanta

Greenhorn
+ Follow
since Nov 07, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 samarjit samanta

I just followed the tutorial as I mentioned earlier. I did not change the axis2.xml for enabling SSL. Also make sure that you enable SSL in tomcat server.xml. You probably need to add rampart jars and modules in your classpath. If you are using rampart also add it to the services.xml in both the places and key store definitions . I used axis 1.5 and rampart 1.5 and it worked.
13 years ago
Did you hear someone downloading a big file over web services?

But socket can not by-pass the firewalls


You will need to add exception to some other port, or write your socket on port 80, I would not do that. But this line of yours hints there is some scope of tightly coupled code with database.

, and we would lost much the benefits introduced by the web service.


This will be interesting based on what optimizations you prefer and need.

and use JDBC result set (in the web service method) to re-position and get the needed data.

You are getting all the records 1000 records x 10 times OVER NETWORK (JDBC uses sockets to get data from oracle).
re-positioning JDBC cursor? are you querying to get all the million records every time into ResultSet.
Another point you are forming a bulky HTTP request to send all of it to client.
So I visualize your code does.
while(100 times ){[Big oracle query 1000 records] -> [Big result set 1000 records] } -> [Big HTTP request object 1000 records that is sent to client from app server]

Remove that while loop. [BIG oracle query] -> [BIG result set] -> [BIG HTTP request object that is sent to client from app server] Now it looks like old times DB query and display on web page. But see there are no bottle necks.

If you want to remove those BIG from the above line resort to pagination.

Use Oracle pagination queries if you are new to pagination. I could not find the original oracle's article regarding pagination but the resultant query looks something like below, I added the oracle HINTS which is missing in the below links.
Two links that i quickly found are here. http://www.dba-oracle.com/t_sql_pagination.htm and http://www.oracle.com/technetwork/issue-archive/2006/06-sep/o56asktom-086197.html


As Ivan said above especially in his second point some kind of pre-fetching, page scrolling optimization is something I would look into.
If you want to give client an impression that he is looking into a single page I would look for something like the google images search. I do not have experience in this, I can only suggest serarch on google for Continuous Scrolling/scroll pagination etc.
@Ivan, @Jim: That was my humble opinion, I did not want to disregard you opinion, I just wanted to suggest it might be better to deal with simplicity.
13 years ago
I actually tried this by passing html as string and it works. It will internally encode html like replace all the "<" signs with something like "& lt;" and other special characters in its own representation and pass it over. This is again converted back into plain string with "<" when you receive in client.

If this doesn't help try using CDATA. Well I dont have any experience in using that but I am guessing it should be possible.

I would also suggest not to pass html as some kind of object as it's never valid xml. Especially if that html is generated by human being, you know as human beings are creative ...

samarjit
13 years ago
Quartz http://www.quartz-scheduler.org/overview/features.html as you can see here it's quite complex.

Jobs are scheduled to run when a given Trigger occurs. Triggers can be created with nearly any combination of the following directives:

at a certain time of day (to the millisecond)
on certain days of the week
on certain days of the month
on certain days of the year
not on certain days listed within a registered Calendar (such as business holidays)
repeated a specific number of times
repeated until a specific time/date
repeated indefinitely
repeated with a delay interval



Most of these are possible using cron or windows scheduler as well.

If I were to implement such a thing I would go for either cron or windows scheduler just for simplicity.

If a more organized approach is required for scheduling

Job Persistence

The design of Quartz includes a JobStore interface that can be implemented to provide various mechanisms for the storage of jobs.


like being able to manipulate the schedule through web front end. Or modifying more often automatically by programs then Quartz would be worth using.


If your schedule doesn't change often and there is always some intelligent agent like human being is there to do it go for cron or windows scheduling. I have seen cron being used in enterprise applications so do not underestimate its capability.

Hope that gives you enough grounds to make decision.

Samarjit


13 years ago
For concepts I guess books are better options, but these days books are often outdated. Even tutorials are, check out the dates first.

I don't know what you have read. Or which framework you are looking at.

But here are a few for your interest

http://wso2.org/library/knowledge-base/run-rampart-samples-apache-tomcat
Part 1 http://wso2.org/library/3190#Step_3._Engaging_Rampart_and_setting_authentication_information
Part 2 https://wso2.org/library/3415

Search on google like Web Services sosnoski. You will get the right direction all tutorials with examples. http://www.sosnoski.com/articles.html
Thanks to Dennis Sosnoski.

I like him. . Well his articles, because it got me getting started. Read his articles axis2 ( j-jws4, j-jws-5), Metro (j-jws-9, j-jws10)

If you can not figure out what j-jws10 is or the others here is one sample link http://www.ibm.com/developerworks/java/library/j-jws10.html.



So much for tutorials, about the frameworks I really didn't like any of them all are full of jars libraries modules you may specially like Metro which has about 4-5 jars but the size of one of the jars is 30MB which I don't complain as opposed to importing over 50-60 jars for other frameworks.


If you find any examples with Apache CFX with WS-security which will be interoperable with Axis2 and Metro please let me know too. Thanks.

Hope that helps.

Samarjit



13 years ago
Are you using swing which is again launched by Java web start/JNLP just to be able to call web services? or do you want to show some GUI or some processing in client machine which is not possible in server side?
If it is former then try posting your reply back to server and let the server call web service for you.

That was just a suggestion, but more importantly there would not be any difference between code which invokes Web Service from server and code which invokes from swing. This is because Web Service clients can be written in J2SE and transport protocol can be TCP. So its basically the same thing calling it from swing or server.

Using java web start has some implications regarding security. It may be restricted to open socket connection to some other IP/domain other than the one which originated this swing application. http://download.oracle.com/javase/tutorial/deployment/webstart/security.html So this will add to unnecessary complexity.

Hope that helps.

Samarjit
13 years ago
I am not quite sure if you can switched it on in axis2.xml. But something that woked for me is rampart modules.

You will need to include security modules Rampart along with with Axis 2. Look into http://wso2.org/library/3190#Step_3._Engaging_Rampart_and_setting_authentication_information.
You will also uncomment some code in tomcat/other app server's server.xml.

To follow the tutorial which also talk about user name token authentication, which you may leave out just use the SSL part.
You will need to edit the META-INF/services.xml in server to add these policy. Here Your concern should be which defines ssl, you can remove the which is used for user name token.

13 years ago
For Web Service Client: if wsdl does not have policies in it then you are lucky. Use JAX-WS that is packed with jdk5+ http://java.dzone.com/articles/jax-ws-hello-world?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+javalobby/frontpage+(Javalobby+/+Java+Zone).
You can also look into
  • Apache Axis2 Web service implementation,
  • Apache CXF which is a spring based web service framework,
  • Metro framework - It uses JAX-WS implementation along with other modules. It gets little nasty because it usually requires later version of JAX-WS which is there in its library, but it conflict with JAX-WS that is built in java. Ways to get around this using endorsed directory is there in tutorials. Seehttp://www.ibm.com/developerworks/java/library/j-jws9.html


  • Running a java program every 24 hours:
    On Windows PC you can use Windows scheduler and run a batch file (.bat) or possibly your java program directly. It gives option to run at what time, everyday, or on a specific day of week, or when your pc boots up.
    On linux you can configure cron to trigger the program.
    Or you may look into quartz scheduler which is basically again a java program so you will need to bring that up everyday, or run it all the time.
    13 years ago
    I have two different WS-Security enabled web services, using Metro client and I want to access them using a single client. I believe this will require two wsit-client.xml to be defined in the client project. Is it possible to define two wsit-client.xml files inside one project? or am I missing something. I believe using Axis2 +rampart this is possible by using two different policy files. I am trying to avoid using Axis2+rampart as this will require some 70 more jars to be added and a couple of modules in classpath which already contains over 50 jars.
    13 years ago