Re: [Dev] ESB proxy service for mix of TwoChannel and InOnly operations

2015-12-11 Thread Ayoma Wijethunga
Hi Jagath,

It was only a test service and I have attached class with this. Full source
is available at [1] as well.

Problem occurs with "void confirmOrder(-)" method because it is an InOnly
operation.  Unless "OUT_ONLY" property is applied on endpoint, ESB tries to
get return value of above operation invocation, resulting in the exception.

Hence, wanted to check with team what is the best approach to follow while
defining proxy for a WSDL that has both InOnly and TwoChannel operations in
a mix.

[1] https://svn.wso2.com/wso2/interns/2013/ayoma/Axis2

Thanks and best regards,
Ayoma.

On Fri, Dec 11, 2015 at 2:18 PM, Jagath Sisirakumara Ariyarathne <
jaga...@wso2.com> wrote:

> Hi Ayoma,
>
> Could you please share your OrderProcessor service class.
>
> Thanks.
>
> On Thu, Dec 10, 2015 at 5:10 PM, Ayoma Wijethunga  wrote:
>
>> Hi All,
>>
>> This is relevant to WSO2 ESB 4.9.0.
>>
>> In WSDL attached [1], there are five TwoChannelAxisOperation(s) and one
>> InOnlyAxisOperation. In such situation, if we create a single proxy service
>> in ESB with configuration [2
>> ],
>> InOnlyAxisOperation will fail with below exception :
>>
>> ERROR - NativeWorkerPool Uncaught exception
>>> java.lang.UnsupportedOperationException: An access occurred that is not
>>> valid.
>>> at
>>> org.apache.axis2.description.InOnlyAxisOperation.getMessage(InOnlyAxisOperation.java:117)
>>> .
>>>
>>
>> ​​It was observed that it is possible to use "OUT_ONLY" and
>> "FORCE_SC_ACCEPTED" to correct this [3
>> ]
>> [4
>> ].
>> But relevant transport property applies to endpoint, resulting in
>> TwoChannelAxisOperation to fail if applied.
>>
>> When creating proxy service for a web service, what is the best practice
>> to follow in order to avoid this type of problems?
>> Do we create,
>>
>>- separate proxy services for each set of operations
>>- use "switch" or "filter" mediator in the "in sequence" and "send"
>>to OUT_ONLY endpoint depending on operation
>>
>> or what is the best path to follow?
>>
>> [1]
>> ​​https://drive.google.com/a/wso2.com/file/d/0B-0UyBaVrBStMDczTkRmMkhxcDg/view?usp=drive_web​
>> 
>> [2] ​​
>> https://drive.google.com/a/wso2.com/file/d/0B-0UyBaVrBStV3NhTG4wMWhvRFE/view?usp=drive_web
>> [3]
>> https://docs.wso2.com/display/ESB481/Sample+12%3A+One-Way+Messaging+in+a+Fire-and-Forget+Mode+through+ESB
>> [4]
>> https://docs.wso2.com/display/ESB481/HTTP+Transport+Properties#HTTPTransportProperties-FORCE_SC_ACCEPTED
>>
>> Thanks and best regards,
>> Ayoma Wijethunga
>> Software Engineer
>> WSO2, Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> Mobile : +94 (0) 719428123 <+94+(0)+719428123>
>> Blog : http://www.ayomaonline.com
>> LinkedIn: https://www.linkedin.com/in/ayoma
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Jagath Ariyarathne
> Technical Lead
> WSO2 Inc.  http://wso2.com/
> Email: jaga...@wso2.com
> Mob  : +94 77 386 7048
>
>


-- 
Ayoma Wijethunga
Software Engineer
WSO2, Inc.; http://wso2.com
lean.enterprise.middleware

Mobile : +94 (0) 719428123 <+94+(0)+719428123>
Blog : http://www.ayomaonline.com
LinkedIn: https://www.linkedin.com/in/ayoma
/*
 * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.wso2.fasttrack.axis2.orderprocessor.processor;

import java.math.BigDecimal;

import com.wso2.fasttrack.axis2.orderprocessor.datamodel.init.PaymentMethod;
import com.wso2.fasttrack.axis2.orderprocessor.datamodel.init.ShippingMethod;
import com.wso2.fasttrack.axis2.orderprocessor.datamodel.item.Item;
import com.wso2.fasttrack.axis2.orderprocessor.datamodel.order.Order;
import com.wso2.fasttrack.axis2.orderprocessor.datamodel.order.OrderItem;
import com.wso2.fasttrack.axis2.orderprocessor.datastore.DataStoreErrors;
import com.wso2.fasttrack.axis2.orderprocessor.datastore.ItemStore;
import com.wso2.fasttrack.axis2.orderprocessor.datastore.OrderItemStore;
import com.wso2.fasttrack.axis2.orderprocessor.datastore.OrderS

Re: [Dev] ESB proxy service for mix of TwoChannel and InOnly operations

2015-12-11 Thread Jagath Sisirakumara Ariyarathne
Hi Ayoma,

Could you please share your OrderProcessor service class.

Thanks.

On Thu, Dec 10, 2015 at 5:10 PM, Ayoma Wijethunga  wrote:

> Hi All,
>
> This is relevant to WSO2 ESB 4.9.0.
>
> In WSDL attached [1], there are five TwoChannelAxisOperation(s) and one
> InOnlyAxisOperation. In such situation, if we create a single proxy service
> in ESB with configuration [2
> ],
> InOnlyAxisOperation will fail with below exception :
>
> ERROR - NativeWorkerPool Uncaught exception
>> java.lang.UnsupportedOperationException: An access occurred that is not
>> valid.
>> at
>> org.apache.axis2.description.InOnlyAxisOperation.getMessage(InOnlyAxisOperation.java:117)
>> .
>>
>
> ​​It was observed that it is possible to use "OUT_ONLY" and
> "FORCE_SC_ACCEPTED" to correct this [3
> ]
> [4
> ].
> But relevant transport property applies to endpoint, resulting in
> TwoChannelAxisOperation to fail if applied.
>
> When creating proxy service for a web service, what is the best practice
> to follow in order to avoid this type of problems?
> Do we create,
>
>- separate proxy services for each set of operations
>- use "switch" or "filter" mediator in the "in sequence" and "send" to
>OUT_ONLY endpoint depending on operation
>
> or what is the best path to follow?
>
> [1]
> ​​https://drive.google.com/a/wso2.com/file/d/0B-0UyBaVrBStMDczTkRmMkhxcDg/view?usp=drive_web​
> 
> [2] ​​
> https://drive.google.com/a/wso2.com/file/d/0B-0UyBaVrBStV3NhTG4wMWhvRFE/view?usp=drive_web
> [3]
> https://docs.wso2.com/display/ESB481/Sample+12%3A+One-Way+Messaging+in+a+Fire-and-Forget+Mode+through+ESB
> [4]
> https://docs.wso2.com/display/ESB481/HTTP+Transport+Properties#HTTPTransportProperties-FORCE_SC_ACCEPTED
>
> Thanks and best regards,
> Ayoma Wijethunga
> Software Engineer
> WSO2, Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile : +94 (0) 719428123 <+94+(0)+719428123>
> Blog : http://www.ayomaonline.com
> LinkedIn: https://www.linkedin.com/in/ayoma
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Jagath Ariyarathne
Technical Lead
WSO2 Inc.  http://wso2.com/
Email: jaga...@wso2.com
Mob  : +94 77 386 7048
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] ESB proxy service for mix of TwoChannel and InOnly operations

2015-12-10 Thread Ayoma Wijethunga
Hi All,

This is relevant to WSO2 ESB 4.9.0.

In WSDL attached [1
],
there are five TwoChannelAxisOperation(s) and one InOnlyAxisOperation. In
such situation, if we create a single proxy service in ESB with
configuration [2
],
InOnlyAxisOperation will fail with below exception :

ERROR - NativeWorkerPool Uncaught exception
> java.lang.UnsupportedOperationException: An access occurred that is not
> valid.
> at
> org.apache.axis2.description.InOnlyAxisOperation.getMessage(InOnlyAxisOperation.java:117)
> .
>

​​It was observed that it is possible to use "OUT_ONLY" and
"FORCE_SC_ACCEPTED" to correct this [3
]
[4
].
But relevant transport property applies to endpoint, resulting in
TwoChannelAxisOperation to fail if applied.

When creating proxy service for a web service, what is the best practice to
follow in order to avoid this type of problems?
Do we create,

   - separate proxy services for each set of operations
   - use "switch" or "filter" mediator in the "in sequence" and "send" to
   OUT_ONLY endpoint depending on operation

or what is the best path to follow?

[1]
​​https://drive.google.com/a/wso2.com/file/d/0B-0UyBaVrBStMDczTkRmMkhxcDg/view?usp=drive_web​

[2] ​​
https://drive.google.com/a/wso2.com/file/d/0B-0UyBaVrBStV3NhTG4wMWhvRFE/view?usp=drive_web
[3]
https://docs.wso2.com/display/ESB481/Sample+12%3A+One-Way+Messaging+in+a+Fire-and-Forget+Mode+through+ESB
[4]
https://docs.wso2.com/display/ESB481/HTTP+Transport+Properties#HTTPTransportProperties-FORCE_SC_ACCEPTED

Thanks and best regards,
Ayoma Wijethunga
Software Engineer
WSO2, Inc.; http://wso2.com
lean.enterprise.middleware

Mobile : +94 (0) 719428123 <+94+(0)+719428123>
Blog : http://www.ayomaonline.com
LinkedIn: https://www.linkedin.com/in/ayoma
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev