impossible de déployer mon web service soap !
Bonjour,
J'essaie de créer un web service SOAP pour gérer l'authentification à un server PHP, je suis pour cela le tutoriel suivant : http://www.mkyong.com/webservices/ja...ocument-style/
Comme d'habitude (désolé si je ne sonne pas très optimiste mais au bout d'un moment faire tout ce qu'on veut dit à la virgule près et obtenir à chaque fois un tas d'erreurs imcompréhensibles ça frustre un peu) je suis le tuto à la lettre, j'arrive au moment où je dois run le publisher.
J'obtiens HTTP status 404
Voici mon code suivi des warnings que j'obtiens, peut-être que vous pourrez me sauver la vie.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| package com.projet.authenticationservice;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style = Style.RPC)
public interface User {
@WebMethod public boolean login(String username, String password);
} |
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
| package com.projet.authenticationservice;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import javax.jws.WebService;
@WebService(endpointInterface = "com.projet.authenticationservice.User")
public class UserImpl implements User {
@Override
public boolean login(String username, String password) {
Properties properties = new Properties();
try {
InputStream inputstream = UserImpl.class.getResourceAsStream("/config.properties");
properties.load(inputstream);
inputstream.close();
} catch (Exception e) {
e.printStackTrace();
}
String dbUrl = properties.getProperty("url");
String userName = properties.getProperty("dbuser"), dbpassword = properties.getProperty("dbpassword");
String query = "select count(username) from user_account where username = '" + username + "' and password = '" + password + "'";
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection (dbUrl, userName, dbpassword);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
con.close();
if(rs.getInt(1) == 1)
return true;
else
return false;
}
catch(ClassNotFoundException e) {
e.printStackTrace();
}
catch(SQLException e) {
e.printStackTrace();
}
return false; // by default if the ResultSet doesn't have one and only one user with the
// right username and password I return false
}
} |
Code:
1 2 3 4 5 6 7 8 9 10 11
| package com.projet.endpoint;
import javax.xml.ws.Endpoint;
import com.projet.authenticationservice.*;
public class AutPublisher {
public static void main(String[] args) {
Endpoint.publish("http://localhost:8080/authenticationserver/login", new UserImpl());
}
} |
Les warnings et compagnie :
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
| janv. 06, 2015 8:34:37 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_25\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Ruby193\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\GNAT\2013\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\OpenVPN\bin;c:\ant\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\SASHome\Secure;C:\Program Files\SASHome\x86\Secure;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\SMLNJ\bin\;.
janv. 06, 2015 8:34:37 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
janv. 06, 2015 8:34:37 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
janv. 06, 2015 8:34:37 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 649 ms
janv. 06, 2015 8:34:37 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
janv. 06, 2015 8:34:37 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
janv. 06, 2015 8:34:37 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [264] milliseconds.
janv. 06, 2015 8:34:37 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\Administrator\workspace3\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\authenticationWS.xml
janv. 06, 2015 8:34:37 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:authenticationWS' did not find a matching property.
[INFO] Clustering has been disabled
[INFO] Deploying module: addressing-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/authenticationWS/WEB-INF/modules/addressing-1.6.2.mar
[INFO] Deploying module: jaxws-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/authenticationWS/WEB-INF/modules/axis2-jaxws-mar-1.6.2.mar
[INFO] Deploying module: metadataExchange-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/authenticationWS/WEB-INF/modules/mex-1.6.2.mar
[INFO] Deploying module: mtompolicy-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/authenticationWS/WEB-INF/modules/mtompolicy-1.6.2.mar
[INFO] Deploying module: ping-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/authenticationWS/WEB-INF/modules/ping-1.6.2.mar
[INFO] Deploying module: script-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/authenticationWS/WEB-INF/modules/scripting-1.6.2.mar
[INFO] Deploying module: soapmonitor-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/authenticationWS/WEB-INF/modules/soapmonitor-1.6.2.mar
janv. 06, 2015 8:34:39 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor C:\Users\Administrator\workspace3\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\authenticationWS.xml has finished in 2,064 ms
janv. 06, 2015 8:34:39 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\Administrator\workspace3\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\searchWS.xml
janv. 06, 2015 8:34:39 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:searchWS' did not find a matching property.
[INFO] Deploying JAXWS annotated class com.projet.authenticationservice.UserImpl as a service - UserImplService
[INFO] Deploying Web service: version-1.6.2.aar - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/authenticationWS/WEB-INF/services/version-1.6.2.aar
[WARN] Web application uses org.apache.axis2.transport.http.AxisAdminServlet; please update web.xml to use org.apache.axis2.webapp.AxisAdminServlet instead
[INFO] Clustering has been disabled
[INFO] Deploying module: addressing-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/searchWS/WEB-INF/modules/addressing-1.6.2.mar
[INFO] Deploying module: jaxws-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/searchWS/WEB-INF/modules/axis2-jaxws-mar-1.6.2.mar
[INFO] Deploying module: metadataExchange-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/searchWS/WEB-INF/modules/mex-1.6.2.mar
[INFO] Deploying module: mtompolicy-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/searchWS/WEB-INF/modules/mtompolicy-1.6.2.mar
[INFO] Deploying module: ping-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/searchWS/WEB-INF/modules/ping-1.6.2.mar
[INFO] Deploying module: script-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/searchWS/WEB-INF/modules/scripting-1.6.2.mar
[INFO] Deploying module: soapmonitor-1.6.2 - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/searchWS/WEB-INF/modules/soapmonitor-1.6.2.mar
[INFO] Deploying Web service: version-1.6.2.aar - file:/C:/Users/Administrator/workspace3/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/searchWS/WEB-INF/services/version-1.6.2.aar
janv. 06, 2015 8:34:41 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor C:\Users\Administrator\workspace3\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\searchWS.xml has finished in 1,836 ms
janv. 06, 2015 8:34:41 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
janv. 06, 2015 8:34:41 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
janv. 06, 2015 8:34:41 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4544 ms |
Merci INFINIMENT à tous ceux qui pourraient m'aider à faire avancer mon projet.