[JBossWS] - How to get java subclass generated by wstools or wscompile?
by ichunlin
I have a wsdl which has base class type and few subclass types.
This is the snipplet from wsdl.
<xsd:complexType name="Event">
| <xsd:sequence>
| <xsd:element name="time" type="xsd:string"/>
| </xsd:complexType>
|
| <xsd:complexType name="AgentBusyEvent">
| <xsd:complexContent>
| <xsd:extension base="tns:Event">
| <xsd:sequence>
| <xsd:element name="agentDevice" type="tns:ExtendedDeviceID"/>
| <xsd:element name="agentID" type="xsd:string" minOccurs="0"/>
| </xsd:extension>
| </xsd:complexContent>
| </xsd:complexType>
|
| <xsd:complexType name="GetEvents">
| <xsd:complexContent>
| <xsd:extension base="tns:Command">
| <xsd:sequence/>
| </xsd:extension>
| </xsd:complexContent>
| </xsd:complexType>
I have used wstools ant task and wscompile ant task for generating java codes. However, I can't get AgentBusyEvent subclass generated. Note that the operation only refer to the base type.
<message name="getEvents">
| <part name="parameters" element="ns2:GetEvents"/>
| </message>
|
| <message name="getEventsResponse">
| <part name="result" element="ns2:GetEventsResponse"/>
| </message>
|
| <operation name="getEvents">
| <input message="tns:getEvents"/>
| <output message="tns:getEventsResponse"/>
| <fault name="Exception" message="tns:synappsException"/>
| </operation>
Does anyone know how to get the subclass generated? Axis1.4 works. However, wscompile or wstools is the only option for wsdl2java in jboss4.0.4?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993195#3993195
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993195
19 years, 4 months
[JBoss AOP] - Re: Tracing/Logging - Actual RMI calls vs calls between EJBs
by ykrishnaprasad
Thanks a bunch guys!
I think i got the basic caller pointcut working for MethodCalledByMethodInvocation.
Here is a simple set of classes that i used for this purpose:
| package DCR2;
|
| public class HelloAOP {
| public static void main(String args[]){
| new callTest().printText();
| }
| public void callMe(){
| System.out.println("AOP!");
| }
| }
|
|
| package DCR2;
|
| public class callTest {
| public void printText(){
| callMe();
| }
| public void callMe(){
| System.out.println("AOP!");
| }
| }
|
| package DCR2;
|
| import org.jboss.aop.advice.Interceptor;
| import org.jboss.aop.joinpoint.Invocation;
| import org.jboss.aop.joinpoint.MethodCalledByMethodInvocation;
|
| public class HelloAOPInterceptor implements Interceptor{
| public String getName(){
| return "HelloAOPInterceptor";
| }
| public Object invoke(Invocation invocation) throws Throwable{
| if (invocation instanceof MethodCalledByMethodInvocation){
| System.out.print("MethodCalledByMethodInvocation, ");
| }
| else System.out.print("Hello, ");
| return invocation.invokeNext();
| }
| }
|
|
|
And my jboss-aop.xml looks like:
|
|
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
| <aop>
| <bind pointcut="call(public void DCR2.callTest->callMe()) and withincode(public void DCR2.callTest->printText())">
| <interceptor class="DCR2.HelloAOPInterceptor"/>
| </bind>
| </aop>
|
The output after running the project should be:
MethodCalledByMethodInvocation, AOP!
The reason i used the callTest class in between is that i could not get the interceptor to work if i had a statement
| new HelloAOP().callMe();
|
| (a method call in the constructor)
|
| instead of:
| new callTest().printText();
|
What i could do on the whole is to see if a call for a method is coming from another method or not. My next step is to see if i can differentiate between a method call coming from a JSP page(JSP->EJB) and the method calling method(EJB->EJB).
I may have to comeback for your help again.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993189#3993189
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993189
19 years, 4 months
[JBossWS] - Suppressing SoapFault Stack trace
by zurchman
It looks like this code in SOAPFaultExceptionHandler (1.0.4.GA) will always log an ugly stack trace for Exceptions thrown by the Endpoint.
Is there some way to supress the stack trace?
In many cases, the Exception is expected, and all we're really interested in logging at the Endpoint is the fault message.
| /** Translate the request exception into a SOAPFault message.
| */
| public static SOAPMessage exceptionToFaultMessage(Exception reqEx)
| {
| // Get or create the SOAPFaultException
| SOAPFaultException faultEx;
| if (reqEx instanceof SOAPFaultException)
| {
| faultEx = (SOAPFaultException)reqEx;
| }
| else
| {
| QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
| String faultString = (reqEx.getMessage() != null ? reqEx.getMessage() : reqEx.toString());
| faultEx = new SOAPFaultException(faultCode, faultString, null, null);
| faultEx.initCause(reqEx);
| }
|
| Throwable faultCause = faultEx.getCause();
| log.error("SOAP request exception", faultCause != null ? faultCause : faultEx);
|
| ...
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993187#3993187
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993187
19 years, 4 months