[JBossWS] - Basic Authentication
by jmoring
I have a custom login module that works just fine on non-web service applications. However on web service (EJB endpoint) it is called just fine but the callback handler for the user name always returns null. I have tried annotations (@SecurityDomain, @WebContext) and I have tried using a jboss.xml but nothing seems to work.
I have verified that the .NET 2.0 and/or .NET 3.5 client is sending the Authorization http header.
What is the secret here!!!!
package com.xxxxxxxx.ws.autopilot;
import javax.annotation.security.*;
import javax.ejb.*;
import javax.jws.*;
import javax.jws.soap.*;
import org.jboss.annotation.security.*;
import org.jboss.ws.annotation.*;
@Stateless
@SecurityDomain(value="MyLoginModule")
@WebService
(
name="Autopilot",
targetNamespace = "http://opas.xxxxxxxxx.net/Xxxxxxxxxxxx",
serviceName = "AutopilotService"
)
@RolesAllowed("Everyone")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebContext(contextRoot="/Autopilot", urlPattern="/*", authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=false)
public class Autopilot
{
@WebMethod
@PermitAll
public String ping( String Value )
{
return Value.toUpperCase();
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140751#4140751
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140751
18 years
[JBossWS] - WS-Security and Dispatch
by esacchi
Dear Sirs:
We was working with JAXWS "Dispatch" to dynamically invoke a WS endpoint with WS-Security, and we had some problems that we
couldn't solve yet. We will appreciate your help.
When the program invokes the endpoint using the static class build with wsconsume it work properly including the security stuff but when
we use (in the same installation and with the same ws) through Dispatch dynamically the signature is not validated.
The current JBOSS config is Jboss 4.2.2. with jbossws-native-2.0.3.GA
Bellow you can see the WS and client source code and the trace errors for the server and client.
Thanks in advance and best regards
The Web Service Code
| package pkg;
|
| import java.security.Principal;
|
| import javax.annotation.Resource;
| import javax.jws.HandlerChain;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.jws.soap.SOAPBinding.Style;
| import javax.xml.ws.WebServiceContext;
| import javax.xml.ws.handler.MessageContext;
|
| import org.jboss.ws.annotation.EndpointConfig;
|
| @WebService(name = "TestEndpoint", serviceName = "TestEndpointService",
| targetNamespace = "http://org.jboss.ws/jaxws/context")
| @SOAPBinding(style = Style.DOCUMENT)
| @EndpointConfig(configName = "Standard WSSecurity Endpoint")
| public class EndpointJSE {
|
| @Resource
| WebServiceContext wsCtx;
|
| @WebMethod
| public String hello(Person p) {
| return "Hello " + p.getFirstName() + " " + p.getLastName();
| }
| }
|
| public class Person implements Serializable {
|
| private String firstName;
| private String lastName;
|
| public String getFirstName() {
| return firstName;
| }
|
| public void setFirstName(String firstName) {
| this.firstName = firstName;
| }
|
| public String getLastName() {
| return lastName;
| }
|
| public void setLastName(String lastName) {
| this.lastName = lastName;
| }
| }
|
The Client Code
| public class Test {
|
| public static void testWSWeb() {
| setSystemProperties();
| try {
| pruebaInicial();
| } catch (Exception ex) {
| ex.printStackTrace();
| }
| try {
| llamadoDinamico();
| } catch (Exception ex) {
| ex.printStackTrace();
| }
| }
|
| private static void pruebaInicial() {
| TestEndpointService service = new TestEndpointService();
| TestEndpoint port = service.getTestEndpointPort();
| BindingProvider provider = (BindingProvider) port;
|
| provider.getRequestContext()
| .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
| "http://127.0.0.1:8888/M3_Ejemplo03_WSWeb");
|
| /*
| * Agrego handler standard para WS-Security en JBoss Alternativa
| * que le camina por arriba a los otros handlers
| */
| ((StubExt) port).setConfigName("Standard WSSecurity Client");
|
| Person p = new Person();
| p.setFirstName("Emiliano");
| p.setLastName("Sacchi");
| System.out.println(port.hello(p));
| }
|
|
| private static void llamadoDinamico() throws IOException,
| DatatypeConfigurationException {
| URL url = new URL("http://127.0.0.1:8888/M3_Ejemplo03_WSWeb?wsdl");
| URL securityURL = new File(
|
| "/home/esacchi/desarrollo/workspace/M3_Ejemplo03_WSWebClient/src/META-INF/jboss-wsse-client.xml")
| .toURL();
|
| QName serviceName = new QName("http://org.jboss.ws/jaxws/context",
| "TestEndpointService");
| Service service = Service.create(url, serviceName);
| Iterator<QName> i = service.getPorts();
|
| QName name = null;
| while (i.hasNext()) {
| name = (QName) i.next();
| System.out.println(name);
| }
|
| // service.getPort();
|
| Dispatch<Source> sourceDispatch = null;
| sourceDispatch = service.createDispatch(name, Source.class,
| Service.Mode.PAYLOAD);
|
|
| ((ConfigProvider) sourceDispatch).setSecurityConfig(securityURL
| .toExternalForm());
| ((ConfigProvider) sourceDispatch)
| .setConfigName("Standard WSSecurity Client");
|
| String request = "<ns1:hello xmlns:ns1='http://org.jboss.ws/jaxws/context'><arg0><firstName>Emiliano</firstName><lastName>Sacchi</lastName></arg0></ns1:hello>";
| System.out.println("\nInvoking xml request: " + request);
| Source result = sourceDispatch.invoke(new StreamSource(
| new StringReader(request)));
|
| System.out.println("Received xml response: " + result);
|
| Element docElement = DOMUtils.sourceToElement(result);
| Element retElement = DOMUtils.getFirstChildElement(docElement);
| String retPayload = DOMWriter.printNode(retElement, false);
| System.out.println("Received response: " + retPayload);
| }
| }
|
Client Output
pruebaInicial()
| 01-abr-2008 16:47:43 org.apache.xml.security.signature.Reference verify
| INFO: Verification successful for URI "#element-1-1207079263166-18667724"
| 01-abr-2008 16:47:43 org.apache.xml.security.signature.Reference verify
| INFO: Verification successful for URI "#timestamp"
| Hello Emiliano Sacchi
|
llamadoDinamico()
{http://org.jboss.ws/jaxws/context}TestEndpointPort
|
| Invoking xml request: <ns1:hello
| xmlns:ns1='http://org.jboss.ws/jaxws/context'><arg0><firstName>Emiliano</firstName><lastName>Sacchi</lastName></arg0></ns1:hello>
| javax.xml.ws.soap.SOAPFaultException:
| org.jboss.ws.core.CommonSOAPFaultException: Signature is invalid.
| at
| org.jboss.ws.core.jaxws.client.DispatchSOAPBinding.getReturnObject(DispatchSOAPBinding.java:165)
| at
| org.jboss.ws.core.jaxws.client.DispatchImpl.getReturnObject(DispatchImpl.java:447)
| at
| org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternalSOAP(DispatchImpl.java:249)
| at
| org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternal(DispatchImpl.java:168)
| at
| org.jboss.ws.core.jaxws.client.DispatchImpl.invoke(DispatchImpl.java:132)
| at test.Test.llamadoDinamico(Test.java:135)
| at test.Test.testWSWeb(Test.java:55)
| at test.Test.main(Test.java:39)
Server Output
pruebaInicial()
16:47:42,826 INFO [Reference] Verification successful for URI
| "#element-1-1207079261680-33340097"
| 16:47:42,827 INFO [Reference] Verification successful for URI "#timestamp"
llamadoDinamico()
16:47:47,267 WARN [Reference] Verification failed for URI
| "#element-4-1207079267194-23838383"
| 16:47:47,268 INFO [Reference] Verification successful for URI "#timestamp"
| 16:47:47,269 ERROR [WSSecurityDispatcher] Internal error occured
| handling inbound message:
| org.jboss.ws.extensions.security.exception.FailedCheckException:
| Signature is invalid.
| at
| org.jboss.ws.extensions.security.SignatureVerificationOperation.process(SignatureVerificationOperation.java:61)
| at
| org.jboss.ws.extensions.security.SecurityDecoder.decode(SecurityDecoder.java:124)
| at
| org.jboss.ws.extensions.security.SecurityDecoder.decode(SecurityDecoder.java:186)
| at
| org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:149)
| at
| org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:78)
| at
| org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.handleInbound(WSSecurityHandlerServer.java:41)
| at
| org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
| at
| org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:87)
| at
| org.jboss.ws.core.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:128)
| at
| org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:172)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:418)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:274)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:191)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:124)
| 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(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:230)
| at
| org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at
| org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at
| org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 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:157)
| at
| org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at
| org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at
| org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at
| org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at
| org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
| 16:47:47,270 ERROR [HandlerChainExecutor] Exception during handler
| processing
| org.jboss.ws.core.CommonSOAPFaultException: Signature is invalid.
| at
| org.jboss.ws.extensions.security.WSSecurityDispatcher.convertToFault(WSSecurityDispatcher.java:107)
| at
| org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:179)
| at
| org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:78)
| at
| org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.handleInbound(WSSecurityHandlerServer.java:41)
| at
| org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
| at
| org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:87)
| at
| org.jboss.ws.core.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:128)
| at
| org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:172)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:418)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:274)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:191)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:124)
| 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(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:230)
| at
| org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at
| org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at
| org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 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:157)
| at
| org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at
| org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at
| org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at
| org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at
| org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
| 16:47:47,446 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
| javax.xml.ws.WebServiceException:
| org.jboss.ws.core.CommonSOAPFaultException: Signature is invalid.
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.processHandlerFailure(HandlerChainExecutor.java:276)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:155)
| at
| org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:87)
| at
| org.jboss.ws.core.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:128)
| at
| org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:172)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:418)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:274)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:191)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:124)
| 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(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:230)
| at
| org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at
| org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at
| org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 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:157)
| at
| org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at
| org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at
| org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at
| org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at
| org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.ws.core.CommonSOAPFaultException: Signature is invalid.
| at
| org.jboss.ws.extensions.security.WSSecurityDispatcher.convertToFault(WSSecurityDispatcher.java:107)
| at
| org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:179)
| at
| org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:78)
| at
| org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.handleInbound(WSSecurityHandlerServer.java:41)
| at
| org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
| ... 27 more
| 16:47:47,588 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
| javax.xml.ws.WebServiceException:
| org.jboss.ws.core.CommonSOAPFaultException: Signature is invalid.
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.processHandlerFailure(HandlerChainExecutor.java:276)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:155)
| at
| org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:87)
| at
| org.jboss.ws.core.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:128)
| at
| org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:172)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:418)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:274)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:191)
| at
| org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:124)
| 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(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:230)
| at
| org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at
| org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at
| org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 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:157)
| at
| org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at
| org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at
| org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at
| org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at
| org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.ws.core.CommonSOAPFaultException: Signature is invalid.
| at
| org.jboss.ws.extensions.security.WSSecurityDispatcher.convertToFault(WSSecurityDispatcher.java:107)
| at
| org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:179)
| at
| org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:78)
| at
| org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.handleInbound(WSSecurityHandlerServer.java:41)
| at
| org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
| at
| org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
| ... 27 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140728#4140728
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140728
18 years
[JBossWS] - Cyclic web services
by rcarmichael
Let's say I have a web service called getVehicle(int vehicleId) and I'm expecting it to return me a Vehicle object.
If Vehicle has a java.util.Set of Wheel objects, and the Wheel object has a reference to its owner (Vehicle), then obviously there is an issue here when trying to persist to XML because of this bidirectional relationship.
My goal is to have JBoss host this web service, and then use wsimport to create the stub files for the client to use. This part works fine, except the server throws an error when it goes to marshal the object:
Caused by: com.sun.istack.SAXException2: A cycle is detected in the object graph. This will cause infinitely deep XML: org.test.Vehicle@13c6308 -> org.test.Wheel@15880be -> org.test.Vehicle@13c6308
I have read (and hopefully understand) https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html but I don't think it applies in this case because wsimport will be creating the stubs for me.
Is there any way to get this going? I'm guessing I will have to fall back to my last resort, which is making Wheel only have a reference to the Vehicle's ID instead of the Vehicle object.
Thanks,
Ryan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140721#4140721
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140721
18 years
[JBossWS] - Re: JBossWS 3.0.1 Released
by gessedafe
Hello, JBossWS Team guys...
I downloaded the JBossWS 3.0.1 Native 2.0.4 GA this morning. I was using the previous release and facing some problems with the issue JBWS-1763 (problems with charset encoding).
This new version solved my problem, as announced... But, it also gave me a new problem... This new problem has nothing to do with JBWS-1763 issue. It blows up when I try to run the wsconsume tool via ant build (WSConsumeTask).
I'm sure about this problem was not present in previous release. Just using the previous jar files in my ant classpath makes my application work again.
Below goes a simple evidence:
---------------------------------------------------------------------------
Error shown in Eclipse console:
---------------------------------------------------------------------------
[wsconsume] Consuming wsdl: ../src/META-INF//TestCase.wsdl
[wsconsume] Command invoked: org.jboss.wsf.spi.tools.cmd.WSConsume -k -w src/META-INF//TestCase.wsdl -o C:\Desenvolvimento\Java\Workspaces\Europa\TestCase\classes -s C:\Desenvolvimento\Java\Workspaces\Europa\TestCase\gen -v ../src/META-INF//TestCase.wsdl
[wsconsume] Exception in thread "main" java.lang.AbstractMethodError: org.jboss.wsf.spi.tools.WSContractConsumer.setExtension(Z)V
[wsconsume] at org.jboss.wsf.spi.tools.cmd.WSConsume.importServices(WSConsume.java:199)
[wsconsume] at org.jboss.wsf.spi.tools.cmd.WSConsume.main(WSConsume.java:81)
---------------------------------------------------------------------------
My WSDL sample file:
---------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:schema="http://www.sysmap.com.br/schemas/testcase"
xmlns:tns="http://www.sysmap.com.br/webservices/testcase"
targetNamespace="http://www.sysmap.com.br/webservices/testcase"
name="TestCaseServiceDefinition">
<wsdl:types>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.sysmap.com.br/schemas/testcase"
xmlns:tns="http://www.sysmap.com.br/schemas/testcase"
elementFormDefault="qualified">
<xs:element name="myOperationRequest" type="tns:MyOperationRequest" />
<xs:element name="myOperationResponse" type="tns:MyOperationResponse" />
<xs:complexType name="MyOperationRequest">
<xs:attribute name="param" type="xs:string" />
</xs:complexType>
<xs:complexType name="MyOperationResponse">
<xs:attribute name="result" type="xs:string" />
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="myOperationRequestMessage">
<wsdl:part name="body" element="schema:myOperationRequest" />
</wsdl:message>
<wsdl:message name="myOperationResponseMessage">
<wsdl:part name="body" element="schema:myOperationResponse" />
</wsdl:message>
<wsdl:portType name="TestCasePortType">
<wsdl:operation name="myOperation">
<wsdl:input name="myOperationInput" message="tns:myOperationRequestMessage" />
<wsdl:output name="myOperationOutput" message="tns:myOperationResponseMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TestCaseBinding" type="tns:TestCasePortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="myOperation">
<wsdlsoap:operation soapAction="http://www.sysmap.com.br/webservices/testcase/TestCaseService/myOperation" />
<wsdl:input name="myOperationInput">
<wsdlsoap:body use="literal" />
</wsdl:input>
<wsdl:output name="myOperationOutput">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TestCaseService">
<wsdl:port name="TestCasePort" binding="tns:TestCaseBinding">
<wsdlsoap:address location="http://www.sysmap.com.br/webservices/testcase/TestCaseService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
---------------------------------------------------------------------------
My build.xml snippet:
---------------------------------------------------------------------------
< path id="build.classpath">
< fileset dir="C:/Desenvolvimento/Java/Servers/jboss-4.2.2.GA/client/" includes="*.jar" />
</ path>
< taskdef name="wsconsume" classname="org.jboss.wsf.spi.tools.ant.WSConsumeTask">
< classpath refid="build.classpath" />
</ taskdef>
< wsconsume fork="true" verbose="true" keep="true"
destdir="classes/"
sourcedestdir="gen/"
wsdllocation="/META-INF/TestCase.wsdl"
wsdl="/META-INF/TestCase.wsdl">
</ wsconsume>
----
Thanks for your attention!
Hugs...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140712#4140712
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140712
18 years
[JBossWS] - update: works in glassfish ! Re: help help! - cant get basic
by wiggy
guys, seen no answer to this or any other of the threads.
so I had a go downloading glassfish - had to fiddle with a couple of the support libraries, imported the same code into a new workspace (glassfish cant handle a workspace path with any spaces in the fully qualified path if any one else wants to try this)
import the same code - and publish to glassfish.
first off the eclipse ws explorer correctly locates and drives the publsihed wsdl (more than i got from the jbossws) and then i generated the client artifacts (use wsimport in the bin directory) and imported into a test client and invoked the webservice.
That worked also.
I have an error in the glassfish log which i dont understand and will post back to glassfish forums - but its about webstart which i dont use.
Clearly something screwy here with jboss AS - has anyone got any ideas why i get these errors -
I'd prefer to stay with jboss as i want to use SEAM and its default deploy is jboss (having other problems getting seam to work in glassfish) but the lack of sensible answer to the WS issues raised in these links makes that untenable at present.
Also the glassfish is configured to work with java1.6 - cant see any roadmap when this would complete for jbossAS. Is there story for that ?
Kind regards in advance for any help anyone can offer.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140660#4140660
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140660
18 years