<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Re: Cannot find ServiceFactory implementation Problem
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/marklenders">marco gentile</a> in <i>JBoss Web Services Development</i> - <a href="https://community.jboss.org/message/762999#762999">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p> thanks for your replies.</p><p>I achieved to create a java client (java project) to connect to SugarCRM, without errors.</p><p>Below, I write a snippet of code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>-------------------------------------------------</p><p>....</p><p>import javax.xml.rpc.ServiceFactory;</p><p>....</p><p>String sessionID = null;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        try {</p><p>            // Create a URL end point for the client</p><p>            URL wsdlUrl = null;</p><p>            if (END_POINT_URL.isEmpty()) {</p><p>                wsdlUrl = new URL(</p><p>                        new SugarsoapLocator().getsugarsoapPortAddress()</p><p>                                + "?wsdl");</p><p>            } else {</p><p>                wsdlUrl = new URL(END_POINT_URL);</p><p>            }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>            System.out.println("URL endpoint created successfully!");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>            // Create Service for test configuration</p><p>            <span style="text-decoration: underline;"><strong><em>ServiceFactory serviceFactory = ServiceFactory.newInstance();</em></strong></span></p><p>            Service service = serviceFactory.createService(wsdlUrl,</p><p>                    new SugarsoapLocator().getServiceName());</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>            System.out.println("Service created successfully");</p><p>            System.out.println("Service Name:"</p><p>                    + service.getServiceName().toString());</p><p>            System.out.println("Service WSDL:"</p><p>                    + service.getWSDLDocumentLocation().toString());</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>            // Trying to create a stub</p><p>            SugarsoapBindingStub binding = new SugarsoapBindingStub(wsdlUrl,</p><p>                    service);</p><p>            binding.setTimeout(TIMEOUT);</p><p>            System.out.println("Stub created successfully!");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>            /**</p><p>             * Try to login on SugarCRM</p><p>             * </p><p>             * 1) Prepare a MD5 hash password 2) Prepare a User Auth object 3)</p><p>             * Execute login</p><p>             */</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>            // 1. Prepare a MD5 hash password</p><p>            MessageDigest messageDiget = MessageDigest.getInstance("MD5");</p><p>            messageDiget.update(USER_PASSWORD.getBytes());</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>            // 2. Prepare a User Auth object</p><p>            User_auth userAuthInfo = new User_auth();</p><p>            userAuthInfo.setUser_name(USER_NAME);</p><p>            userAuthInfo.setPassword((new BigInteger(1, messageDiget.digest()))</p><p>                    .toString(16));</p><p>            userAuthInfo.setVersion("0.1");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>            try {</p><p>                // 3. Execute login</p><p>                Set_entry_result loginResult = binding.login(userAuthInfo,</p><p>                        APPLICATION_NAME);</p><p>                System.out.println("Login Successfully for " + USER_NAME);</p><p>                System.out.println("Your session Id: " + loginResult.getId());</p><p>                sessionID = loginResult.getId();</p><p>            } catch (RemoteException ex) {</p><p>                System.out.println("Login failed. Message: " + ex.getMessage());</p><p>                ex.printStackTrace();</p><p>            }</p><p>-------------------------------------------------</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I created an eclipse web project, using <span style="font-size: 10pt;">JBoss 7.1.1 Final version as server.</span></p><p>I created a "login.xhtml" page.. submit button launches a function that belongs to "Login" class.. this function includes upper code.</p><p>When I debug my project on server, eclipse reports this error:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>-------------------------------------------------</p><p>17:33:54,550 INFO  [stdout] (http-localhost-127.0.0.1-8080-2) URL endpoint created successfully!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>17:33:55,803 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) javax.xml.rpc.ServiceException: Failed to create factory: org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>17:33:55,807 ERROR [stderr] (http-localhost-127.0.0.1-8080-2)     at javax.xml.rpc.ServiceFactory.newInstance(ServiceFactory.java:110)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>17:33:55,811 ERROR [stderr] (http-localhost-127.0.0.1-8080-2)     at com.brokers.sib.Login.authorization(Login.java:78)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>17:33:55,814 ERROR [stderr] (http-localhost-127.0.0.1-8080-2)     at com.brokers.sib.Login$Proxy$_$$_WeldClientProxy.authorization(Login$Proxy$_$$_WeldClientProxy.java)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>17:33:55,817 ERROR [stderr] (http-localhost-127.0.0.1-8080-2)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>17:33:55,821 ERROR [stderr] (http-localhost-127.0.0.1-8080-2)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>17:33:55,824 ERROR [stderr] (http-localhost-127.0.0.1-8080-2)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p>.....</p><p>-------------------------------------------------</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><a class="jive-link-profile-small" href="https://community.jboss.org/people/asoldano">Alessio Soldano</a> I follow your hints but nothing changes. I hope to have given you more info.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/762999#762999">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2047">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>