[jboss-user] [JBossWS] - Re: javax.xml.rpc.JAXRPCException: Cannot obtain operation m
kapilesh.arekar
do-not-reply at jboss.com
Tue Jun 5 04:20:35 EDT 2007
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
More information about the jboss-user
mailing list