[JBossWS] - java.lang.ClassCastException: org.jboss.ws.core.soap.SOAPMes
by pacer11
I am using JBossWS with JBoss 4.2.3 with JDK 1.5 and getting the following Exception when executing a test Web Service. The Web Service is successfully deployed
04:10:39,318 ERROR [[AccountService]] Servlet.service() for servlet AccountServi
ce threw exception
java.lang.ClassCastException: org.jboss.ws.core.soap.SOAPMessageImpl
at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.toSOAPMessage(SOAPFaultH
elperJAXWS.java:245)
at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.exceptionToFaultMessage(
SOAPFaultHelperJAXWS.java:174)
at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.createFaultMessage
FromException(SOAP11BindingJAXWS.java:104)
at org.jboss.ws.core.CommonSOAPBinding.bindFaultMessage(CommonSOAPBindin
g.java:671)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHan
dlerImpl.java:488)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand
lerImpl.java:284)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl
.java:201)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(Request
HandlerImpl.java:134)
at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java
:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
lter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
yAssociationValve.java:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
e.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
Any Ideas??
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169225#4169225
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169225
16 years, 5 months
[JBossWS] - How to get complex types fully defined by exposed WSDL
by mick_mcgovern@hotmail.com
Hi,
I've got a web service EJB with a method signature that includes some of our own classes.
Problem is that the exposed WSDL defines these classes as complex but then does not provide the detailed definition - meaning that a client would not be able to dynamically call the method based purely on reading the WSDL.
Is there a way to get the exposed WSDL to fully define the complex types?
Code fragment and generated WSDL follows.
Thanks
JBoss AS 4.2.0
@WebService(name = "EnquireAccountServiceBean", targetNamespace = ServiceConstants.WEB_SERVICE_NAME_SPACE, serviceName = "EnquireAccountServiceBean")
@WebContext(contextRoot = "/XMLTranServiceBeanService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Stateless(name = "EnquireAccountServiceBean")
public class EnquireAccountServiceBean extends BaseServiceBean implements EnquireAccountService {
@WebMethod
public AccountBalance enquireAccountBalance(TransactionInfo info, String accountNum) {
......
Exposed WSDL:
<xs:schema targetNamespace="http://www.whatever.com" version="1.0">
<xs:complexType name="transactionInfo"/>
<xs:complexType name="accountBalance"/>
</xs:schema>
......
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169214#4169214
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169214
16 years, 5 months
[JBossWS] - get complex type in web service client
by argol1278
Whene i invoke web service in client application i have java.lang.NullPointerException.
In log in SOAP message there are values but client can't get them. This is what i have done:
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "Users",namespace="http://webServices.ejb/" ,propOrder = { "userid","name","surname","login",
| "password","status","email" })
| @XmlRootElement(namespace="http://webServices.ejb/", name = "test")
| public class Users implements Serializable{
|
| @XmlElement(namespace="http://webServices.ejb/",name="userid")
| private int userid;
| @XmlElement(namespace="http://webServices.ejb/")
| private String name;
| @XmlElement(namespace="http://webServices.ejb/")
| private String surname;
| @XmlElement(namespace="http://webServices.ejb/")
| private String login;
| @XmlElement(namespace="http://webServices.ejb/")
| private String password;
| @XmlElement(namespace="http://webServices.ejb/")
| private int status;
| @XmlElement(namespace="http://webServices.ejb/")
| private String email;
| @XmlTransient
| private Set addresses = new HashSet(0);
| @XmlTransient
| private Set accounts = new HashSet(0);
|
|
|
| public Users() {
| }
|
| public int getUserid() {
| return this.userid;
| }
|
| public void setUserid(int userid) {
| this.userid = userid;
| }
|
| public String getName() {
| return this.name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| public String getSurname() {
| return this.surname;
| }
|
| public void setSurname(String surname) {
| this.surname = surname;
| }
|
| public String getLogin() {
| return this.login;
| }
|
| public void setLogin(String login) {
| this.login = login;
| }
|
| public String getPassword() {
| return this.password;
| }
|
| public void setPassword(String password) {
| this.password = password;
| }
|
| public int getStatus() {
| return this.status;
| }
|
| public void setStatus(int status) {
| this.status = status;
| }
|
| public String getEmail() {
| return this.email;
| }
|
| public void setEmail(String email) {
| this.email = email;
| }
|
| public Set getAccounts() {
| return accounts;
| }
|
| public void setAccounts(Set accounts) {
| this.accounts = accounts;
| }
|
| public Set getAddresses() {
| return addresses;
| }
|
| public void setAddresses(Set addresses) {
| this.addresses = addresses;
| }
|
|
| }
|
|
| @Stateless(mappedName = "UsersOperations")
| @WebService(name = "UsersOperations")
| public class UsersOperations implements UsersOperationsEjbRemote, UsersOperationsEjbLocal {
|
| /**
| * Default constructor.
| */
| public UsersOperations() {
| // TODO Auto-generated constructor stub
| }
|
| @WebMethod
| public Users test(@WebParam(name = "userid") int userid){
| // Hibernate query
| Users u = queryUserDetails(userid);
| System.out.println(u.getLogin());
| return u;
| }
|
|
| }
|
CLIENT
| @WebService(name = "UsersOperations", targetNamespace = "http://webServices.ejb/")
| @XmlSeeAlso({bankDB.Users.class})
| public interface UsersOperations {
|
| @WebMethod
| @WebResult(targetNamespace = "http://webServices.ejb/")
| public Users test(@WebParam(name = "userid") int userid);
| }
|
| @WebServiceClient(name = "UsersOperationsService", targetNamespace = "http://webServices.ejb/", wsdlLocation = "http://127.0.0.1:8080/Bank-BankEJB/UsersOperations?wsdl")
| public class UsersOperationsService
| extends Service
| {
|
| private final static URL UsersOperationsService_WSDL_LOCATION;
|
| static {
| URL url = null;
| try {
| url = new URL("http://127.0.0.1:8080/Bank-BankEJB/UsersOperations?wsdl");
| } catch (MalformedURLException e) {
| e.printStackTrace();
| }
| UsersOperationsService_WSDL_LOCATION = url;
| }
|
| public UsersOperationsService(URL wsdlLocation, QName serviceName) {
| super(wsdlLocation, serviceName);
| }
|
| public UsersOperationsService() {
| super(UsersOperationsService_WSDL_LOCATION, new QName("http://webServices.ejb/", "UsersOperationsService"));
| }
|
| /**
| *
| * @return
| * returns Notification
| */
| @WebEndpoint(name = "UsersOperationsPort")
| public UsersOperations getUsersOperationsPort() {
| return (UsersOperations)super.getPort(new QName("http://webServices.ejb/", "UsersOperationsPort"), UsersOperations.class);
| }
|
|
| // invoke web service in client
| UsersOperationsService service = newUsersOperationsService();
| UsersOperations ejb = service.getUsersOperationsPort();
| Users u = ejb.test(2);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169025#4169025
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169025
16 years, 5 months