Hi,

Since addEmployee is not having a response hence the HTTP 500 response with
a fault message.
Streaming works only for data services which has a result in return.

By following [1] I was able to reproduce HTTP 200 response with a soap
fault for employeesByNumber operation.
Due to the default streaming behaviour of data services requests, which has
a result
will respond with HTTP 200 and a fault message.

When creating a data service/using existing sample data service, the
streaming has been turned ON by default.

Due to this HTTP 200 + soap response, ESB 4.8.0 is unable to hit the fault
sequence in an in sequence of a proxy configuration.
Using FORCE_ERROR_ON_SOAP_FAULT property was ineffective even after the fix
applied [4].

As a workaround we can configure setup to hit the fault sequence with HTTP
500 response + fault message.

As per [1] to get an HTTP 500 response you have to disable this streaming
behaviour in both service level and operation level.

Here is how to do it.

First go to Home > Manage > Services > List
Select the data service to edit.

Now we have to disable streaming at service+operations level.

Edit Data Service (XML Edit)
    i. Include disableStreaming="true" property to the data element [2],
which will disable streaming at service level.
    ii. Include disableStreaming="true" property to the operation being
used/other operations planning to use [2],
which will disable streaming at operation level.
    iii. Save/Update the configuration.

This disableStreaming="true" property is defined to retain backward
compatibility
since from the beginning default streaming was always enabled and this
property was introduced later [3].

We can perform the above said configuration from UI.

I have tested this scenario by AS 5.1.0 DSS samples and ESB 4.8.0 +
patch0315 and
was able to recreate the scenario and successfully test the workaround
solution.

[1]
https://docs.wso2.com/display/DSS301/FAQ#FAQ-WhyisHTTPstatuscode200OKreturnedfordataservicerequests
?
[2] Attachment: "RDBMSSample.dbs"
[3]
http://wso2-oxygen-tank.10903.n7.nabble.com/Dev-DSS-disableStreaming-td96022.html
[4] https://wso2.org/jira/browse/ESBJAVA-3386

Thanks,
Suhan

On Wed, Feb 18, 2015 at 5:54 PM, Suhan Dharmasuriya <[email protected]> wrote:

> Hi,
>
> I have deployed data services samples on AS 5.1.0 as per [1].
> Even though documentation article [1] is for AS 5.2.0, I found data
> services samples in
> <AS-5.1.0 HOME>/samples/dataServiceSamples location and I deployed the
> said samples.
>
> In my scenario I'm trying to get a soap fault from a particular data
> service (which is in AS 5.1.0)
> and feed it to the in sequence of a proxy which is in ESB 4.8.0.
> I have selected the samples/RDBMSSample sample's addEmployee operation for
> my testing.
>
> By using FORCE_ERROR_ON_SOAP_FAULT property as per [2], I was able to hit
> the fault
> sequence coming from data service at AS 5.1.0.
> To use this property successfully I have to use this fix in issue [3] also.
>
> Here the response I got was [8] HTTP 500 with fault sequence which I
> expected.
>
> Now I have to get the HTTP 200 with a fault sequence as [5] and to
> test the behaviour of ESB 4.8.0's fault sequence capturing capability with
> FORCE_ERROR_ON_SOAP_FAULT property with HTTP 200 response [5].
>
> I have tried using [6], [4] disableStreaming="false" (also tried to enable
> streaming tick box from UI) at both service and operation level and the
> result was the
> same (HTTP 500) response.
> Regardless of true/false value for the field I'm getting HTTP 500 with
> soap fault.
>
> My /samples/dataServiceSamples/dbs/rdbms/RDBMSSample.dbs file is attached
> herewith [7].
>
> Am I missing any configuration?
>
> [1] https://docs.wso2.com/display/AS520/Data+Services+Samples
> [2] https://docs.wso2.com/display/ESB481/Generic+Properties
> [3] https://wso2.org/jira/browse/ESBJAVA-3386
> [4]
> https://docs.wso2.com/display/DSS310/Creating+Using+Various+Data+Sources#CreatingUsingVariousDataSources-Enablestreaming
> [5]
> https://docs.wso2.com/display/DSS301/FAQ#FAQ-WhyisHTTPstatuscode200OKreturnedfordataservicerequests
> ?
> [6]
> http://wso2-oxygen-tank.10903.n7.nabble.com/Dev-DSS-disableStreaming-td96022.html
> [7] Attachment: [RDBMSSample.dbs]
> [8]
> [2015-02-18 17:21:03,086] DEBUG - wire >> "HTTP/1.1 500 Internal Server
> Error[\r][\n]"
> [2015-02-18 17:21:03,087] DEBUG - wire >> "Set-Cookie:
> JSESSIONID=0237C1E4DE9BF80352E1CB6C63D9B01B; Path=/; HttpOnly[\r][\n]"
> [2015-02-18 17:21:03,088] DEBUG - wire >> "Content-Type:
> text/xml;charset=UTF-8[\r][\n]"
> [2015-02-18 17:21:03,088] DEBUG - wire >> "Transfer-Encoding:
> chunked[\r][\n]"
> [2015-02-18 17:21:03,088] DEBUG - wire >> "Date: Wed, 18 Feb 2015 11:51:03
> GMT[\r][\n]"
> [2015-02-18 17:21:03,088] DEBUG - wire >> "Connection: close[\r][\n]"
> [2015-02-18 17:21:03,088] DEBUG - wire >> "Server: WSO2 Carbon
> Server[\r][\n]"
> [2015-02-18 17:21:03,089] DEBUG - wire >> "[\r][\n]"
> [2015-02-18 17:21:03,089] DEBUG - wire >> "5da[\r][\n]"
> [2015-02-18 17:21:03,089] DEBUG - wire >> "<?xml version='1.0'
> encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Body><soapenv:Fault
> xmlns:axis2ns2="http://ws.wso2.org/dataservice";><faultcode>axis2ns2:VALIDATION_ERROR</faultcode><faultstring>DS
> Fault Message: Error in DS non result invoke.[\n]"
> [2015-02-18 17:21:03,089] DEBUG - wire >> "DS Code: VALIDATION_ERROR[\n]"
> [2015-02-18 17:21:03,089] DEBUG - wire >> "Nested Exception:-[\n]"
> [2015-02-18 17:21:03,089] DEBUG - wire >>
> "javax.xml.stream.XMLStreamException: DS Code: VALIDATION_ERROR[\n]"
> [2015-02-18 17:21:03,089] DEBUG - wire >> "Source Data Service:-[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "Name: RDBMSSample[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "Location:
> /samples/RDBMSSample.dbs[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "Description: N/A[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "Default Namespace:
> http://ws.wso2.org/dataservice/samples/rdbms_sample[\n]";
> [2015-02-18 17:21:03,090] DEBUG - wire >> "Current Request Name:
> addEmployee[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "Current Params: {lastName=?,
> email=?, salary=?, employeeNumber=?, firstName=?}[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "Nested Exception:-[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "The value length must be
> between 3 and 20[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "Field Name: lastName[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "Field Value: ?[\n]"
> [2015-02-18 17:21:03,090] DEBUG - wire >> "[\n]"
> [2015-02-18 17:21:03,091] DEBUG - wire >>
> "</faultstring><detail><axis2ns1:DataServiceFault xmlns:axis2ns1="
> http://ws.wso2.org/dataservice";>DS Fault Message: Error in DS non result
> invoke.[\n]"
> [2015-02-18 17:21:03,091] DEBUG - wire >> "DS Code: VALIDATION_ERROR[\n]"
> [2015-02-18 17:21:03,091] DEBUG - wire >> "Nested Exception:-[\n]"
> [2015-02-18 17:21:03,091] DEBUG - wire >>
> "javax.xml.stream.XMLStreamException: DS Code: VALIDATION_ERROR[\n]"
> [2015-02-18 17:21:03,091] DEBUG - wire >> "Source Data Service:-[\n]"
> [2015-02-18 17:21:03,091] DEBUG - wire >> "Name: RDBMSSample[\n]"
> [2015-02-18 17:21:03,091] DEBUG - wire >> "Location:
> /samples/RDBMSSample.dbs[\n]"
> [2015-02-18 17:21:03,091] DEBUG - wire >> "Description: N/A[\n]"
> [2015-02-18 17:21:03,092] DEBUG - wire >> "Default Namespace:
> http://ws.wso2.org/dataservice/samples/rdbms_sample[\n]";
> [2015-02-18 17:21:03,092] DEBUG - wire >> "Current Request Name:
> addEmployee[\n]"
> [2015-02-18 17:21:03,092] DEBUG - wire >> "Current Params: {lastName=?,
> email=?, salary=?, employeeNumber=?, firstName=?}[\n]"
> [2015-02-18 17:21:03,092] DEBUG - wire >> "Nested Exception:-[\n]"
> [2015-02-18 17:21:03,092] DEBUG - wire >> "The value length must be
> between 3 and 20[\n]"
> [2015-02-18 17:21:03,092] DEBUG - wire >> "Field Name: lastName[\n]"
> [2015-02-18 17:21:03,093] DEBUG - wire >> "Field Value: ?[\n]"
> [2015-02-18 17:21:03,093] DEBUG - wire >> "[\n]"
> [2015-02-18 17:21:03,093] DEBUG - wire >>
> "</axis2ns1:DataServiceFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>[\r][\n]"
> [2015-02-18 17:21:03,094] DEBUG - wire >> "0[\r][\n]"
> [2015-02-18 17:21:03,094] DEBUG - wire >> "[\r][\n]"
>
> Thanks,
> Suhan
>
> --
> Suhan Dharmasuriya
> Software Engineer - Test Automation
>
> *WSO2, Inc. *
>
> lean . enterprise . middleware
> Tel: +94 112 145345
> Mob: +94 779 869138
> Blog: http://suhan-opensource.blogspot.com/
>



-- 
Suhan Dharmasuriya
Software Engineer - Test Automation

*WSO2, Inc. *

lean . enterprise . middleware
Tel: +94 112 145345
Mob: +94 779 869138
Blog: http://suhan-opensource.blogspot.com/

Attachment: RDBMSSample.dbs
Description: Binary data

_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to