Vivek Jain

Ranch Hand
+ Follow
since Oct 17, 2007
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 Vivek Jain

Hi,

I've below snippet related to security constraint in my web.xml for my struts2 application. Can any one explain what it means & how does the security constraint works for below xml?



Also, we ran fortify tool & it reported that instead of blacklisting, we should put whitelist of tasks in this security constraint. Can any one tell me how to change above xml to provide whitelisting?

Thanks!
11 years ago
Hi All & Srini,
My issue is resolved finally. The problem is in org.apache.axis2.client.Stub class. This class forcefully adds mustunderstand attribute even if it is set to 0. In my case, I do not need this attribute at all, so the solution is to override the addheader method & conditionally add the mustunderstand attribute.
Looks like this is a bug in axis stub class. Thanks for all your help, Srini!

Thanks!
12 years ago
Hi Srini,
Thanks again for all your help! I tried with axis 2 & now, there is only last problem remaining. I didn't have to do anything to add the header. It looks like the axis2 sent the header info properly without adding any code. But the issue is that it is adding extra attribute called mustunderstand in header as shown below:


And I do not need this attribute at all. I need it as shown below:


This is the last remaining issue. Can you please help me in removing mustunderstand attribute in header?

Thanks!

12 years ago
Hi Srini,
I'll be more than happy if it is implemented in higher version. Only concern is that I need the request in the exact same format.

Thanks!
12 years ago
Hi Srini,
I already looked at the link which you've provided & thats what I'm doing too. But my server side code expects the header in exactly same format. I need the request exactly in following format:


With the code given in the link which you've provided, it adds some extra attributes to accessInfo which I'm not sure how to remove. Also, the soap envelop has some different attributes. I need the request in exactly above format.

Thanks!
12 years ago
This is old axis 1.4. I'm not using axis2.

But I'm ok if you can provide any working sample using axis2 as well.

Thanks!
12 years ago
Hi Srini,
Here are the answers to your question:

1. What is the type of your ws object, and what interfaces does it implement?
ws is of type SubscriptionSoapStub which is generated using java org.apache.axis.wsdl.WSDL2Java wsdlURL where wsdlURL is the complete WSDL URL.

2. Axis version - v1.4

3. Steps used to generate the client. Did you use WSDL2Java to generate the client or did you write the client yourself? Its better to generate it.
I generated the client by running following command line:
java org.apache.axis.wsdl.WSDL2Java wsdlURL

4. Your target server (tomcat, GlassFish, etc.)
I'm writing this client program ro run it as stand alone as I'll be running it through task scheduler.

Please note that the server side web service is expecting the user & password under accessInfo in SoapHeader only. I would appreciate if you can provide me the working sample as I've been struggling with this!

Thanks!
12 years ago
Hi Srini,
Thanks again for the prompt reply. But I still have no luck. I'm still trying to create envelope object. But ws has only ferw properties such as _createCall(), _getCall(), _getProperty(String name), _getPropertyNames(), _getService(), _setProperty(String arg0, Object arg1), etc

My main method starts with following lines:

Is there any other way to create envelope?

Thanks!
12 years ago
Hi,
Thanks for the reply. However, I do not see any such method name as addNamespaceDeclaration for ws.

Can you please tell me how to set namespace exactly?

Thanks!
12 years ago
Hi,
I'm trying to invoke ASP.NET web service using Java 1.6 & Axis 1.4
I'm passing user name & password through soap header but somehow the request genearted is as shown below:

And I need the request format as shown below:

Java code is given below:

It is giving authentication failed error response.

Can any one help me how to generate this request exactly as shown above?

Thanks!
12 years ago
Hi Rob,
Still no luck....Tried reading both error & input streams before waiFor....it hangs....When I do the Ctrl-C, it gives below error:



And if I look at the line number 2990 from above error, it seems like the issue is somewhere else.....Basically, when I'm throwing the string as an input to this external utility, it is hanging there itself....



Code hangs at Line 2990 which is writer.write(lst);

Can you please help fixing the issue?

Appreciate your help!!!
13 years ago
Rob,
I've read the article at Javaworld. Appreciate if you can tell me the solution for my case?

Thanks!
13 years ago
Hi,
After doing more analysis, I noticed that the process is hanging because the I/O buffer is full...And it should be released by reading it.

If I try the below code, it works fine...But again it also has the limitation of processing around 8000 strings.....and thats not the right approach since I'm reading it before even knowing whether the process has finished it or not....So is there any other better soln???



thanks!
13 years ago
Yes....I'm in fact giving input of 9000 strings within String Buffer.

Using , I'm actually capturing the output of the external utility which I am calling using ProcessBuilder.

Can you please help?

It looks like the buffer cannot accommodate much data. I just tried replacing String Buffer with Array List but the problem stays the same. So, it could be related to the output stream being not able to handle much data.

ok....I just noticed that the program works fine for small chunk of strings say 500 strings. However, if I use more than this limit, it just hangs at line process.waitFor().

What could be the resolution?

Thanks!

13 years ago