[JBossWS] - error runtime modeler error: Wrapper class ... is not found
by Fantagir
Hi!
I'm developing a Client of a WebService and when a I run it I've the next error:
com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class service.jaxws.DarCuenta is not found. Have you run APT to generate them?
My environment is:
Eclipse and JbossIDE for Eclipse
Jboss 4.0.5 GA
JDK 1.5
JWSDP 2.0
My WSDL:
<?xml version="1.0" encoding="UTF-8"?>
| <definitions name='Contar' targetNamespace='urn:service' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='urn:service.types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='urn:service' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <schema targetNamespace='urn:service.types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='urn:service.types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
| <complexType name='DatePalabra'>
| <sequence>
| <element name='longitud' nillable='true' type='string'/>
| <element name='palabra' nillable='true' type='string'/>
| </sequence>
| </complexType>
| </schema>
| </types>
| <message name='IContar_darCuenta'>
| <part name='String_1' type='xsd:string'/>
| </message>
| <message name='IContar_darCuentaResponse'>
| <part name='result' type='ns1:DatePalabra'/>
| </message>
| <portType name='IContar'>
| <operation name='darCuenta' parameterOrder='String_1'>
| <input message='tns:IContar_darCuenta'/>
| <output message='tns:IContar_darCuentaResponse'/>
| </operation>
| </portType>
| <binding name='IContarBinding' type='tns:IContar'>
| <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='darCuenta'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='urn:service' use='literal'/>
| </input>
| <output>
| <soap:body namespace='urn:service' use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='Contar'>
| <port binding='tns:IContarBinding' name='IContarPort'>
| <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
| </port>
| </service>
| </definitions>
|
|
My code of client:
Main:
package main;
|
| import java.net.URL;
|
| import javax.xml.namespace.QName;
| import javax.xml.ws.Service;
|
| import service.DatePalabra;
| import service.IContar;
|
| import com.lasalle.util.resources.CollectionProperties;
|
|
| public class MainDevPalabra {
|
| public static void main( String[] args ) throws Exception {
| if( args.length < 1 )
| {
| System.out.println( "Usage: Palabra name" );
| System.exit( 0 );
| }
|
| String argument = args[ 0 ];
|
| DatePalabra dp = new DatePalabra();
|
| //CollectionProperties propietats = new CollectionProperties();
| String urlstr = CollectionProperties.getPropiedad("serviceD.url");
| String nameServiceStr = CollectionProperties.getPropiedad("serviceD.name");
| String namespaceServiceStr = CollectionProperties.getPropiedad("serviceD.namespace");
|
| System.out.println( "Contacting webservice at " + urlstr );
|
| URL url = new URL(urlstr);
|
| //se indican el namespace en el que se encuentra el servicio y su nombre
| //(esto se puede ver en el WSDL)
| QName qname = new QName(namespaceServiceStr,
| nameServiceStr);
|
|
| Service service = Service.create(url, qname);
|
| System.out.println( "After create service" );
|
| IContar age = ( IContar) service.getPort( IContar.class );
|
| System.out.println( "After getPort" );
|
| System.out.println( "age.age(" + argument + ")" );
| dp = (DatePalabra) age.darCuenta(argument);
| System.out.println( "output longitud:" + dp.getLongitud() );
| System.out.println( "output palabra:" + dp.getPalabra() );
| }
|
|
| }
|
Interface of the service:
package service;
|
| import java.rmi.RemoteException;
|
| import javax.jws.WebMethod;
| import javax.jws.WebResult;
| import javax.jws.WebService;
| import javax.jws.WebParam;
|
| @WebService(
| name="IContar", // wsdl:portType
| targetNamespace="urn:service" //wsdl:targetNamespace
| )
|
| public interface IContar extends java.rmi.Remote
| {
|
| //@WebMethod(operationName="darCuenta")
| @WebMethod
| //@WebResult(name="IContar_darCuentaResponse", partName="result")
| //public DatePalabra darCuenta(@WebParam(name = "String_1") String name) throws RemoteException;
| public DatePalabra darCuenta(String name) throws RemoteException;
| }
|
Can you help me??
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091893#4091893
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091893
17 years
[JBossWS] - Re: WebServiceContext injection. Was it fixed or not?
by ggary
"richard_opalka" wrote : Could you share your service code with us?
|
| Richard
Sure, here it is:
package com.rsys.rsystools.ws;
|
| import javax.annotation.Resource;
| import javax.jws.WebMethod;
| import javax.jws.WebParam;
| import javax.jws.WebResult;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.jws.soap.SOAPBinding.Style;
| import javax.servlet.ServletContext;
| import javax.xml.ws.ResponseWrapper;
| import javax.xml.ws.WebServiceContext;
| import javax.xml.ws.handler.MessageContext;
| import org.springframework.web.context.support.WebApplicationContextUtils;
|
|
| @WebService(targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0")
| @SOAPBinding(style = Style.DOCUMENT)
| public class SpamComplaintWS implements SpamComplaint
| {
| @Resource
| private WebServiceContext context;
|
| ServletContext servletCtx;
| /** Creates a new instance of SpamComplaintWS */
| public SpamComplaintWS()
| {
| }
|
| /**
| * Web service operation
| */
| @WebMethod(operationName="processSpamComplaints")
| @WebResult(name="SpamResult", targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0")
| @ResponseWrapper(className="com.rsys.rsystools.ws.SpamResult",
| targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0")
| public SpamResult processSpamComplaints(
| @WebParam(name = "email") String email,
| @WebParam(name = "fromAddress") String fromAddress,
| @WebParam(name = "mailDate") String mailDate,
| @WebParam(name = "complaintDate") String complaintDate,
| @WebParam(name = "mailbox") String mailbox,
| @WebParam(name = "complainer") String complainer,
| @WebParam(name = "xRext") String xRext,
| @WebParam(name = "accountName") String accountName)
| {
| ServletContext servletCtx = (ServletContext) context.getMessageContext().get(MessageContext.SERVLET_CONTEXT);
| Object appContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletCtx);
| responsys.prodtools.SpammerTables st = new responsys.prodtools.SpammerTables();
| java.lang.String[] res = st.processSpamRecord(email, fromAddress, mailDate, complaintDate, mailbox, complainer, xRext, accountName);
| return (new SpamResult(res[0],res[1],res[2],res[3],res[4],res[5],res[6],res[7],res[8],res[9],res[10],res[11],res[12],res[13]));
| }
|
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091652#4091652
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091652
17 years
[JBossWS] - Re: JBossWS Sample Test cases are failing
by ansantharam
Below is the log created for the testcase.
Testsuite: org.jboss.test.ws.jaxrpc.samples.rpcstyle.TrivialServiceRpcTestCase
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 1.75 sec
Testcase: testTrivialAccess took 0.047 sec
Caused an ERROR
Could not dereference object
javax.naming.NamingException: Could not dereference object [Root exception is java.lang.ClassNotFoundException: org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData]
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.jaxrpc.samples.rpcstyle.TrivialServiceRpcTestCase.setUp(TrivialServiceRpcTestCase.java:62)
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: java.lang.ClassNotFoundException: org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:585)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.jboss.ws.core.jaxrpc.client.ServiceObjectFactory.getObjectInstance(ServiceObjectFactory.java:111)
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)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091619#4091619
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091619
17 years
[JBossWS] - JBossWS Sample Test cases are failing
by ansantharam
I'm running the samples provided by JbossWS under 4.0.5 version. All the tests are failing though there is some activity on the server.
ant -Dtest=org.jboss.test.ws.jaxrpc.samples.jsr109pojo.RpcJSETestCase one-test
one-test:
[junit] Running org.jboss.test.ws.jaxrpc.samples.jsr109pojo.RpcJSETestCase
[junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 2.156 sec
[junit] Test org.jboss.test.ws.jaxrpc.samples.jsr109pojo.RpcJSETestCase FAILED
On JBOSS server the following is displayed:
11:39:27,921 INFO [TomcatDeployer] deploy, ctxPath=/jaxrpc-samples-jsr109pojo-rpc, warUrl=.../tmp/deploy/tmp60494jaxrpc-samples-j
sr109pojo-rpc-exp.war/
11:39:28,078 INFO [WSDLFilePublisher] WSDL published to: file:/C:/jbossws-1.2.1.GA/jbossws-samples-1.2.0.GA/output/wsdl-publish/j
sr109pojo/TestService.wsdl
11:39:28,187 INFO [ServiceEndpointManager] WebService started: http://mlb-ed-2f-sol-l:8080/jaxrpc-samples-jsr109pojo-rpc
11:39:28,265 INFO [ClientDeployer] Client ENC bound under: jbossws-client
11:39:28,390 INFO [ClientDeployer] Removing client ENC from: jbossws-client
11:39:28,406 INFO [ServiceEndpointManager] WebService stopped: http://mlb-ed-2f-sol-l:8080/jaxrpc-samples-jsr109pojo-rpc
11:39:28,406 INFO [TomcatDeployer] undeploy, ctxPath=/jaxrpc-samples-jsr109pojo-rpc, warUrl=.../tmp/deploy/tmp60494jaxrpc-samples
-jsr109pojo-rpc-exp.war/
Any help is appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091601#4091601
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091601
17 years