[JBossWS] - Problem with exceptions
by sashaxiv
i am running jboss 4.2 with jbossws. I have two service methods. they work fine if i don't declare the exceptions throwed by them.
if i add exceptions to the methods, when i execute the client side it askes my
for the the exceptions throwed but with the sufix "bean" and it crashes because the client can't find the classes with that prefix.
What can i do?
| Exception in thread "Thread-39" class: com.satdatatelecom.satdataweb.model.session.session.jaxws.PalabraProhibidaExceptionBean could not be found
| at com.sun.xml.internal.ws.modeler.RuntimeModeler.getClass(Unknown Source)
| at com.sun.xml.internal.ws.modeler.RuntimeModeler.processExceptions(Unknown Source)
| at com.sun.xml.internal.ws.modeler.RuntimeModeler.processRpcMethod(Unknown Source)
| at com.sun.xml.internal.ws.modeler.RuntimeModeler.processMethod(Unknown Source)
| at com.sun.xml.internal.ws.modeler.RuntimeModeler.processClass(Unknown Source)
| at com.sun.xml.internal.ws.modeler.RuntimeModeler.buildRuntimeModel(Unknown Source)
| at com.sun.xml.internal.ws.client.ServiceContextBuilder.processAnnotations(Unknown Source)
| at com.sun.xml.internal.ws.client.ServiceContextBuilder.completeServiceContext(Unknown Source)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.processServiceContext(Unknown Source)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(Unknown Source)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
| at javax.xml.ws.Service.getPort(Unknown Source)
| at com.satdatatelecom.satdataweb.gui.login.DoLogin.doLogin(DoLogin.java:212)
| at com.satdatatelecom.satdataweb.gui.login.thread.LoginThread.run(LoginThread.java:90)
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052475#4052475
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052475
17 years, 7 months
[JBossWS] - Re: problem calling webservice from client
by sashaxiv
i could solve the problem adding a pluging to eclipse to show wsdl files. I was calling an url incorrect.
Now the client connect to jboss and execute a simple webservice echo, but my service to login crashes, with a error i can`t undestand.
The client connects the administration server (jboss) and when i print what is it doing, it prints corrects values and it returns the correct loginVO object, but when it returns to the client i receive the next exception from jboss:
| 2007-06-08 10:13:10,821 ERROR [org.jboss.ws.core.server.AbstractServiceEndpointServlet] Error processing web service request
| javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
| - with linked exception:
| [javax.xml.bind.JAXBException: com.satdatatelecom.satdataweb.model.permiso.vo.ConcesionVO nor any of its super class is known to this context]
| at org.jboss.ws.core.jaxws.JAXBSerializer.handleMarshallException(JAXBSerializer.java:109)
| at org.jboss.ws.core.jaxws.JAXBSerializer.serialize(JAXBSerializer.java:89)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052441#4052441
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052441
17 years, 7 months
[JBossWS] - Re: Duplicate SOAP body/envelope tags in SOAP message
by jopere
I succeeded in calling a web service, from a web service. However, I'd really like someone out there who knows what they are doing to show me how to do this correctly. I am sure there is a better way than what I did.
This is how I got it to work:
1. Create web service B as a stateless session bean web service using wstools to create artifacts (ejb 2.1). Deployed web service.
2. Create web service A as a stateless session bean using wscompile to generate web service artifacts. Copied WSDL from web service B and used wscompile to create client artifacts. However, I don't ever use the generated stub/service/serializer classes, because when I do, I get a SOAP message with duplicate body/envelope tags. What I do is create my own SOAP message using a SOAPMessageFactory. Then I added namespacese, attributes and elements to the message so it complies with the WSDL. Next I create a connection and call the web service. When the message returns I parse it, retrieve the return value and pass it back to the client.
3. Create a web client that calls web service A. Web service A calls web service B, which returns a value to A, which returns a value to the client.
So, web service A is both a server to the web client and a client to web service B. Web service A recieves the SOAP message from the web client and immediately calls web service B. Here is the code in web service A that calls web service B:
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection connection = scf.createConnection();
MessageFactory msgFactory = MessageFactory.newInstance();
// Create a message
SOAPMessage msg = msgFactory.createMessage();
// Create an envelope in the message
SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
// Bind ns0 namespace
envelope.addNamespaceDeclaration("ns0","http://aaa/bbb/1.0");
// Get hold of the the body
SOAPBody body = envelope.getBody();
body.addChildElement(envelope.createName("ns0:getGreeting", "", ""))
.addAttribute(envelope.createName("ns0"), "http://aaa/bbb/1.0");
URL endpoint = new URL("http://localhost:8082/ws/getGreeting");
msg.saveChanges();
// Make call to web service
SOAPMessage soapMessage = connection.call(msg, "http://localhost:8082/ws/getGreeting");
soapMessage.writeTo(System.out);
// The return value is in the grandchild element to the body tag.
Iterator it = soapMessage.getSOAPBody().getChildElements();
SOAPElement child = it.next();
Iterator it2 = child.getChildElements();
SOAPElement result = it2.next();
responseMessage = result.getValue();
As I said, there has to be an easier way to do this. If someone could show me a simpler way to call a web service from a web service, I'd appreciate it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052309#4052309
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052309
17 years, 7 months
[JBossWS] - jbossws 1.2.1 /jboss 4.0.5 : how do i bypass MessageFactor
by swaminathan.ramaswamy
Hi ,
I have been encountering the following exception over the last couple of days .
I am aware that the reason for this issue is because of using a different SOAPFactory class, while jboss expects org.jboss.ws.core.soap.SOAPEnvelopeImpl.
I am trying to run oracle's bpel process on jboss , and the bpel engine needs it's own implementation of SOAPElement/SOAPFactory to process Webservice calls - when i try sending Jboss's SOAPElement , the bpel process fails without any error message
Is it possible for me to by pass Jboss' MessageFactory/SOAPFactory classes by setting some classloader hierarchy
java.lang.ClassCastException: oracle.j2ee.ws.saaj.soap.soap11.Element11
at org.jboss.ws.core.soap.SOAPEnvelopeImpl.(SOAPEnvelopeImpl.java:59)
at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:116)
at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:85)
at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:254)
at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:179)
at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:197)
at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
Thanks,
Swami
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052210#4052210
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052210
17 years, 7 months