[JBossWS] - Invalid number of payload elements
by jlankfo
Sorry I have searched and searched but I can't find information on this error anywhere. I am attempting to add a soap fault to a soap context in a rather large application. The code to add the fault is below.
| SOAPFactory soapFactory = SOAPFactory.newInstance();
| SOAPBody soapbody = soapMsgContext.getMessage().getSOAPBody();
| SOAPFault fault = soapbody.getFault();
| fault = soapbody.addFault();
| Name fc = soapFactory.createName("Server",null,SOAPConstants.URI_NS_SOAP_ENVELOPE);
| fault.setFaultCode(fc);
| fault.setFaultString("Testing123");
| fault.setFaultActor("http://localhost:8080/Converter");
| fault.addDetail().addChildElement("test");
|
I keep getting this error and I don't have any clue what it means.
| org.jboss.ws.WSException: Invalid number of payload elements: 2
| at org.jboss.ws.core.CommonSOAPBinding.unbindRequestMessage(CommonSOAPBinding.java:379)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:213)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:474)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131)
| at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
|
Can anyone shed some light on this error?
Note: I am adding other things to the header but the application works fine without the above fault script however it is when I add it in that it starts breaking.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4245386#4245386
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4245386
15 years, 5 months
[JBossWS] - Problem deploy WS in JBOSS 4.3
by konstt2000
Hi,
I've work with WS.
@WebService
| @SOAPBinding(
| style = SOAPBinding.Style.DOCUMENT,
| use = SOAPBinding.Use.LITERAL,
| parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
| )
| public class WebServiceGde {
|
|
| @WebMethod
| public ResultadoGde guardar(MiClase solicitudes){
|
| ResultadoGde resultadoGde = new ResultadoGde();
| resultadoGde.setCodigoError(11);
| resultadoGde.setDescripcion("KO");
|
| return resultadoGde;
| }
| }
public class MiClase {
| private long cdSolicitud;
| private int cdEstado;
| private int cdTipoSolicitud;
| private String cdTipoTrans;
| private Date fechaRecepc;
|
| private Date fechaUltModif;
| private String origen;
| private Long idProcesoBpm;
| private String estadoInterno;
| private String notas;
|
| private String indExento;
| private String indCartera;
| private String indTarifa;
| private String indesglo;
| private String desviosx;
|
| private String secundar;
| private String terciari;
| private String segdiari;
| private String segintra;
| private boolean invirtua;
|
| private String segtreal;
| /*private String resecund;
| private String pruebasx;*/
| //Getter and Setter..
If I deployment:
12:25:59,122 INFO [DefaultEndpointRegistry] register: jboss.ws:context=WebServicesGDE,endpoint=WebServiceGde
| 12:25:59,122 INFO [DefaultEndpointRegistry] register: jboss.ws:context=WebServicesGDE,endpoint=HolaMundoWs
| 12:25:59,154 INFO [TomcatDeployer] deploy, ctxPath=/WebServicesGDE, warUrl=.../tmp/deploy/tmp55743WebServicesGDE-exp.war/
| 12:25:59,325 ERROR [MainDeployer] Could not start deployment: file:/D:/jboss-soa-p.4.3.0/jboss-as_SOA/server/default/deploy/WebServicesGDE.war
| java.lang.ClassFormatError: Invalid constant pool index 63 in class file es/ree/gde/webservice/modelo/MiClase
| at java.lang.ClassLoader.defineClass1(Native Method)
I've tring delete some parameter the MiClase.java and it work fine.
If I add more parameter the error:
java.lang.ClassFormatError: Repetitive
| > > method name/signature...
I've tring with JDK5 and JDK6
¿?¿? It's a bug JBOSS ?
Thanks.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244922#4244922
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244922
15 years, 5 months
[JBossWS] - Inheritance problem
by pio1k
Hello.
I have a problem with class inheritance in web services. I want to make a web service with one method to add objects of classes (B, C and other in the future) which inheritated from my basic class (A). My source code:
Server side:
1) TestService.java
@WebService(serviceName = "TestService")
| @Stateless
| @XmlSeeAlso({B.class, C.class})
| public class TestService {
| @EJB
| TestMgmtLocal tl = null;
|
| @WebMethod(operationName = "testAddA")
| public @WebResult(name = "A")
| A testAddA(@WebParam(name = "testA") A testA) {
| return tl.testAddA(testA);
| }
| }
2) TestMgmtLocal.java
@Local
| public interface TestMgmtLocal extends TestMgmtRemote {
|
| }
3) TestMgmtRemote.java
@Remote
| public interface TestMgmtRemote {
| A testAddA(A testA);
| }
4) TestMgmt.java
@Stateless
| public class TestMgmt implements TestMgmtLocal {
| @Resource
| private SessionContext ctx = null;
|
| public A testAddA(A testA) {
| if (testA instanceof A) {
| System.out.println("class A");
| }
|
| if (testA instanceof B) {
| System.out.println("class B");
| }
|
| if (testA instanceof C) {
| System.out.println("class C");
| }
|
| return testA;
| }
| }
5) A.java
public class A implements Serializable {
|
| private static final long serialVersionUID = 110181269433550832L;
|
| private int a = -1;
|
| public int getA() {
| return a;
| }
|
| public void setA(int a) {
| this.a = a;
| }
| }
6) B.java
public class B extends A implements Serializable {
|
| private static final long serialVersionUID = 6921792702940813727L;
|
| private int b = -1;
|
| public int getB() {
| return b;
| }
|
| public void setB(int b) {
| this.b = b;
| }
| }
7) C.java
public class C extends A implements Serializable {
|
| private static final long serialVersionUID = 7823155353151239133L;
|
| private int c = -1;
|
| public int getC() {
| return c;
| }
|
| public void setC(int c) {
| this.c = c;
| }
| }
Client side:
1) TestClient.java
public class TestClient {
|
| public static void main(String[] args) {
| TestServiceProxy proxy = new TestServiceProxy();
| TestService_PortType port = proxy.getTestService_PortType();
| try {
| C c = new C();
| c.setA(2);
| c.setC(3);
| port.testAddA(c);
| } catch(RemoteException e) {
| System.out.println(e);
| }
| }
| }
I found this page:
http://blog.vinodsingh.com/2008/09/anytype-object-over-webservice-and.html
but it doesn't work in my web service. In testAddA method I always get an object of A class (when I send from client object of B or C class). I've also tried to add @XmlSeeAlso annotation to A class but it doesn't help. Maybe I did something wrong? Any ideas? Any other solutions of this problem?
I'm using:
1) JBoss 4.2.3GA (I tired also on JBoss 5.1.GA)
2) Java 1.5 update 15
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244837#4244837
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244837
15 years, 5 months