Problème avec WebServiceRef dans un EJB
Bonjour,
Je souhaite appelé un WebService dans un EJB. Voici le code de mon EJB :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
@WebService(serviceName = "SignatureWS", endpointInterface = "com.yousign.signatureejb.ISignatureWS")
@Stateless()
@MTOM
@HandlerChain(file = "handler-chain.xml")
public class SignatureWS implements ISignatureWS
{
@WebServiceRef(wsdlLocation = "META-INF/wsdl/192.168.215.149_8080/file.wsdl")
private serverWSService service;
private static final Logger logger = LoggerFactory.getLogger(
SignatureWS.class);
@Resource(name = "wsContext")
WebServiceContext wsCtxt;
} |
Mon fichier pom.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
| <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ApiServer</artifactId>
<groupId>com.yousign</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.yousign</groupId>
<artifactId>Signature-ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>ejb</packaging>
<name>Signature-ejb</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>Entities</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yousign</groupId>
<artifactId>Common</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.iharder</groupId>
<artifactId>base64</artifactId>
<version>2.3.8</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<version>0.7</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<targetPath>META-INF</targetPath>
<directory>src</directory>
<includes>
<include>jax-ws-catalog.xml</include>
<include>wsdl/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.1</ejbVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlFiles>
<wsdlFile>192.168.215.149_8080/file.wsdl</wsdlFile>
</wsdlFiles>
<wsdlLocation>http://192.168.215.149:8080/file?wsdl</wsdlLocation>
<staleFile>${project.build.directory}/jaxws/stale/file.stale</staleFile>
</configuration>
<id>wsimport-generate-file</id>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>webservices-api</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<configuration>
<sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
<xnocompile>true</xnocompile>
<verbose>true</verbose>
<extension>true</extension>
<catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
<target>2.0</target>
</configuration>
</plugin>
</plugins>
</build>
</project> |
J'ai plusieurs problèmes, mon fichier handler n'est pas pris en compte alors qu'il se trouve dans le répertoire src/main/resources. J'ai un autre EJB qui n'utilise pas de WebServiceRef et qui fonctionne avec le même handler. De plus, je souhaite déployer mon EJB en https et cela ne fonctionne pas. Ci-dessous mon fichier glassfish-ejb-jar.xml.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-ejb-jar PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 EJB 3.1//EN" "http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd">
<glassfish-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>SignatureWS</ejb-name>
<webservice-endpoint>
<port-component-name>SignatureWS</port-component-name>
<transport-guarantee>INTEGRAL</transport-guarantee>
</webservice-endpoint>
</ejb>
</enterprise-beans>
</glassfish-ejb-jar> |
Le problème est apparu après avoir ajouté le web service ref avec maven ws-import inclus dans NetBeans. Qu'en pensez-vous ? Je pourrai peut être utilisé les EJB pour accéder au service mais cela résolvera-t-il le problème ??
Merci beaucoup pour votre aide.