[JBossWS] - Trouble accessing a simple webservice
by luismbo
Hello,
I've read the following documentation:
http://docs.jboss.org/jbossas/getting_started/v5/html/ws.html and
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBWS181HelloWorld
And (apparently) sucessfully deployed a simple webservice. Not quite successfully, though, since while JBoss tells me the webservice is deployed:
14:53:40,734 INFO [TomcatDeployer] deploy, ctxPath=/bqx, warUrl=.../tmp/deploy/tmp26274bqx-exp.war/
14:53:40,993 INFO [WSDLFilePublisher] WSDL published to: file:/Users/luis/Software/jboss-4.0.4.GA/server/default/data/wsdl/bqx.war/BQXWS26275.wsdl
14:53:41,030 INFO [ServiceEndpointManager] WebService started: http://pomajxego:8080/bqx/BQXWS
... I can't seem to access it:
14:55:23,874 ERROR [[BQXWS]] Servlet.service() for servlet BQXWS threw exception
org.jboss.util.NotImplementedException: HTTP GET not supported
at org.jboss.ws.server.ServiceEndpointServlet.doGet(ServiceEndpointServlet.java:95)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
I've pasted the code for the WS and the client here:
http://pastebin.ca/232793
I'm guessing that the annotation magic should be generating a doGet method but for some reason isn't. Any idea what I'm doing wrong? Any help will be appreciated!
(BTW, as you'll see in that code, my webmethod is returning XML data in a String. I have the feeling that there must be a better way, tips regarding that will be welcome too!)
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982397#3982397
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982397
18 years, 1 month
[JBossWS] - Web Service: Could not dereference object
by EricYP
Hello
Everybody, help me.
Envrionment:
jboss-4.0.4.GA
jbossws14.sar
jbossws-samples-1.0.2.GA
I download jbossws-samples-1.0.2.GA from jboss website and compile the package with build.xml provided by jbossws-samples-1.0.2.GA.
But when I run the task "tests" defined in built.xml, the following error occurs:
(jbossws-samples-rpcstyle.war,jbossws-samples-rpcstyle-client.jar)
Could not dereference object
javax.naming.NamingException: Could not dereference object [Root exception is org.jboss.ws.metadata.wsdl.WSDLException: java.net.ConnectException: Connection refused: connect] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1150) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705) at org.jboss.naming.client.java.javaURLContextFactory$EncContextProxy.invoke(javaURLContextFactory.java:135) at $Proxy1.lookup(Unknown Source) at javax.naming.InitialContext.lookup(InitialContext.java:351) at org.jboss.test.ws.samples.rpcstyle.TrivialServiceRpcTestCase.setUp(TrivialServiceRpcTestCase.java:67) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23)Caused by: org.jboss.ws.metadata.wsdl.WSDLException: java.net.ConnectException: Connection refused: connect at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.getDocument(WSDLDefinitionsFactory.java:204) at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:112) at org.jboss.ws.metadata.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:273) at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:110) at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:112) at org.jboss.ws.jaxrpc.ServiceObjectFactory.getObjectInstance(ServiceObjectFactory.java:181) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125) at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142) ... 19 moreCaused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.Socket.connect(Socket.java:507) at java.net.Socket.connect(Socket.java:457) at sun.net.NetworkClient.doConnect(NetworkClient.java:157) at sun.net.www.http.HttpClient.openServer(HttpClient.java:365) at sun.net.www.http.HttpClient.openServer(HttpClient.java:477) at sun.net.www.http.HttpClient.(HttpClient.java:214) at sun.net.www.http.HttpClient.New(HttpClient.java:287) at sun.net.www.http.HttpClient.New(HttpClient.java:299) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:913) at java.net.URL.openStream(URL.java:1007) at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.getDocument(WSDLDefinitionsFactory.java:187) ... 27
The content of webservices.xml in jbossws-samples-rpcstyle.war:
<webservices version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:impl='http://org.jboss.ws/samples/rpcstyle' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
<webservice-description>
<webservice-description-name>SampleService</webservice-description-name>
<wsdl-file>WEB-INF/wsdl/SampleService.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>TrivialServicePort</port-component-name>
<wsdl-port>impl:TrivialServicePort</wsdl-port>
<service-endpoint-interface>org.jboss.test.ws.samples.rpcstyle.TrivialService</service-endpoint-interface>
<service-impl-bean>
<servlet-link>TrivialEndpoint</servlet-link>
</service-impl-bean>
</port-component>
</webservice-description>
The content of web.xml in jbossws-samples-rpcstyle.war:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet-name>TrivialEndpoint</servlet-name>
<servlet-class>org.jboss.test.ws.samples.rpcstyle.TrivialEndpointJSE</servlet-class>
<servlet-mapping>
<servlet-name>TrivialEndpoint</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
The content of SampleService.wsdl in jbossws-samples-rpcstyle.war:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name='SampleService' targetNamespace='http://org.jboss.ws/samples/rpcstyle' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/samples/rpcstyle' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
<soap:operation soapAction=''/>
<soap:body namespace='http://org.jboss.ws/samples/rpcstyle' use='literal'/>
<soap:body namespace='http://org.jboss.ws/samples/rpcstyle' use='literal'/>
<soap:address location='REPLACE_WITH_ACTUAL_URL'/>
When I edit web.xml as following, the error also exists:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mh='http://org.jboss.ws/samples/rpcstyle' xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet-name>TrivialEndpoint</servlet-name>
<servlet-class>org.jboss.test.ws.samples.rpcstyle.TrivialEndpointJSE</servlet-class>
<service-ref>
<service-ref-name>service/TrivialService</service-ref-name>
<service-interface>org.jboss.test.ws.samples.rpcstyle.TrivialService
</service-interface>
<wsdl-file>WEB-INF/wsdl/SampleService.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<service-qname>mh:TrivialService</service-qname>
</service-ref>
<servlet-mapping>
<servlet-name>TrivialEndpoint</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982262#3982262
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982262
18 years, 1 month