[JBossWS] - Re: HalloWorld Problem
by florian79
Thank you, that works now.
But now I get the following exception for any SOAPBinding:
| javax.xml.ws.WebServiceException: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'xsd:string'.
| at javax.xml.ws.Service.create(Service.java:731)
| at com.dooris.ws.HalloWorldWSImplTest.initByService(HalloWorldWSImplTest.java:41)
| at com.dooris.ws.HalloWorldWSImplTest.setUp(HalloWorldWSImplTest.java:22)
| 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:585)
| at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
| at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
| at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
| at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
| at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
| at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
| at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
| at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
| at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
| Caused by: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'xsd:string'.
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:155)
| at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:83)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
| at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
| at javax.xml.ws.Service.<init>(Service.java:83)
| at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at javax.xml.ws.Service.create(Service.java:726)
| ... 22 more
| Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'xsd:string'.
| at com.ibm.wsdl.util.xml.DOMUtils.getQName(DOMUtils.java:309)
| at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedAttributeValue(DOMUtils.java:367)
| at com.ibm.wsdl.xml.WSDLReaderImpl.getQualifiedAttributeValue(WSDLReaderImpl.java:2019)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parsePart(WSDLReaderImpl.java:1282)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1257)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:309)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2265)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2229)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2282)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:130)
| ... 33 more
|
|
Any idea?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060663#4060663
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060663
17 years, 8 months
[JBossWS] - JBOSS-WS Client not sending COOKIE after 2 calls
by fredash
Hi,
I just tested under JBoss AS 4.0.5 & JBossWS 1.2.1 a session mecanism based on the HTTP Session Cookie (with a code sample from Rama Pulavarthi's blog).
Here is the Web Service code:
| @WebService
| public class Hello {
| @Resource
| private WebServiceContext wsContext;
| public int getCounter(){
| MessageContext mc = wsContext.getMessageContext();
| HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
| // Get a session property "counter" from context
| if (session == null)
| throw new WebServiceException("No session in WebServiceContext");
| Integer counter = (Integer)session.getAttribute("counter");
| if (counter == null) {
| counter = new Integer(0);
| System.out.println("Starting the Session");
| }
| counter = new Integer(counter.intValue() + 1);
| session.setAttribute("counter", counter);
| return counter;
| }
| }
|
Here is the Web Service Client code:
| Hello proxy = new HelloService().getHelloPort();
| ((BindingProvider)proxy).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
| int result = proxy.getCounter();
| System.out.println(result);
| result = proxy.getCounter();
| System.out.println(result);
| result = proxy.getCounter();
| System.out.println(result);
|
The first 2 calls to proxy.getCounter() method just worked as expected : On the first call, a new session is created by the Web-Service and a SET-COOKIE is sent by the HTTP transport layer to the Client.
The second call to proxy.getCounter() generates a SOAP message with the COOKIE received after the first call.
BUT, when a 3rd call is fired, the client do not send anymore the COOKIE and then the server re-creates a new session.
The problem seems to be at the client level, when the client stops to send the COOKIE value after the second call.
** BTW, this code is for testing purpose and i know that the session mecanism in Web Services should ideally be implemented with the WS-Addressing mecanism.
Thanks in advance for your suggestions.
Fred.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060524#4060524
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060524
17 years, 8 months