Raymond Feng a écrit :
Hi,
It seems that you use the implementation class instead of the
interface for the reference.
@Reference
public AccountImpl ComReference;
Can you change it to be:
@Reference
public Account ComReference; // I assume Account is a generated
JAX-WS interface
Thanks,
Raymond
--------------------------------------------------
From: "houssem ZAIR" <[email protected]>
Sent: Tuesday, July 21, 2009 3:25 AM
To: <[email protected]>
Subject: Re: My SCA application cannot communicate with a jax-ws service
Raymond Feng a écrit :
Hi,
Do you use the generated JAX-WS interface for the SCA reference too?
Thanks,
Raymond
--------------------------------------------------
From: "houssem" <[email protected]>
Sent: Monday, July 20, 2009 4:54 AM
To: <[email protected]>
Subject: My SCA application cannot communicate with a jax-ws service
I am running an SCA application referencing a JAX-WS service on
Tuscany 1.5 / 2.0 (?).
The problem is that no matter what the parameters are, the result
is always the same.
As an example, my web service has an opeartion returning an integer.
And the returned integer is always 0, while it should have another
value.
My web service is created with jax-ws. It's a simple web service
(request : send an integer, response : receive the same integer)
-----------------------------------------------------
import javax.jws.*;
@WebService
public class AccountImpl implements Account {
@WebMethod
public Integer getPrice(int price) {
return price;
}
}
The artefacts are generated with Wsimport.
What is the reason of this problem?
Houssem.
P.S.: there is no problem if the web service is an SCA project
exposed as a web service and running on Tuscany.
Hi,
Yes,
I use the generated JAX-WS interface for the SCA reference.
------------------------------------------------
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
@Service(Commerce.class)
public class ComImpl implements Com{
@Reference
public AccountImpl ComReference; public Integer getPrice(int
i) { Integer price = this.ComReference.getPrice(i);
return price;
}
}
Hi,
I have specified the endpoint interface in the JAX-WS annotation
associated to my class.
Therefore, after the generation of the artefacts, I have the Account
interface instead of AccountImpl and it worked.
Thank you for your help,
Houssem
The solution:
-----------------------------------
import javax.jws.*;
@WebService( serviceName = "AccountService",
endpointInterface="Account",
portName="AccountPort")
public class AccountImpl implements Account {
public Integer getPrice(int price) {
return price;
}
}
-----------------------------------
@WebService
public interface Account {
@WebMethod
@WebResult( name = "responsePrice")
@RequestWrapper( localName = "getPrice",
className="getPrice")
@ResponseWrapper( localName = "PriceStringResponse",
className="getPriceResponse")
public Integer getPrice( @WebParam(name = "price") int price) ;
}