[JBossWS] - WebFault targetNamespace and document/literal
by bartvh
It looks like there is a problem with the namespace for web faults when this is not the same as the namespace of the service. The type definition of the web faults has the correct namespace, but the reference to the type from the messsage elements uses the name space of the service instead.
For example:package zzz.ws.flt;
|
| import javax.xml.bind.annotation.XmlType;
| import javax.xml.ws.WebFault;
|
| @WebFault(targetNamespace="zzz.ws.flt")
| @XmlType(namespace="zzz.ws.flt")
| public class ZZZException extends Exception {
| private String info;
|
| public ZZZException(String info) {
| this.setInfo(info);
| }
|
| public void setInfo(String info) {
| this.info = info;
| }
|
| public String getInfo() {
| return info;
| }
| }
andpackage zzz.ws.srv.impl;
|
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.jws.soap.SOAPBinding.ParameterStyle;
| import javax.jws.soap.SOAPBinding.Style;
| import javax.jws.soap.SOAPBinding.Use;
|
| import zzz.ws.flt.ZZZException;
| import zzz.ws.srv.ZZZService;
|
| @Stateless
| @Remote(ZZZService.class)
| @WebService(targetNamespace="zzz.ws.srv", name="ZZZService")
| @SOAPBinding(style=Style.DOCUMENT, use=Use.LITERAL, parameterStyle=ParameterStyle.WRAPPED)
| public class ZZZServiceImpl implements ZZZService {
|
| @WebMethod
| public String echo(String input) throws ZZZException {
| return input;
| }
| }
generates
<?xml version="1.0" encoding="UTF-8"?>
| <definitions name="ZZZServiceImplService" targetNamespace="zzz.ws.srv" xmlns:tns="zzz.ws.srv" xmlns:ns1="zzz.ws.flt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
| <types>
| <xs:schema targetNamespace="zzz.ws.srv" version="1.0" xmlns:tns="zzz.ws.srv" xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:element name="echo" type="tns:echo"/>
| <xs:element name="echoResponse" type="tns:echoResponse"/>
| <xs:complexType name="echo">
| <xs:sequence>
| <xs:element minOccurs="0" name="arg0" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="echoResponse">
| <xs:sequence>
| <xs:element minOccurs="0" name="return" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| <xs:schema targetNamespace="zzz.ws.flt" version="1.0" xmlns:tns="zzz.ws.flt" xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:element name="ZZZException" type="tns:ZZZException"/>
| <xs:complexType name="ZZZException">
| <xs:sequence>
| <xs:element minOccurs="0" name="info" type="xs:string"/>
| <xs:element minOccurs="0" name="message" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </types>
| <message name="ZZZService_echo">
| <part name="echo" element="tns:echo">
| </part>
| </message>
| <message name="ZZZException">
| <part name="ZZZException" element="tns:ZZZException">
| </part>
| </message>
| <message name="ZZZService_echoResponse">
| <part name="echoResponse" element="tns:echoResponse">
| </part>
| </message>
| <portType name="ZZZService">
| <operation name="echo" parameterOrder="echo">
| <input message="tns:ZZZService_echo">
| </input>
| <output message="tns:ZZZService_echoResponse">
| </output>
| <fault name="ZZZException" message="tns:ZZZException">
| </fault>
| </operation>
| </portType>
| <binding name="ZZZServiceBinding" type="tns:ZZZService">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| <operation name="echo">
| <soap:operation soapAction=""/>
| <input>
| <soap:body use="literal"/>
| </input>
| <output>
| <soap:body use="literal"/>
| </output>
| <fault name="ZZZException">
| <soap:fault name="ZZZException" use="literal"/>
| </fault>
| </operation>
| </binding>
| <service name="ZZZServiceImplService">
| <port name="ZZZServicePort" binding="tns:ZZZServiceBinding">
| <soap:address location="http://jbossws.undefined.host:8080/zzz-zzzservice-ejb/ZZZServiceImpl"/>
| </port>
| </service>
| </definitions>
Notice the element="tns:ZZZException" in the output.
This is running jbossws-native-3.1.0.GA on jboss-4.2.3.GA.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222724#4222724
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222724
17 years
[JBoss AOP] - Write invocation not being called for arrayreplacement
by sgoyette
Hi All,
I've been pulling my hair out with this one for some time. I'm trying to intercept reads and writes to an array. Reading is working really well but I cannot for the life of me get the writes to work. Here's is mu jboss-aop.xml file:
| <?xml version="1.0" encoding="UTF-8"?>
| <aop>
| <interceptor class="com.intuit.tax.engine.group.TSingleGroupInterceptor"/>
|
| <arrayreplacement class="com.intuit.tax.engine.group.TSingleGroup" />
| <prepare expr="field(* com.intuit.tax.engine.group.TSingleGroup->R)"/>
| <prepare expr="field(* com.intuit.tax.engine.group.TSingleGroup->B)"/>
| <prepare expr="field(* com.intuit.tax.engine.group.TSingleGroup->S)"/>
|
| <arraybind type="READ_WRITE">
| <interceptor-ref name="com.intuit.tax.engine.group.TSingleGroupInterceptor"/>
| </arraybind>
| </aop>
|
This calls this function within the TSingleGroupInterceptor:
| public Object invoke(Invocation invocation) throws Throwable {
|
| List<ArrayReference> refs = ArrayRegistry.getInstance().getArrayOwners(invocation.getTargetObject());
| logger.debug("Owner is " + refs.get(0).getRootObject().getClass().getName() );
|
| // These objects should only have a single owner
| TSingleGroup group = (TSingleGroup)refs.get(0).getRootObject();
| if ( invocation instanceof ArrayElementReadInvocation) {
| logger.debug("Read invocation");
| return invoke((ArrayElementReadInvocation) invocation, group);
| } else if (invocation instanceof ArrayElementWriteInvocation) {
| logger.debug("Write invocation");
| return invoke((ArrayElementWriteInvocation) invocation, group);
| }
| logger.debug("No match for read/write. Invocation is: " + invocation.getClass().getName() );
| throw new RuntimeException("This interceptor is for arrays");
| }
|
Write invocation is never logged and neither is "No match for read/write".
What am I doing wrong? Can anyone help?
Thanks,
Steve
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222717#4222717
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222717
17 years
[JBoss Cache: Core Edition] - Re: JPA/Hibernate JBC usage
by zeravlai
Ooops I forgot another couple of questions:
- I'm testing the cache with PESSIMISTIC and both RR and RC.
- I understood from Manik that RC does not make any sense since hibernate session provides RR.
- But according to the document you pointed me to (hibernate-jbc), "pessimistic locking with REPEATABLE_READ will cause a write to block if there is a concurrent transaction which holds a read lock, till the read transaction commits".
I tested the following which leads me to a different interpretation.
- T1 and T2 reads an entity which has been previously cached. T2 starts slightly after T1.
- T1 then just waits ..... and T2 modifies a field of the read entity and commits (I see the cache and db updated).
- Then after a while T1 prints the same field T2 modified, and commits.
The two reads of T1 reports the same value (this is consistent with RR policy) but I don't see T2 blocking till T1 commits, which according to the document should be the case if OPTIMISTIC is used.
I'm sure I'm missing something "again" ;-) .
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222716#4222716
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222716
17 years