Man Sharma

Greenhorn
+ Follow
since Mar 23, 2009
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 Man Sharma

Hi there,

I am new to web services and I need to implement ws security in an axis web service. I am not sure whether is it possible to add ws security to an existing web service without creating a new WSDL? We are using spring and axis and exposing some admin methods which are being used by CSR admin's by a web browser, here is the server-config.wsdd file



Can somebody help how can I add ws security to this web service, it seems that this file creates wsdl file but not sure but checked other classes in the modules but couldn't find references of web service all other are java classes.

Thanks in advance ! Manish
8 years ago
Hi,
I need some help to get my AOP implementation working. I just want to execute a piece of code before invokation of a method.

Here is the code snippet.

<!-- Advice -->
<bean id="urlTamperingDetectorAdvice" class="com.fun.org.msg.util.UrlTampringDetector" />
<!-- Advisor -->
<bean id="urlTamperingAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
<property name="mappedNames" value="getRequestBody" />
<property name="advice" ref="urlTamperingDetectorAdvice" />
</bean>
<!-- Proxy -->
<bean id="fun.org.msg.TaskAProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="target">
<bean class="com.fun.org.msg.requester.WebServiceRequesterTaskA" parent="fun.org.msg.WebServiceRequester">
<property name="suffix" value="/approve" />
<property name="fieldUnpackers">
<list>
<ref bean="fun.org.TaskUnpacker" />
</list>
</property>
</bean>
</property>
<property name="interceptorNames">
<list>
<value>urlTamperingAdvisor</value>
</list>
</property>
</bean>

The class for Advice

public class UrlTampringDetector implements MethodInterceptor
{
public Object invoke(MethodInvocation methodInvocation) throws Throwable
{
ValidateUrl();// some logic here
return methodInvocation.proceed();
}
}

Now how I am expecting this to called

We have some handlers for different kind of activities, that later executes a list of tasks. e.g.

<bean id="myTask..processor.TaskHandler" class="com.myTask.processor.handler.impl.RequestMessageHandlerImpl">
<property name="taskProcessors">
<list>
<ref bean="myTask.FlagInComingParametersTask" />
<ref bean="myTask.SetLocaleSpecificPropertiesTask" />
<ref bean="myTask.Host_Generic_Task" />
</list>
</property>
</bean>

<bean id="myTask.Host_Generic_Task" class="fun.org.msg.HostMappedTaskList">
<property name="taskMap">
<map>
<entry key="hostType1">
<list>
<ref bean="fun.org.msg.TaskAProxy" />
</list>
</entry>
</map>
</property>
</bean>

In fun.org.msg.HostMappedTaskList, it is calling a method of the WebServiceRequesterTaskA class.

In my scenario the method of target class is being executed but my proxy's method is not being executed. I dont know what I am doing wrong.

Campbell Ritchie wrote:Welcome to JavaRanch

Whether an Exception is checked or unchecked depends on its inheritance. So every Exception class has an inheritance tree attached, which the compiler can follow.





Thanks Campbell,

I just want to know the process . When an exception occurs then an instance is thrown from that point. Now the question is how an instance can be created at compile time, instance can be created only at runtime. Compiler does not know what type of exception it just take that instance and then find out the its type using reflection then print the stack's trace on console.

I referred also jsl 1, 2 and 3 but I could not get it how it is actually done at compile time.
12 years ago
As we know that if at any point some exception occurs in the code then an instance of Exception class (or its subclass) is thrown from that point. Now in case of checked exceptions these exceptions are checked at compile time.

So my question is the instantiation comes into picture at runtime while checked exception are checked at compile time , therefore no instantiation is there, so how compiler comes to know that it is a compile time exception.
12 years ago