[JBossWS] - Re: javax.xml.rpc.JAXRPCException: Cannot obtain operation m
by kapilesh.arekar
Thanks for ur response oskar . I enabled the Request dumper value.
In "HelloClient.java" When I use the following code and exeute it runs correctly and returns me a reply.
+++++++++++++++++++++++++++++++++++++++++++++
Sample 1 Here I need a Remote interface to invoke the service:-
++++++++++++++++++++++++++++++++++++++++++++++
IHelloWorld hello = (IHelloWorld) service.getPort(IHelloWorld.class);
// System.out.println("hello.hello(" + argument + ")");
System.out.println("output:" + hello.sayHello(argument));
// CallImpl call = (CallImpl)service.createCall();
//call.setOperationName(operationName);
// System.out.println(call.isParameterAndReturnSpecRequired(operationName));
//Object retObj = call.invoke(new Object[]{argument});
+++++++++++++++++++++++++++++++++++++++++++++++
The following Headers appear in the Log in the log
+++++++++++++++++++++++++++++++++++++++++++++
13:28:15,750 INFO [[localhost]] REQUEST URI =/HelloWorld
13:28:15,750 INFO [[localhost]] authType=null
13:28:15,750 INFO [[localhost]] characterEncoding=null
13:28:15,750 INFO [[localhost]] contentLength=-1
13:28:15,750 INFO [[localhost]] contentType=application/x-www-form-urlencoded
13:28:15,750 INFO [[localhost]] contextPath=/HelloWorld
13:28:15,750 INFO [[localhost]] header=user-agent=Java/1.5.0_09
13:28:15,750 INFO [[localhost]] header=host=localhost:8080
13:28:15,750 INFO [[localhost]] header=accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
13:28:15,750 INFO [[localhost]] header=connection=keep-alive
13:28:15,750 INFO [[localhost]] header=content-type=application/x-www-form-urlencoded
13:28:15,750 INFO [[localhost]] locale=en_US
13:28:15,750 INFO [[localhost]] method=GET
13:28:15,750 INFO [[localhost]] parameter=wsdl=
13:28:15,750 INFO [[localhost]] pathInfo=/
13:28:15,750 INFO [[localhost]] protocol=HTTP/1.1
13:28:15,750 INFO [[localhost]] queryString=wsdl
13:28:15,750 INFO [[localhost]] remoteAddr=127.0.0.1
13:28:15,750 INFO [[localhost]] remoteHost=127.0.0.1
13:28:15,750 INFO [[localhost]] remoteUser=null
13:28:15,750 INFO [[localhost]] requestedSessionId=null
13:28:15,750 INFO [[localhost]] scheme=http
13:28:15,750 INFO [[localhost]] serverName=localhost
13:28:15,750 INFO [[localhost]] serverPort=8080
13:28:15,750 INFO [[localhost]] servletPath=
13:28:15,750 INFO [[localhost]] isSecure=false
13:28:15,750 INFO [[localhost]] ---------------------------------------------------------------
13:28:15,812 INFO [[localhost]] ---------------------------------------------------------------
13:28:15,812 INFO [[localhost]] authType=null
13:28:15,812 INFO [[localhost]] contentLength=-1
13:28:15,812 INFO [[localhost]] contentType=text/xml
13:28:15,812 INFO [[localhost]] header=X-Powered-By=Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
13:28:15,812 INFO [[localhost]] header=Content-Type=text/xml
13:28:15,812 INFO [[localhost]] header=Transfer-Encoding=chunked
13:28:15,812 INFO [[localhost]] header=Date=Tue, 05 Jun 2007 07:58:15 GMT
13:28:15,812 INFO [[localhost]] message=null
13:28:15,812 INFO [[localhost]] remoteUser=null
13:28:15,812 INFO [[localhost]] status=200
13:28:15,812 INFO [[localhost]] ===============================================================
13:28:15,890 INFO [[localhost]] REQUEST URI =/HelloWorld
13:28:15,890 INFO [[localhost]] authType=null
13:28:15,890 INFO [[localhost]] characterEncoding=null
13:28:15,890 INFO [[localhost]] contentLength=-1
13:28:15,890 INFO [[localhost]] contentType=application/x-www-form-urlencoded
13:28:15,890 INFO [[localhost]] contextPath=/HelloWorld
13:28:15,890 INFO [[localhost]] header=user-agent=Java/1.5.0_09
13:28:15,890 INFO [[localhost]] header=host=localhost:8080
13:28:15,890 INFO [[localhost]] header=accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
13:28:15,890 INFO [[localhost]] header=connection=keep-alive
13:28:15,890 INFO [[localhost]] header=content-type=application/x-www-form-urlencoded
13:28:15,890 INFO [[localhost]] locale=en_US
13:28:15,890 INFO [[localhost]] method=GET
13:28:15,890 INFO [[localhost]] parameter=wsdl=
13:28:15,890 INFO [[localhost]] pathInfo=/
13:28:15,890 INFO [[localhost]] protocol=HTTP/1.1
13:28:15,890 INFO [[localhost]] queryString=wsdl
13:28:15,890 INFO [[localhost]] remoteAddr=127.0.0.1
13:28:15,890 INFO [[localhost]] remoteHost=127.0.0.1
13:28:15,890 INFO [[localhost]] remoteUser=null
13:28:15,890 INFO [[localhost]] requestedSessionId=null
13:28:15,890 INFO [[localhost]] scheme=http
13:28:15,890 INFO [[localhost]] serverName=localhost
13:28:15,890 INFO [[localhost]] serverPort=8080
13:28:15,890 INFO [[localhost]] servletPath=
13:28:15,890 INFO [[localhost]] isSecure=false
13:28:15,890 INFO [[localhost]] ---------------------------------------------------------------
13:28:15,906 INFO [[localhost]] ---------------------------------------------------------------
13:28:15,906 INFO [[localhost]] authType=null
13:28:15,906 INFO [[localhost]] contentLength=-1
13:28:15,906 INFO [[localhost]] contentType=text/xml
13:28:15,906 INFO [[localhost]] header=X-Powered-By=Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
13:28:15,906 INFO [[localhost]] header=Content-Type=text/xml
13:28:15,906 INFO [[localhost]] header=Transfer-Encoding=chunked
13:28:15,906 INFO [[localhost]] header=Date=Tue, 05 Jun 2007 07:58:15 GMT
13:28:15,906 INFO [[localhost]] message=null
13:28:15,906 INFO [[localhost]] remoteUser=null
13:28:15,906 INFO [[localhost]] status=200
13:28:15,906 INFO [[localhost]] ===============================================================
13:28:16,234 INFO [[localhost]] REQUEST URI =/HelloWorld
13:28:16,234 INFO [[localhost]] authType=null
13:28:16,234 INFO [[localhost]] characterEncoding=UTF-8
13:28:16,234 INFO [[localhost]] contentLength=235
13:28:16,234 INFO [[localhost]] contentType=text/xml; charset=UTF-8
13:28:16,234 INFO [[localhost]] contextPath=/HelloWorld
13:28:16,234 INFO [[localhost]] header=soapaction="http://localhost:8080/HelloWorld/sayHello"
13:28:16,234 INFO [[localhost]] header=content-type=text/xml; charset=UTF-8
13:28:16,234 INFO [[localhost]] header=user-agent=Java/1.5.0_09
13:28:16,234 INFO [[localhost]] header=host=localhost:8080
13:28:16,234 INFO [[localhost]] header=accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
13:28:16,234 INFO [[localhost]] header=connection=keep-alive
13:28:16,234 INFO [[localhost]] header=content-length=235
13:28:16,234 INFO [[localhost]] locale=en_US
13:28:16,234 INFO [[localhost]] method=POST
13:28:16,234 INFO [[localhost]] pathInfo=/
13:28:16,234 INFO [[localhost]] protocol=HTTP/1.1
13:28:16,234 INFO [[localhost]] queryString=null
13:28:16,234 INFO [[localhost]] remoteAddr=127.0.0.1
13:28:16,234 INFO [[localhost]] remoteHost=127.0.0.1
13:28:16,234 INFO [[localhost]] remoteUser=null
13:28:16,234 INFO [[localhost]] requestedSessionId=null
13:28:16,234 INFO [[localhost]] scheme=http
13:28:16,234 INFO [[localhost]] serverName=localhost
13:28:16,234 INFO [[localhost]] serverPort=8080
13:28:16,234 INFO [[localhost]] servletPath=
13:28:16,234 INFO [[localhost]] isSecure=false
13:28:16,234 INFO [[localhost]] ------------------------------------------------++++++++++++++++++++++++++++++++++++++++++++++++
If you look at the above log you will see Soap headers been set
+++++++++++++++++++++++++++++++++++++++++++++++
Sample 2. I use the Call Implementation. I have commented out the Remote interface call and use call.invoke() instead
+++++++++++++++++++++++++++++++++++++++++
//IHelloWorld hello = (IHelloWorld) service.getPort(IHelloWorld.class);
// System.out.println("hello.hello(" + argument + ")");
// System.out.println("output:" + hello.sayHello(argument));
CallImpl call = (CallImpl)service.createCall();
QName operationName = new QName(TARGET_NAMESPACE, "sayHello");
call.setOperationName(operationName);
System.out.println(call.isParameterAndReturnSpecRequired(operationName));
Object retObj = call.invoke(new Object[]{argument});
++++++++++++++++++++++++++++++++++++++++++++
The output I get is as follows. If you notice the last part i.e the setting of Soap Headers is missing.
+++++++++++++++++++++++++++++++++++++++++++
13:22:41,421 INFO [[localhost]] REQUEST URI =/HelloWorld
13:22:41,421 INFO [[localhost]] authType=null
13:22:41,421 INFO [[localhost]] characterEncoding=null
13:22:41,421 INFO [[localhost]] contentLength=-1
13:22:41,421 INFO [[localhost]] contentType=application/x-www-form-urlencoded
13:22:41,421 INFO [[localhost]] contextPath=/HelloWorld
13:22:41,421 INFO [[localhost]] header=user-agent=Java/1.5.0_09
13:22:41,421 INFO [[localhost]] header=host=localhost:8080
13:22:41,421 INFO [[localhost]] header=accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
13:22:41,421 INFO [[localhost]] header=connection=keep-alive
13:22:41,421 INFO [[localhost]] header=content-type=application/x-www-form-urlencoded
13:22:41,421 INFO [[localhost]] locale=en_US
13:22:41,421 INFO [[localhost]] method=GET
13:22:41,421 INFO [[localhost]] parameter=wsdl=
13:22:41,421 INFO [[localhost]] pathInfo=/
13:22:41,421 INFO [[localhost]] protocol=HTTP/1.1
13:22:41,421 INFO [[localhost]] queryString=wsdl
13:22:41,421 INFO [[localhost]] remoteAddr=127.0.0.1
13:22:41,421 INFO [[localhost]] remoteHost=127.0.0.1
13:22:41,421 INFO [[localhost]] remoteUser=null
13:22:41,421 INFO [[localhost]] requestedSessionId=null
13:22:41,421 INFO [[localhost]] scheme=http
13:22:41,421 INFO [[localhost]] serverName=localhost
13:22:41,421 INFO [[localhost]] serverPort=8080
13:22:41,421 INFO [[localhost]] servletPath=
13:22:41,421 INFO [[localhost]] isSecure=false
13:22:41,421 INFO [[localhost]] ---------------------------------------------------------------
13:22:41,484 INFO [[localhost]] ---------------------------------------------------------------
13:22:41,484 INFO [[localhost]] authType=null
13:22:41,500 INFO [[localhost]] contentLength=-1
13:22:41,500 INFO [[localhost]] contentType=text/xml
13:22:41,500 INFO [[localhost]] header=X-Powered-By=Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
13:22:41,500 INFO [[localhost]] header=Content-Type=text/xml
13:22:41,500 INFO [[localhost]] header=Transfer-Encoding=chunked
13:22:41,500 INFO [[localhost]] header=Date=Tue, 05 Jun 2007 07:52:41 GMT
13:22:41,500 INFO [[localhost]] message=null
13:22:41,500 INFO [[localhost]] remoteUser=null
13:22:41,500 INFO [[localhost]] status=200
13:22:41,500 INFO [[localhost]] ===============================================================
13:22:41,562 INFO [[localhost]] REQUEST URI =/HelloWorld
13:22:41,562 INFO [[localhost]] authType=null
13:22:41,562 INFO [[localhost]] characterEncoding=null
13:22:41,562 INFO [[localhost]] contentLength=-1
13:22:41,562 INFO [[localhost]] contentType=application/x-www-form-urlencoded
13:22:41,562 INFO [[localhost]] contextPath=/HelloWorld
13:22:41,562 INFO [[localhost]] header=user-agent=Java/1.5.0_09
13:22:41,562 INFO [[localhost]] header=host=localhost:8080
13:22:41,562 INFO [[localhost]] header=accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
13:22:41,562 INFO [[localhost]] header=connection=keep-alive
13:22:41,562 INFO [[localhost]] header=content-type=application/x-www-form-urlencoded
13:22:41,562 INFO [[localhost]] locale=en_US
13:22:41,562 INFO [[localhost]] method=GET
13:22:41,562 INFO [[localhost]] parameter=wsdl=
13:22:41,562 INFO [[localhost]] pathInfo=/
13:22:41,562 INFO [[localhost]] protocol=HTTP/1.1
13:22:41,562 INFO [[localhost]] queryString=wsdl
13:22:41,562 INFO [[localhost]] remoteAddr=127.0.0.1
13:22:41,562 INFO [[localhost]] remoteHost=127.0.0.1
13:22:41,562 INFO [[localhost]] remoteUser=null
13:22:41,562 INFO [[localhost]] requestedSessionId=null
13:22:41,562 INFO [[localhost]] scheme=http
13:22:41,562 INFO [[localhost]] serverName=localhost
13:22:41,562 INFO [[localhost]] serverPort=8080
13:22:41,562 INFO [[localhost]] servletPath=
13:22:41,562 INFO [[localhost]] isSecure=false
13:22:41,562 INFO [[localhost]] ---------------------------------------------------------------
13:22:41,578 INFO [[localhost]] ---------------------------------------------------------------
13:22:41,578 INFO [[localhost]] authType=null
13:22:41,578 INFO [[localhost]] contentLength=-1
13:22:41,578 INFO [[localhost]] contentType=text/xml
13:22:41,578 INFO [[localhost]] header=X-Powered-By=Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
13:22:41,578 INFO [[localhost]] header=Content-Type=text/xml
13:22:41,578 INFO [[localhost]] header=Transfer-Encoding=chunked
13:22:41,578 INFO [[localhost]] header=Date=Tue, 05 Jun 2007 07:52:41 GMT
13:22:41,578 INFO [[localhost]] message=null
13:22:41,578 INFO [[localhost]] remoteUser=null
13:22:41,578 INFO [[localhost]] status=200
13:22:41,578 INFO [[localhost]] ================================================
++++++++++++++++++++++++++++++++++++++++++++++
The reason I donot want to use SOAP is that the client is a PHP client and currently only supports XML-RPC and expects a response in pure XML. Is there a way where i could configure the webservice to take in XML-RPC calls respond in XML-RPC without wrapping it in a soap envelope. May be I am sounding a little weird . Thanks so much ifor the help so far
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051222#4051222
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051222
17 years, 6 months
JBoss : Digest Authentication not works in web application
by Noorul Hasan Khan
Hi,
I have implemented BASIC authentication on JBossAS successfully. But when I
want to use DIGEST authentication, it does not work.
I have done according to
http://docs.jboss.org/jbossas/guides/webguide/r2/en/html_single/#d0e708
but it not works.
I have added a security policy in jboss-4.0.5.GA\server\default
\conf\login.config.xml,
<application-policy name = "ProWS">
<authentication>
<login-module code="
org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required">
<module-option name="usersProperties">props/ProWS-
users.properties</module-option>
<module-option name="rolesProperties">props/ProWS-
roles.properties</module-option>
<module-option name="hashAlgorithm">MD5</module-option>
<module-option name="hashEncoding">rfc2617</module-option>
<module-option name="hashUserPassword">false</module-option>
<module-option name="hashStorePassword">true</module-option>
<module-option name="passwordIsA1Hash">true</module-option>
<module-option name="storeDigestCallback">
org.jboss.security.auth.spi.RFC2617Digest</module-option>
</login-module>
</authentication>
</application-policy>
I have added users in
jboss-4.0.5.GA\server\default\conf\props\ProWS-users.properties,
# A sample users.properties file for use with the UsersRolesLoginModule
admin=6b205f65c5200e6cdfaa38915407eb17
ashish=b81277561fad2cce151847f72b850414
noorul=930ab5c31004b14a83c93b53554c25d2
I have added roles in
jboss-4.0.5.GA\server\default\conf\props\ProWS-roles.properties ,
# A sample users.properties file for use with the UsersRolesLoginModule
admin=ShinseiAdmin
ashish=ShinseiAdmin
noorul=ShinseiAdmin
I have assigned security policy in
jboss-4.0.5.GA\server\default\deploy\ProWebs.war\WEB-INF\jboss-web.xml,
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain>java:/jaas/ProWS</security-domain>
<context-root>/ProWebs</context-root>
</jboss-web>
I have added security-constraint in
jboss-4.0.5.GA\server\default\deploy\ProWebs.war\WEB-INF\web.xml,
<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAdaptor</web-resource-name>
<description>An example security config that only allows users with
the
role ShinseiAdmin to access the HTML ShinseiWS web application
</description>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>ShinseiAdmin</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Public</web-resource-name>
<url-pattern>/public/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
</security-constraint>
<login-config>
<auth-method>DIGEST</auth-method>
<realm-name>ProWebs</realm-name>
</login-config>
<security-role>
<role-name>ShinseiAdmin</role-name>
</security-role>
But it not works. Please help me.
Warm Regards
Noorul Hasan Khan
Software Engineer
Prologix Software Solutions Pvt. Ltd., India
17 years, 6 months