[JBoss Web Services Users] - Re: JAX-WS Web Service Authentication (NTLM) against a MS CR
by clashboy
Hi,
i want to access the M$ CRM, too. I get the same 401 Unauthorized Execption.
Using: JBossWS 3.2.0 (nativ)
| Exception in thread "main" com.sun.xml.ws.client.ClientTransportException: request requires HTTP authentication: Unauthorized
| at com.sun.xml.ws.transport.http.client.HttpClientTransport.checkResponseCode(HttpClientTransport.java:212)
| at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:149)
| at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:86)
| at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
| at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
| at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
| at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
| at com.sun.xml.ws.client.Stub.process(Stub.java:248)
| at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
| at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
| at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
| at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
| at $Proxy24.retrieveMultiple(Unknown Source)
| at test.JBossWS.main(JBossWS.java:189)
|
I sniff the network for checking the chunking issue, but it is disabled.
| POST /MSCrmServices/2007/CrmService.asmx HTTP/1.1
| SOAPAction: "http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple"
| Content-Type: text/xml;charset="utf-8"
| Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
| User-Agent: JAX-WS RI 2.1.3-b02-
| Host: 10.10.10.1:3000
| Connection: keep-alive
| Content-Length: 413
| Authorization: NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAFASgKAAAADw==
|
| <?xml version='1.0' encoding='UTF-8'?>
| <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
| <S:Body>
| <RetrieveMultiple xmlns="http://schemas.microsoft.com/crm/2007/WebServices" xmlns:ns2="http://schemas.microsoft.com/crm/2006/Query" xmlns:ns3="http://schemas.microsoft.com/crm/2006/WebServices">
| <query>
| <ns2:EntityName>LEAD</ns2:EntityName>
| <ns2:ColumnSet/>
| </query>
| </RetrieveMultiple>
| </S:Body>
| </S:Envelope>
|
| HTTP/1.1 401 Unauthorized
| Content-Length: 51
| Content-Type: text/plain
| Server: Microsoft-IIS/6.0
| WWW-Authenticate: NTLM TlRMTVNTUAACAAAAEAAQADgAAAAFgomidBgBvxAJL2AAAAAAAAAAAKYApgBIAAAABQLODgAAAA9HAEEATABBAFgASQBTADQAAgAQAEcAQQBMAEEAWABJAFMANAABAA4ASgBVAFAASQBUAEUAUgAEABwAZwBhAGwAYQB4AGkAcwA0AC4AbABvAGMAYQBsAAMALABKAFUAUABJAFQARQBSAC4AZwBhAGwAYQB4AGkAcwA0AC4AbABvAGMAYQBsAAUAHABnAGEAbABhAHgAaQBzADQALgBsAG8AYwBhAGwABwAIAKilKVgeTMoBAAAAAA==
| X-Powered-By: ASP.NET
| Date: Tue, 13 Oct 2009 16:00:53 GMT
|
| HTTP Error 401.1 - Unauthorized: Access is denied
| HTTP/1.1 401 Unauthorized
| Date: Tue, 13 Oct 2009 16:00:54 GMT
| Server: Microsoft-IIS/6.0
| WWW-Authenticate: Negotiate
| WWW-Authenticate: NTLM
| X-Powered-By: ASP.NET
| X-AspNet-Version: 2.0.50727
| Cache-Control: private
| Content-Length: 0
|
Have any one an idea or link with a solution?
Greetz,
Clash
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260128#4260128
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260128
15 years, 2 months
[JBoss Web Services Users] - Jboss Web Services
by rathinaganesh
Greetings,
I have created and deployed two web applications(say webapp1, webapp2) that generates SOAP message to access a remote web service. We are using Jboss 5.0.0.GA.
Both these applications run fine, if I run then individually. That is, when I start the jboss server and access webapp1 first. Then, I do not have any trouble with webapp1. Now, when I access webapp2, I get the error message listed below.
I get the same error message, when I start the jboss server and access webapp2 for the first and try to access webapp1 second.
So, if I am testing webapp1 and want to test webapp2, I have to restart the jboss server and access webapp2 as soon as the server starts up.
This is the code I have in webapp1
******************* Code on webapp1 ***************
|
|
| QName serviceQName = new QName(namespace, serviceName);
| Service service = Service.create(serviceQName);
| QName portQName = new QName(namespace, portName);
| service.addPort(portQName, SOAPBinding.SOAP11HTTP_BINDING,
| endpointAddress);
| Dispatch<SOAPMessage> dispatch = service.createDispatch(portQName,
| SOAPMessage.class, Service.Mode.MESSAGE);
|
| final String operationName = props.getProperty(svc
| + ".operationName");
| MessageFactory factory = MessageFactory.newInstance();
| SOAPMessage soapRequest = factory.createMessage();
| soapRequest.setProperty("WRITE_XML_DECLARATION ", false);
| SOAPBody body = soapRequest.getSOAPBody();
| QName payloadName = new QName(namespace, operationName, "ns1");
| SOAPBodyElement payload = body.addBodyElement(payloadName);
| SOAPElement message = payload.addChildElement("arg0");
| message.addTextNode(userName);
| message = payload.addChildElement("arg1");
| message.addTextNode("");
| soapRequest.writeTo(System.out);
| SOAPMessage soapResponse = null;
| soapResponse = dispatch.invoke(soapRequest);
| soapResponse.writeTo(System.out);
|
|
This is the code I have in webapp2
|
| //First create the connection
| SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance();
| connection = soapConnFactory.createConnection();
| //Next, create the actual message
| MessageFactory messageFactory = MessageFactory.newInstance();
| SOAPMessage message = messageFactory.createMessage();
| //Create objects for the message parts
| SOAPPart soapPart = message.getSOAPPart();
| SOAPEnvelope envelope = soapPart.getEnvelope();
| SOAPBody body = envelope.getBody();
| //Populate the body
| //Create the main element and namespace
| SOAPElement bodyElement = body.addChildElement(envelope.createName(operationName,"ns0",namespace));
| //Add content bodyElement.addChildElement("parameter").addTextNode(param);
| //Save the message
| message.saveChanges();
| message.writeTo(System.out);
| //Set the destination
| URL destination = new URL(wsdlURL);
| //Send the message and get a reply
| SOAPMessage reply = connection.call(message, destination);
| System.out.println("\nRESPONSE:\n");
| reply.writeTo(System.out);
|
|
******************* Error Message **********************
|
| 16:37:17,000 INFO [STDOUT] Exception occurred::java.io.IOException: Could not transmit message
| 16:37:17,000 ERROR [STDERR] javax.xml.soap.SOAPException: java.io.IOException: Could not transmit message
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPConnectionImpl.callInternal(SOAPConnectionImpl.java:152)
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:64)
| 16:37:17,000 ERROR [STDERR] at com.adaranet.ldaptest.businessobjects.SoapEngineBO.invokeCall(SoapEngineBO.java:177)
| 16:37:17,000 ERROR [STDERR] at com.adaranet.ldaptest.businessobjects.SoapEngineBO.process(SoapEngineBO.java:51)
| 16:37:17,000 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 16:37:17,000 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 16:37:17,000 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 16:37:17,000 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 16:37:17,000 ERROR [STDERR] at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
| 16:37:17,000 ERROR [STDERR] at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)
| 16:37:17,000 ERROR [STDERR] at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
| 16:37:17,000 ERROR [STDERR] at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
| 16:37:17,000 ERROR [STDERR] at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
| 16:37:17,000 ERROR [STDERR] at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
| 16:37:17,000 ERROR [STDERR] at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
| 16:37:17,000 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
| 16:37:17,000 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 16:37:17,000 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
| 16:37:17,000 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
| 16:37:17,000 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
| 16:37:17,000 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
| 16:37:17,000 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| 16:37:17,000 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| 16:37:17,000 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
| 16:37:17,000 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
| 16:37:17,000 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
| 16:37:17,000 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| 16:37:17,000 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
| 16:37:17,000 ERROR [STDERR] Caused by: java.io.IOException: Could not transmit message
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:264)
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:71)
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPConnectionImpl.callInternal(SOAPConnectionImpl.java:143)
| 16:37:17,000 ERROR [STDERR] ... 36 more
| 16:37:17,000 ERROR [STDERR] Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker after 1 attempt(s)
| 16:37:17,000 ERROR [STDERR] at org.jboss.remoting.transport.http.HTTPClientInvoker.makeInvocation(HTTPClientInvoker.java:246)
| 16:37:17,000 ERROR [STDERR] at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:158)
| 16:37:17,000 ERROR [STDERR] at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:160)
| 16:37:17,000 ERROR [STDERR] at org.jboss.remoting.Client.invoke(Client.java:1708)
| 16:37:17,000 ERROR [STDERR] at org.jboss.remoting.Client.invoke(Client.java:612)
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:242)
| 16:37:17,000 ERROR [STDERR] ... 38 more
| 16:37:17,000 ERROR [STDERR] Caused by: java.lang.ClassCastException: org.jboss.ws.core.soap.SOAPElementImpl
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPEnvelopeImpl.<init>(SOAPEnvelopeImpl.java:57)
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:136)
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:96)
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:283)
| 16:37:17,000 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP.read(SOAPMessageUnMarshallerHTTP.java:82)
| 16:37:17,000 ERROR [STDERR] at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:567)
| 16:37:17,000 ERROR [STDERR] at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:366)
| 16:37:17,000 ERROR [STDERR] at org.jboss.remoting.transport.http.HTTPClientInvoker.makeInvocation(HTTPClientInvoker.java:228)
| 16:37:17,000 ERROR [STDERR] ... 43 more
|
|
Thanks in advance.
Thanks,
Ganesh.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259974#4259974
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259974
15 years, 2 months
[JBoss Web Services Users] - SecurityDomain ignored in webservice
by meme
Hi,
I hope that this is the correct forum for this webservice and security related question:
I've deployed a ejb3-webservice on a standard jboss using this annotations:
| @Stateless
| @SOAPBinding(style = Style.RPC)
| @WebService(name = "ScheduleEndpoint",
| serviceName = "ScheduleEndpointService",
| targetNamespace = "http://my.namespace.de/ws/schedule")
| @WebContext(contextRoot = "/ws",
| urlPattern = "/schedule",
| authMethod = AuthMethod.BASIC,
| transportGuarantee = TransportGuarantee.CONFIDENTIAL,
| secureWSDLAccess = false)
| @SecurityDomain("MySecurity")
| public class ScheduleBean implements ScheduleLocal, ScheduleEndpoint {
|
Everything is fine. The client is forced to use https. But when I try to authenticate myself the error below is shown in the jboss log.
(The same occures when I try to access the wsdl if I enable the secureWSDLAccess)
The mentioned JAAS MySecurity is working because several other webapps are working correctly with this domain.
Do I have to configure the jaas in some other points than in the @SecurityDomain annotation?
Thanks for your help!
Marc
11:27:04,088 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
| java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
| at org.jboss.security.auth.spi.Util.loadProperties(Util.java:198)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
| at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
| at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
| at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
| at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:552)
| at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:486)
| at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365)
| at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160)
| at org.jboss.web.tomcat.security.JBossWebRealm.authenticate(JBossWebRealm.java:384)
| at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
| 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.authenticator.SingleSignOn.invoke(SingleSignOn.java:383)
| 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)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259571#4259571
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259571
15 years, 2 months