[JBossWS] - Re: Help with development environment
by richard_opalka
OK,
here's my .classpath (Eclipse project file) I'm using (note, this classpath includes almost all jars even those you will not need at all)
<?xml version="1.0" encoding="UTF-8"?>
| <classpath>
| <classpathentry kind="src" path="src/main/java"/>
| <classpathentry kind="src" path="output/tests/wsconsume/java"/>
| <classpathentry kind="src" path="src/test/java"/>
| <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
| <classpathentry kind="lib" path="thirdparty/activation.jar"/>
| <classpathentry kind="lib" path="thirdparty/getopt.jar"/>
| <classpathentry kind="lib" path="thirdparty/javassist.jar"/>
| <classpathentry kind="lib" path="thirdparty/jaxb-api.jar"/>
| <classpathentry kind="lib" path="thirdparty/jaxb-impl.jar"/>
| <classpathentry kind="lib" path="thirdparty/jaxb-xjc.jar"/>
| <classpathentry kind="lib" path="thirdparty/jboss-common-core.jar"/>
| <classpathentry kind="lib" path="thirdparty/jboss-dependency.jar"/>
| <classpathentry kind="lib" path="thirdparty/jboss-j2ee.jar"/>
| <classpathentry kind="lib" path="thirdparty/jboss-logging-spi.jar"/>
| <classpathentry kind="lib" path="thirdparty/jboss-microcontainer.jar"/>
| <classpathentry kind="lib" path="thirdparty/jboss-remoting.jar" sourcepath="/home/ropalka/NotBackedUp/svn/jbossas/tags/JBoss_4_0_5_GA/thirdparty/jboss/remoting/lib/jboss-remoting-src.jar"/>
| <classpathentry kind="lib" path="thirdparty/jbosssx-client.jar"/>
| <classpathentry kind="lib" path="thirdparty/jboss-xml-binding.jar" sourcepath="thirdparty/jboss-xml-binding-sources.jar"/>
| <classpathentry kind="lib" path="thirdparty/mail.jar"/>
| <classpathentry kind="lib" path="thirdparty/servlet-api.jar"/>
| <classpathentry kind="lib" path="thirdparty/stax-api.jar"/>
| <classpathentry exported="true" kind="lib" path="thirdparty/wsdl4j.jar" sourcepath="thirdparty/wsdl4j-src.jar"/>
| <classpathentry kind="lib" path="thirdparty/wstx.jar"/>
| <classpathentry kind="lib" path="thirdparty/xalan.jar"/>
| <classpathentry kind="lib" path="thirdparty/xercesImpl.jar"/>
| <classpathentry kind="lib" path="thirdparty/xmlsec.jar"/>
| <classpathentry kind="lib" path="thirdparty/ant.jar"/>
| <classpathentry kind="lib" path="thirdparty/qdox.jar"/>
| <classpathentry kind="lib" path="thirdparty/policy.jar"/>
| <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
| <classpathentry kind="lib" path="thirdparty/dom4j.jar"/>
| <classpathentry kind="lib" path="thirdparty/xmlunit.jar"/>
| <classpathentry kind="lib" path="thirdparty/jaxws-tools.jar"/>
| <classpathentry kind="lib" path="thirdparty/jaxws-rt.jar"/>
| <classpathentry kind="lib" path="thirdparty/concurrent.jar"/>
| <classpathentry combineaccessrules="false" kind="src" path="/spi"/>
| <classpathentry combineaccessrules="false" kind="src" path="/common"/>
| <classpathentry kind="lib" path="thirdparty/junit.jar"/>
| <classpathentry kind="output" path="output/eclipse"/>
| </classpath>
I suggest you to use POJOs as WebServices ;-)
Richard
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084312#4084312
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084312
17 years, 3 months
[JBossWS] - Cannot obtain java type mapping for {http://business/jaws}Li
by jaguaraci
Hello,
I'm using Jboss 4.0.5G, JbossWS 1.0.3, SDK 1.5.0_9 and Windows XP_SP2.
I have created theses classes using EJB3 annotation:
package business;
import java.rmi.Remote;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style = Style.RPC)
public interface SelecionarMusicas extends Remote{
public java.util.List selecionarMusicas() ;
}
package business;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.jws.WebService;
import transfer.MusicaTO;
import delegate.ManterMusicaDelegate;
import exceptions.MusicaException;
@Stateless
@WebService(endpointInterface="business.SelecionarMusicas")
@Remote(SelecionarMusicas.class)
public class SelecionarMusicasWS {
public java.util.List selecionarMusicas() throws MusicaException{
List musicas = new ArrayList();
ManterMusicaDelegate delegate;
delegate = new ManterMusicaDelegate();
musicas = delegate.selecionarMusicas();
return musicas;
}
}
package client;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import transfer.MusicaTO;
import business.SelecionarMusicas;
public class WebserviceClient {
private static final String nameSpace="http://business/jaws";
private static final String service="SelecionarMusicasService";
private static final String wsdl="http://localhost:8080/easd2007/SelecionarMusicasWS?wsdl";
public static void main(String[] args) {
try {
System.out.println("Starting Test Client");
URL url = new URL(wsdl);
QName qname = new QName(nameSpace,service);
System.out.println("Creating a service");
ServiceFactory factory = ServiceFactory.newInstance();
Service remote = factory.createService(url, qname);
System.out.println("Obtaining reference to a proxy object");
SelecionarMusicas proxy = (SelecionarMusicas) remote.getPort(SelecionarMusicas.class);
System.out.println("Accessed local proxy: " + proxy);
System.out.println("Receiving data: ");
List musicas = new ArrayList();
musicas = proxy.selecionarMusicas();
for (Iterator iter = musicas.iterator() ; iter.hasNext();){
System.out.print("Nome: "+ iter.next().getNome());
System.out.print("Tom: "+ iter.next().getNome());
System.out.print("Dominante Primário: "+ iter.next().getNome());
System.out.print("Dominante Secundário: "+ iter.next().getNome());
System.out.print("Diminuto Ascendente: "+ iter.next().getNome());
System.out.print("Diminuto Descendente: "+ iter.next().getNome());
System.out.print("Diminuto Alternativo: "+ iter.next().getNome());
System.out.print("Clichê Harmônico: "+ iter.next().getNome());
}
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
When I try to use a webservice client happens it:
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://business/jaws}List
at org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataRpc(JSR109MetaDataBuilder.java:321)
at org.jboss.ws.deployment.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:196)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:208)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:126)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82)
at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:96)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
at client.WebserviceClient.main(Unknown Source)
Somebody know why ?
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084262#4084262
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084262
17 years, 3 months
[JBossWS] - Dispatch + wssecurity
by fonseca
Hi,
I'm having a bit of trouble figuring this out - I'm trying to create a simple standalone dispatch for communication with an already set up webservice. I got everything working as expected if I use no security system - the problem arises when trying to invoke a request message involving an WSSecurityHandlerClient, resulting in a:
| javax.xml.ws.soap.SOAPFaultException: org.jboss.ws.core.CommonSOAPFaultException: This service requires <wsse:Security>, which is missing.
| at org.jboss.ws.core.jaxws.client.DispatchSOAPBinding.getReturnObject(DispatchSOAPBinding.java:165)
| at org.jboss.ws.core.jaxws.client.DispatchImpl.getReturnObject(DispatchImpl.java:290)
| at org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternal(DispatchImpl.java:141)
| at org.jboss.ws.core.jaxws.client.DispatchImpl.invoke(DispatchImpl.java:102)
|
The server looks all good, and is expecting security information (encryption) which for some reason the client isn't sending.
In my client, I have:
| ...
| System.setProperty("org.jboss.ws.wsse.keyStore", [...]);
| System.setProperty("org.jboss.ws.wsse.keyStorePassword", [...]);
| System.setProperty("org.jboss.ws.wsse.trustStore", [...]);
| System.setProperty("org.jboss.ws.wsse.trustStorePassword", [...]);
|
| URL serverURL = new URL(store.getString(PreferenceConstants.SERVER_URL));
| URL serviceURL = new URL(serverURL, "services/testService");
|
| service = new TestService(TestClient.class.getClassLoader().getResource("META-INF/TestService.wsdl"), new QName(namespace, "TestService"));
| port = service.getTestPort();
|
| BindingProvider bindingProvider = (BindingProvider) port;
| List<Handler> handlerChain = new ArrayList<Handler>();
| handlerChain.add(new WSSecurityHandlerClient());
| bindingProvider.getBinding().setHandlerChain(handlerChain);
|
| Map<String, Object> reqContext = bindingProvider.getRequestContext();
| reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL.toString());
| reqContext.put(BindingProvider.USERNAME_PROPERTY, SecurityService.instance().getID());
| reqContext.put(BindingProvider.PASSWORD_PROPERTY, "");
|
|
| dispatch = service.createDispatch(new QName(namespace, "TestPort"), StreamSource.class, Mode.PAYLOAD);
| dispatch.getBinding().setHandlerChain(handlerChain);
|
| StreamSource response = dispatch.invoke(new StreamSource(new StringReader(request))); //request is a simple payload string
|
META-INF/jboss-wsse-client.xml
| <jboss-ws-security
| xmlns="http://www.jboss.com/ws-security/config"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
|
| <config>
| <username/>
| <encrypt type="x509v3" alias="key"/>
| <requires>
| <encryption/>
| </requires>
| </config>
| </jboss-ws-security>
|
META-INF/standard-jaxws-client-config.xml
| <jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
| xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
|
| <client-config>
| <config-name>Standard WSSecurity Client</config-name>
| <post-handler-chains>
| <javaee:handler-chain>
| <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
| <javaee:handler>
| <javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name>
| <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient</javaee:handler-class>
| </javaee:handler>
| </javaee:handler-chain>
| </post-handler-chains>
| </client-config>
|
| </jaxws-config>
|
Am I wrong to assume dispatch.invoke is responsible for appending the security tags in my message?
Any help is appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084199#4084199
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084199
17 years, 3 months