Hi,

Your commited solution works perfectly! Now unqualified fault is exchanged in a 
right way.
But I had to build service-mix 3.2 manually in order to try your fix, because 
there is no SM-1328 fix in last snapshot 
(apache-servicemix-3.2.2-20080424.010609-12.zip). 
Please enqueue your SM-1328 fix to be in the next snapshot.

Thanks for your support.

Best regards
Sebastian Kuligowski

> Hi,
> This issue get fixed, [1] is the jira to track it.
> Please grab the latest 3.2.2 snapshot code and try agian.
> [1]https://issues.apache.org/activemq/browse/SM-1328
> 
> Regards
> 
> Freeman
> 
> Freeman Fang wrote:
> > Hi,
> >
> > Quick update of this issue
> > I reproduce the your problem and finally found the root cause,
> > Your schema is unqualified which confuse the unmarshelling of the JBI 
> > fault, the work around is add
> > elementFormDefault="qualified"  attribute to your  schema, then 
> > everything should be fine.
> > Anyway, we should provide a way to enable unqualified fault for cxf bc 
> > provider, I'm still looking for how to fix it.
> >
> > Regards
> > Freeman
> >
> > k_seb wrote:
> >> Hi!
> >>
> >> Thank you for your fast response. After changing locationURI I have 
> >> still problem with empty fault part. I use the latest SNAPSHOT of 
> >> service-mix (3.2.2) and cxf wsdl2java (2.0.6-incubator-SNAPSHOT) 
> >> Below I enclose the wsdl file:
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <definitions name='BusyService' 
> >> targetNamespace='http://busy-service.pl/busy/ws' 
> >> xmlns='http://schemas.xmlsoap.org/wsdl/' 
> >> xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' 
> >> xmlns:tns='http://busy-service.pl/busy/ws' 
> >> xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
> >>  <types>
> >>   <xs:schema targetNamespace='http://busy-service.pl/busy/ws' 
> >> version='1.0' xmlns:tns='http://busy-service.pl/busy/ws' 
> >> xmlns:xs='http://www.w3.org/2001/XMLSchema'>
> >>    <xs:element name='BusyServiceFault' type='tns:BusyServiceFault'/>
> >>    <xs:element name='addBusyPeriod' type='tns:addBusyPeriod'/>
> >>    <xs:element name='addBusyPeriodResponse' 
> >> type='tns:addBusyPeriodResponse'/>
> >>    <xs:complexType name='addBusyPeriod'>
> >>     <xs:sequence>
> >>      <xs:element minOccurs='0' name='number' type='xs:string'/>
> >>     </xs:sequence>
> >>    </xs:complexType>
> >>    <xs:complexType name='addBusyPeriodResponse'>
> >>     <xs:sequence>
> >>      <xs:element minOccurs='0' name='return' type='xs:int'/>
> >>     </xs:sequence>
> >>    </xs:complexType>
> >>    <xs:complexType name='BusyServiceFault'>
> >>     <xs:sequence>
> >>      <xs:element name='errorDesc' type='xs:string'/>
> >>     </xs:sequence>
> >>    </xs:complexType>
> >>   </xs:schema>
> >>  </types>
> >>  <message name='BusyService_addBusyPeriod'>
> >>   <part element='tns:addBusyPeriod' name='addBusyPeriod'/>
> >>  </message>
> >>  <message name='BusyService_addBusyPeriodResponse'>
> >>   <part element='tns:addBusyPeriodResponse' 
> >> name='addBusyPeriodResponse'/>
> >>  </message>
> >>  <message name='BusyServiceFault'>
> >>   <part element='tns:BusyServiceFault' name='BusyServiceFault'/>
> >>  </message>
> >>  <portType name='BusyService'>
> >>   <operation name='addBusyPeriod' parameterOrder='addBusyPeriod'>
> >>    <input message='tns:BusyService_addBusyPeriod'/>
> >>    <output message='tns:BusyService_addBusyPeriodResponse'/>
> >>    <fault message='tns:BusyServiceFault' name='BusyServiceFault'/>
> >>   </operation>
> >>  </portType>
> >>  <binding name='BusyServiceBinding' type='tns:BusyService'>
> >>   <soap:binding style='document' 
> >> transport='http://schemas.xmlsoap.org/soap/http'/>
> >>   <operation name='addBusyPeriod'>
> >>    <soap:operation soapAction=''/>
> >>    <input>
> >>     <soap:body use='literal'/>
> >>    </input>
> >>    <output>
> >>     <soap:body use='literal'/>
> >>    </output>
> >>    <fault name='BusyServiceFault'>
> >>     <soap:fault name='BusyServiceFault' use='literal'/>
> >>    </fault>
> >>   </operation>
> >>  </binding>
> >>  <service name='BusyService'>
> >>   <port binding='tns:BusyServiceBinding' name='BusyServicePort'>
> >>    <soap:address location='http://localhost:9001/busy-service'/>
> >>   </port>
> >>  </service>
> >>  <service name='BusyServiceProxy'>
> >>   <port binding='tns:BusyServiceBinding' name='BusyServiceProxyPort'>
> >>    <soap:address location='http://external.host'/>
> >>   </port>
> >>  </service>
> >> </definitions>
> >>
> >> Generated BusyServiceFault by CXF wsdl2java is:
> >>
> >> @XmlAccessorType(XmlAccessType.FIELD)
> >> @XmlType(name = "BusyServiceFault", propOrder = {
> >>     "errorDesc"
> >> })
> >> public class BusyServiceFault {
> >>
> >>     @XmlElement(required = true)
> >>     protected String errorDesc;
> >>
> >>     /**
> >>      * Gets the value of the errorDesc property.
> >>      *      * @return
> >>      *     possible object is
> >>      *     [EMAIL PROTECTED] String }
> >>      *          */
> >>     public String getErrorDesc() {
> >>         return errorDesc;
> >>     }
> >>
> >>     /**
> >>      * Sets the value of the message property.
> >>      *      * @param value
> >>      *     allowed object is
> >>      *     [EMAIL PROTECTED] String }
> >>      *          */
> >>     public void setErrorDesc(String value) {
> >>         this.errorDesc = value;
> >>     }
> >>
> >> }
> >>  
> >>
> >> And InOut message with right content of errorDesc which is received 
> >> from external part:
> >>
> >> DEBUG - SedaQueue                      - 
> >> [EMAIL PROTECTED] dequeued 
> >> exchange: InOut[
> >>   id: ID:172.17.39.124-119751f9c34-5:1
> >>   status: Active
> >>   role: consumer
> >>   interface: {http://busy-service.pl/busy/ws}BusyService
> >>   service: {http://busy-service.pl/busy/ws}BusyServiceProxy
> >>   endpoint: BusyServiceProxyPort
> >>   operation: {http://busy-service.pl/busy/ws}addBusyPeriod
> >>   in: <?xml version="1.0" encoding="UTF-8"?><jbi:message 
> >> xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"; 
> >> xmlns:msg="http://busy-service.pl/busy/ws"; 
> >> type="msg:addBusyPeriod"><jbi:part><ns2:addBusyPeriod 
> >> xmlns:ns2="http://busy-service.pl/busy/ws";><number>12123123123</number></ns2:addBusyPeriod></jbi:part></jbi:message>
> >>  
> >>
> >>   fault: <?xml version="1.0" encoding="UTF-8"?><JBIFault 
> >> xmlns="http://cxf.apache.org/bindings/jbi";><ns2:BusyServiceFault 
> >> xmlns:ns2="http://busy-service.pl/busy/ws";><errorDesc>Defined busy 
> >> period should be independent of other date 
> >> regions.</errorDesc></ns2:BusyServiceFault></JBIFault>]
> >> DEBUG - DeliveryChannelImpl            - Notifying exchange 
> >> ID:172.17.39.124-119751f9c34-5:1(10c03c6) in DeliveryChannel{servicemi
> >> x-cxf-se} from processInboundSynchronousExchange
> >> DEBUG - DeliveryChannelImpl            - Notified: 
> >> ID:172.17.39.124-119751f9c34-5:1(10c03c6) in 
> >> DeliveryChannel{servicemix-cxf-se}
> >>  from sendSync
> >>
> >>  
> >>> Hi Sebastian,
> >>>
> >>> What's the servicemix version you are using? Would you please try 
> >>> with the 3.2.2 snapshot?
> >>> And please change the locationURI for your provider configuration
> >>> locationURI="http://10.11.10.10:8080/BusyServiceWSImpl";  (no need 
> >>> ?wsdl)
> >>> If you still have problem. if possible could you append your whole 
> >>> test case, especially the wsdl you are using, I'd like to see the 
> >>> fault in your wsdl
> >>> Actually we have a test very similar with your scenario, and the 
> >>> exception handle part is always ok, please see [1],
> >>> the
> >>> //test exception handle
> >>> part
> >>> [1]http://svn.apache.org/repos/asf/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
> >>>  
> >>>
> >>>
> >>> Regards
> >>>
> >>> Freeman
> >>>
> >>> Sebastian Kuligowski wrote:
> >>>    
> >>>> Hello,
> >>>>
> >>>> I've created proxy scenario using cxf-bc and cxf-se components using
> >>>>
> >>>> CXF-BC (1) --- CXF-SE bean (2) with injected provider --- CXF-BC 
> >>>> (3) to external
> >>>> endpoint (as described in all tutorials)
> >>>>
> >>>> The problem:
> >>>>
> >>>> After receiving fault from external endpoint (3) with a parameter
> >>>> ('errorDesc') included which describes bussiness cause of the 
> >>>> fault, that parameter
> >>>> is empty/null after catching exception in my proxy bean.
> >>>>
> >>>> In logs I could find that the falut is wrapped properly in JBIFalut
> >>>> object after receiving soap fault from external endpoint: errorDesc
> >>>> parameter is set with proper message.
> >>>>
> >>>>   fault: <?xml version="1.0" encoding="UTF-8"?><JBIFault
> >>>>   xmlns="http://cxf.apache.org/bindings/jbi";><ns2:BusyServiceFault
> >>>>   xmlns:ns2="http://busy-service.pl/busy/ws";><errorDesc>Defined busy
> >>>>   period should be independent of other date
> >>>>   regions.</errorDesc></ns2:BusyServiceFault></JBIFault>
> >>>>         
> >>> <JBIFault 
> >>> xmlns="http://cxf.apache.org/bindings/jbi";><CalculatorFault 
> >>> xmlns="http://apache.org/cxf/calculator/types";><faultInfo>Numbers: 
> >>> 1, -1</faultInfo><message>Negative number cant be 
> >>> added!</message></CalculatorFault></JBIFault>
> >>>    
> >>>> But not in catched exception below. My bean with proxied 
> >>>> busyService provider:
> >>>>
> >>>> public class BusyServiceESBImpl implements BusyService {
> >>>>   private BusyService busyService;  // injected proxied provider
> >>>>
> >>>>   // exposed by CXF-BC (1)
> >>>>   public Integer addBusyPeriod(String number) throws 
> >>>> BusyServiceFault_Exception {
> >>>>     try {
> >>>>        return getBusyService().addBusyPeriod(number);
> >>>>        // external endpoint returns business exception defined in WSDL
> >>>>     } catch (BusyServiceFault_Exception e) {
> >>>>        System.out.println(e.getFaultInfo().getErrorDesc());
> >>>>        // is NULL!!!!!!!!! errorDesc inside BusyServiceFault object is
> >>>>        lost
> >>>>        System.out.println(e.getMessage()); // returns faultstring
> >>>>     }
> >>>> }
> >>>>
> >>>> I would be very grateful for any help, I've spent a lot of time on
> >>>> searching any solution.
> >>>>
> >>>> Details:
> >>>>
> >>>> CXF-BC xbean.xml
> >>>>
> >>>> <cxfbc:consumer wsdl="classpath:BusyService.wsdl"
> >>>>                 targetService="busy-service:BusyService"
> >>>>                 targetInterface="busy-service:BusyService"/>
> >>>>
> >>>> <cxfbc:provider wsdl="classpath:BusyService.wsdl"
> >>>>                 
> >>>> locationURI="http://10.11.10.10:8080/BusyServiceWSImpl?wsdl";
> >>>>                 service="busy-service:BusyServiceProxy" 
> >>>> endpoint="BusyServiceProxyPort"
> >>>>                 interfaceName="busy-service:BusyService" />
> >>>>
> >>>> CXF-SE xbean.xml
> >>>>
> >>>> <cxfse:endpoint>
> >>>>    <cxfse:pojo>
> >>>>      <bean class="busy.esb.BusyServiceESBImpl">
> >>>>         <property name="busyService">
> >>>>            <cxfse:proxy service="busy:BusyServiceProxy" 
> >>>> context="#context" type="busy.ws.BusyService" />
> >>>>         </property>
> >>>>      </bean>
> >>>>    </cxfse:pojo>
> >>>> </cxfse:endpoint>
> >>>>
> >>>>
> >>>> Best regards
> >>>> Sebastian Kuligowski
> >>>>
> >>>>
> >>>>         
> >>
> >>
> >>   
> >
> >
> 

Reply via email to