You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by samwun9988 <le...@gmail.com> on 2011/09/11 06:03:44 UTC

Can't invoke web service

Hi, 

I have downloaded a Calculator example from the following web page:
http://www.java2s.com/Code/Java/EJB3/webserviceandStatelesssessionbeanOpenEJB.htm
Calculator OpenEJB Junit Test example  

There is an error when I execute it:



Here is the junit code:



I also attached a copy of the example here for reference.

Any suggestion is very appreciated.
Thanks
Sam
http://openejb.979440.n4.nabble.com/file/n3804670/simple-webservice.zip
simple-webservice.zip 

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3804670.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
thank you for the comment.
but I have a looked at my web service class, the @webservice annotation is
in-placed?


Romain Manni-Bucau wrote:
> 
> @WebService(name = "CategoryWebService", targetNamespace =
> "http://service.category.houseware.ix/")
> @XmlSeeAlso({
>     ObjectFactory.class
> })
> public interface CategoryWebService {
> 

Are you able to run my project successfully?

Here is my email addr: leiwun2013@gmail.com
Can you send the project back to me if you think it runs fine after the fix?

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3809416.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi, I am not sure how to invoke a remote web service call in Junit Test with
OpenEJB?
I have implemented two methods, one is add(x,y) which is just a local web
service function; another one is findAll() which is calling a remote web
service located in a remote JBOSS AS7 web server.

During junit testing, add(x,y) method returns the correct result, which
means the web service class is being called correctly.

but when the junit test invoked findAll() method, it couldn't found the
method and thrown the following error:



> -------------------------------------------------------------------------------
> Test set: org.superbiz.calculator.CalculatorTest
> -------------------------------------------------------------------------------
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 14.85 sec
> <<< FAILURE!
> testCategoryManagerViaRemoteInterface(org.superbiz.calculator.CalculatorTest) 
> Time elapsed: 14.757 sec  <<< ERROR!
> javax.ejb.EJBException: The bean encountered a non-application exception;
> nested exception is: 
>         java.lang.RuntimeException: Error reading XMLStreamReader.
>         at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>         at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:288)
>         at $Proxy73.findAll(Unknown Source)
>         at
> org.superbiz.calculator.CalculatorTest.testCategoryManagerViaRemoteInterface(CalculatorTest.java:122)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at
> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
>         at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
>         at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
>         at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
>         at $Proxy0.invoke(Unknown Source)
>         at
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
>         at
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
>         at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
> Caused by: java.lang.RuntimeException: Error reading XMLStreamReader.
>         at
> org.superbiz.calculator.CategoryManagerImpl.findAll(CategoryManagerImpl.java:47)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:174)
>         at
> org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:93)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
>         at
> org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:129)
>         at
> org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:45)
>         at
> org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:66)
>         at
> org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:72)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
>         at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
>         at
> org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:130)
>         at
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:226)
>         at
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:178)
>         at
> org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:255)
>         at
> org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:235)
>         at
> org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:92)
>         at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:284)
>         ... 27 more
>  

Here is the method in my junit test class:



> CategoryManagerLocal cat = (CategoryManagerLocal)
> initialContext.lookup("CategoryManagerImplLocal");
>         assertEquals(2, cat.add(1, 1));
>         System.out.println("Result: "+cat.add(1,1)); // <-- this method
> returns 2.
>          System.out.println("Size: "+cat.findAll().size()); // <-- here it
> thrown error exception.
> 

CategoryManagerLocal.java file:



> package org.superbiz.calculator;
> 
> import ix.houseware.category.service.CategorySubcategories;
> import java.util.Collection;
> import javax.ejb.Local;
> 
> @Local
> public interface CategoryManagerLocal {
>     Collection<CategorySubcategories> findAll();
> //    Collection<CategorySubcategories> find(final String name, final
> String desc);
>     int add(int a, int b);
> }
> 

CategoryManagerImpl.java file:



> @Stateless
> //@WebService(name = "CategoryWebService", targetNamespace =
> "http://service.category.houseware.ix/")
> @WebService(
>         portName = "CategoryWebServiceImplPort",
>         serviceName = "CategoryManagerWebService",
>         targetNamespace = "http://service.category.houseware.ix/",
>         endpointInterface =
> "ix.houseware.category.service.CategoryWebService")
> //@LocalBean
> public class CategoryManagerImpl implements CategoryWebService,
> CategoryManagerLocal {
> //    @WebServiceRef(wsdlLocation =
> "META-INF/wsdl/www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services.wsdl")
>     @WebServiceRef(wsdlLocation =
> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl")
>     private CategoryWebService_Service service;
>     
> //    private static final Logger logger =
> Logger.getLogger(CategoryManagerImpl.class);
> 
>     @Override
>     public List<CategorySubcategories> findAll() {
>         List<CategorySubcategories> result = new
> ArrayList<CategorySubcategories>();
>         try { // Call Web Service Operation
>             ix.houseware.category.service.CategoryWebService port =
> service.getCategoryWebServiceImplPort();
>             result = port.findAll();
> //            logger.info("Result = " +result.toString());
>             System.out.println("Result = "+result);
>         } catch (Exception ex) {
>             throw new RuntimeException(ex.getMessage()); // <-- here it
> thrown error exception.
>         }
>         return result;
>     }
>     
>       
>     @Override
>             public int add(int a, int b) {
>                 return a+b;
>     }
> 
>     @Override
>     public void createCategory(String name, String desc) {
>         throw new UnsupportedOperationException("Not supported yet.");
>     }
> 
> }
> 
> 

CategoryWebService.java file:



> 
> package ix.houseware.category.service;
> 
> import java.util.List;
> import javax.jws.Oneway;
> import javax.jws.WebMethod;
> import javax.jws.WebParam;
> import javax.jws.WebResult;
> import javax.jws.WebService;
> import javax.xml.bind.annotation.XmlSeeAlso;
> import javax.xml.ws.RequestWrapper;
> import javax.xml.ws.ResponseWrapper;
> 
> 
> /**
>  * This class was generated by the JAX-WS RI.
>  * JAX-WS RI 2.1.3-b02-
>  * Generated source version: 2.1
>  * 
>  */
> @WebService(name = "CategoryWebService", targetNamespace =
> "http://service.category.houseware.ix/")
> @XmlSeeAlso({
>     ObjectFactory.class
> })
> public interface CategoryWebService {
> 
> 
>     /**
>      * 
>      * @return
>      *     returns
> java.util.List<ix.houseware.category.service.CategorySubcategories>
>      */
>     @WebMethod
>     @WebResult(targetNamespace = "")
>     @RequestWrapper(localName = "findAll", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.FindAll")
>     @ResponseWrapper(localName = "findAllResponse", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.FindAllResponse")
>     public List<CategorySubcategories> findAll();
> 
>     /**
>      * 
>      * @param desc
>      * @param name
>      * @return
>      *     returns
> java.util.List<ix.houseware.category.service.CategorySubcategories>
>      */
>     @WebMethod
>     @WebResult(targetNamespace = "")
>     @RequestWrapper(localName = "find", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.Find")
>     @ResponseWrapper(localName = "findResponse", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.FindResponse")
>     public List<CategorySubcategories> find(
>         @WebParam(name = "name", targetNamespace = "")
>         String name,
>         @WebParam(name = "desc", targetNamespace = "")
>         String desc);
> 
>     /**
>      * 
>      * @param desc
>      * @param name
>      */
>     @WebMethod
>     @Oneway
>     @RequestWrapper(localName = "createCategory", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.CreateCategory")
>     public void createCategory(
>         @WebParam(name = "name", targetNamespace = "")
>         String name,
>         @WebParam(name = "desc", targetNamespace = "")
>         String desc);
> 
> }
> 
> 
What is wrong with my code and / or project setup?


Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3810367.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
you didn't put @WebService on your service.

- Romain

2011/9/13 samwun9988 <le...@gmail.com>

> Hi, I have attached a zip file for the projrect, and the surefire-report
> file
> in jira:
>
> https://issues.apache.org/jira/browse/OPENEJB-1661
>
> Thanks
> Sam
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3809366.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi, I have attached a zip file for the projrect, and the surefire-report file
in jira:

https://issues.apache.org/jira/browse/OPENEJB-1661

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3809366.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
you can create one ;)

you should have some reports in
C:\work\test2\simple-webservice\target\surefire-reports, paste them too
please.

- Romain

2011/9/13 samwun9988 <le...@gmail.com>

> hi, can you tell me how to attach my project there if I don't have jira
> login
> account for openejb?
>
> Thanks
> Sam
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3809343.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Can't invoke web service

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
Everybody can create a JIRA account easily (just few minutes).
Then, you can push your test project.

Jean-Louis

2011/9/13 samwun9988 <le...@gmail.com>

> hi, can you tell me how to attach my project there if I don't have jira
> login
> account for openejb?
>
> Thanks
> Sam
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3809343.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
hi, can you tell me how to attach my project there if I don't have jira login
account for openejb?

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3809343.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by David Blevins <da...@gmail.com>.
Hi Sam,

Thanks for the code.  I think Romain was looking for something ready to run.  Maybe you could attach a zip of the project here:

  https://issues.apache.org/jira/browse/OPENEJB-1661


-David

On Sep 12, 2011, at 11:44 PM, samwun9988 wrote:

> Hi,
> 
> Here is my junit test file:
> 
> 
> Romain Manni-Bucau wrote:
>> 
>> public void testCategoryManagerViaRemoteInterface() throws Exception {
>>        Service calcService = Service.create(
>>                new URL("http://127.0.0.1:4204/CategoryManagerImpl?wsdl"),
>>                new QName("http://service.category.houseware.ix/",
>> "CategoryWsService"));
>>        assertNotNull(calcService);
>>         CategoryWebService cat =
>> calcService.getPort(CategoryWebService.class);
>>         initialContext.lookup("CategoryManagerImplLocal");
>>         System.out.println("Size: "+cat.findAll().size());
>>    }
>> 
> 
> CategoryWebService.java code:
> 
> 
>> @WebService(name = "CategoryWebService", targetNamespace =
>> "http://service.category.houseware.ix/")
>> @XmlSeeAlso({
>>    ObjectFactory.class
>> })
>> public interface CategoryWebService {
>> 
>> 
>>    /**
>>     * 
>>     * @return
>>     *     returns
>> java.util.List<ix.houseware.category.service.CategorySubcategories>
>>     */
>>    @WebMethod
>>    @WebResult(targetNamespace = "")
>>    @RequestWrapper(localName = "findAll", targetNamespace =
>> "http://service.category.houseware.ix/", className =
>> "ix.houseware.category.service.FindAll")
>>    @ResponseWrapper(localName = "findAllResponse", targetNamespace =
>> "http://service.category.houseware.ix/", className =
>> "ix.houseware.category.service.FindAllResponse")
>>    public List<CategorySubcategories> findAll();
>> 
>>    /**
>>     * 
>>     * @param desc
>>     * @param name
>>     * @return
>>     *     returns
>> java.util.List<ix.houseware.category.service.CategorySubcategories>
>>     */
>>    @WebMethod
>>    @WebResult(targetNamespace = "")
>>    @RequestWrapper(localName = "find", targetNamespace =
>> "http://service.category.houseware.ix/", className =
>> "ix.houseware.category.service.Find")
>>    @ResponseWrapper(localName = "findResponse", targetNamespace =
>> "http://service.category.houseware.ix/", className =
>> "ix.houseware.category.service.FindResponse")
>>    public List<CategorySubcategories> find(
>>        @WebParam(name = "name", targetNamespace = "")
>>        String name,
>>        @WebParam(name = "desc", targetNamespace = "")
>>        String desc);
>> 
>>    /**
>>     * 
>>     * @param desc
>>     * @param name
>>     */
>>    @WebMethod
>>    @Oneway
>>    @RequestWrapper(localName = "createCategory", targetNamespace =
>> "http://service.category.houseware.ix/", className =
>> "ix.houseware.category.service.CreateCategory")
>>    public void createCategory(
>>        @WebParam(name = "name", targetNamespace = "")
>>        String name,
>>        @WebParam(name = "desc", targetNamespace = "")
>>        String desc);
>> 
>> }
>> 
>> 
> 
> CategoryManagerLocal.java code:
> 
> 
> 
>> import ix.houseware.category.service.CategorySubcategories;
>> import java.util.Collection;
>> import javax.ejb.Local;
>> 
>> @Local
>> public interface CategoryManagerLocal {
>>    Collection<CategorySubcategories> findAll();
>>    Collection<CategorySubcategories> find(final String name, final String
>> desc);
>>    int add(int a, int b);
>> }
>> 
> 
> CategoryManagerImpl.java code:
> 
> 
>> import ix.houseware.category.service.CategorySubcategories;
>> import ix.houseware.category.service.CategoryWebService_Service;
>> import java.util.ArrayList;
>> import java.util.Collection;
>> import java.util.List;
>> //import org.apache.log4j.Logger;
>> import javax.ejb.Stateless;
>> import javax.ejb.LocalBean;
>> import javax.xml.ws.WebServiceRef;
>> 
>> @Stateless
>> //@LocalBean
>> public class CategoryManagerImpl implements CategoryManagerLocal {
>> //    @WebServiceRef(wsdlLocation =
>> "META-INF/wsdl/www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services.wsdl")
>>    @WebServiceRef(wsdlLocation =
>> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl")
>>    private CategoryWebService_Service service;
>> 
>> //    private static final Logger logger =
>> Logger.getLogger(CategoryManagerImpl.class);
>> 
>>    @Override
>>    public Collection<CategorySubcategories> findAll() {
>>        List<CategorySubcategories> result = new
>> ArrayList<CategorySubcategories>();
>>        try { // Call Web Service Operation
>>            ix.houseware.category.service.CategoryWebService port =
>> service.getCategoryWebServiceImplPort();
>>            result = port.findAll();
>> //            logger.info("Result = " +result.toString());
>>            System.out.println("Result = "+result);
>>        } catch (Exception ex) {
>>            throw new RuntimeException(ex.getMessage());
>>        }
>>        return result;
>>    }
>> 
>>    @Override
>>    public Collection<CategorySubcategories> find(final String name, final
>> String desc) {
>>        List<CategorySubcategories> result = new
>> ArrayList<CategorySubcategories>();
>>        try { // Call Web Service Operation
>>            ix.houseware.category.service.CategoryWebService port =
>> service.getCategoryWebServiceImplPort();
>>            // TODO initialize WS operation arguments here
>>            result = port.find(name, desc);
>> //            logger.info("Result = " +result.toString());
>>        } catch (Exception ex) {
>>            throw new RuntimeException(ex.getMessage());
>>        }
>>        return result;
>>    }
>> 
>>    @Override
>>            public int add(int a, int b) {
>>                return a+b;
>>    }
>> }
>> 
>> 
> 
> CategoryWebService_Service.java code:
> 
> 
> 
>> 
>> import java.net.MalformedURLException;
>> import java.net.URL;
>> import java.util.logging.Logger;
>> import javax.xml.namespace.QName;
>> import javax.xml.ws.Service;
>> import javax.xml.ws.WebEndpoint;
>> import javax.xml.ws.WebServiceClient;
>> import javax.xml.ws.WebServiceFeature;
>> 
>> 
>> /**
>> * This class was generated by the JAX-WS RI.
>> * JAX-WS RI 2.1.3-b02-
>> * Generated source version: 2.1
>> * 
>> */
>> @WebServiceClient(name = "CategoryWebService", targetNamespace =
>> "http://service.category.houseware.ix/", wsdlLocation =
>> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl")
>> public class CategoryWebService_Service
>>    extends Service
>> {
>> 
>>    private final static URL CATEGORYWEBSERVICE_WSDL_LOCATION;
>>    private final static Logger logger =
>> Logger.getLogger(ix.houseware.category.service.CategoryWebService_Service.class.getName());
>> 
>>    static {
>>        URL url = null;
>>        try {
>>            URL baseUrl;
>>            baseUrl =
>> ix.houseware.category.service.CategoryWebService_Service.class.getResource(".");
>>            url = new URL(baseUrl,
>> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl");
>>        } catch (MalformedURLException e) {
>>            logger.warning("Failed to create URL for the wsdl Location:
>> 'http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl',
>> retrying as a local file");
>>            logger.warning(e.getMessage());
>>        }
>>        CATEGORYWEBSERVICE_WSDL_LOCATION = url;
>>    }
>> 
>>    public CategoryWebService_Service(URL wsdlLocation, QName serviceName)
>> {
>>        super(wsdlLocation, serviceName);
>>    }
>> 
>>    public CategoryWebService_Service() {
>>        super(CATEGORYWEBSERVICE_WSDL_LOCATION, new
>> QName("http://service.category.houseware.ix/", "CategoryWebService"));
>>    }
>> 
>>    /**
>>     * 
>>     * @return
>>     *     returns CategoryWebService
>>     */
>>    @WebEndpoint(name = "CategoryWebServiceImplPort")
>>    public CategoryWebService getCategoryWebServiceImplPort() {
>>        return super.getPort(new
>> QName("http://service.category.houseware.ix/",
>> "CategoryWebServiceImplPort"), CategoryWebService.class);
>>    }
>> 
>>    /**
>>     * 
>>     * @param features
>>     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure
>> on the proxy.  Supported features not in the <code>features</code>
>> parameter will have their default values.
>>     * @return
>>     *     returns CategoryWebService
>>     */
>>    @WebEndpoint(name = "CategoryWebServiceImplPort")
>>    public CategoryWebService
>> getCategoryWebServiceImplPort(WebServiceFeature... features) {
>>        return super.getPort(new
>> QName("http://service.category.houseware.ix/",
>> "CategoryWebServiceImplPort"), CategoryWebService.class, features);
>>    }
>> 
>> }
>> 
>> 
> 
> Thanks
> Sam
> 
> --
> View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3809306.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi,

Here is my junit test file:


Romain Manni-Bucau wrote:
> 
>  public void testCategoryManagerViaRemoteInterface() throws Exception {
>         Service calcService = Service.create(
>                 new URL("http://127.0.0.1:4204/CategoryManagerImpl?wsdl"),
>                 new QName("http://service.category.houseware.ix/",
> "CategoryWsService"));
>         assertNotNull(calcService);
>          CategoryWebService cat =
> calcService.getPort(CategoryWebService.class);
>          initialContext.lookup("CategoryManagerImplLocal");
>          System.out.println("Size: "+cat.findAll().size());
>     }
> 

CategoryWebService.java code:


> @WebService(name = "CategoryWebService", targetNamespace =
> "http://service.category.houseware.ix/")
> @XmlSeeAlso({
>     ObjectFactory.class
> })
> public interface CategoryWebService {
> 
> 
>     /**
>      * 
>      * @return
>      *     returns
> java.util.List<ix.houseware.category.service.CategorySubcategories>
>      */
>     @WebMethod
>     @WebResult(targetNamespace = "")
>     @RequestWrapper(localName = "findAll", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.FindAll")
>     @ResponseWrapper(localName = "findAllResponse", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.FindAllResponse")
>     public List<CategorySubcategories> findAll();
> 
>     /**
>      * 
>      * @param desc
>      * @param name
>      * @return
>      *     returns
> java.util.List<ix.houseware.category.service.CategorySubcategories>
>      */
>     @WebMethod
>     @WebResult(targetNamespace = "")
>     @RequestWrapper(localName = "find", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.Find")
>     @ResponseWrapper(localName = "findResponse", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.FindResponse")
>     public List<CategorySubcategories> find(
>         @WebParam(name = "name", targetNamespace = "")
>         String name,
>         @WebParam(name = "desc", targetNamespace = "")
>         String desc);
> 
>     /**
>      * 
>      * @param desc
>      * @param name
>      */
>     @WebMethod
>     @Oneway
>     @RequestWrapper(localName = "createCategory", targetNamespace =
> "http://service.category.houseware.ix/", className =
> "ix.houseware.category.service.CreateCategory")
>     public void createCategory(
>         @WebParam(name = "name", targetNamespace = "")
>         String name,
>         @WebParam(name = "desc", targetNamespace = "")
>         String desc);
> 
> }
> 
> 

CategoryManagerLocal.java code:



> import ix.houseware.category.service.CategorySubcategories;
> import java.util.Collection;
> import javax.ejb.Local;
> 
> @Local
> public interface CategoryManagerLocal {
>     Collection<CategorySubcategories> findAll();
>     Collection<CategorySubcategories> find(final String name, final String
> desc);
>     int add(int a, int b);
> }
> 

CategoryManagerImpl.java code:


> import ix.houseware.category.service.CategorySubcategories;
> import ix.houseware.category.service.CategoryWebService_Service;
> import java.util.ArrayList;
> import java.util.Collection;
> import java.util.List;
> //import org.apache.log4j.Logger;
> import javax.ejb.Stateless;
> import javax.ejb.LocalBean;
> import javax.xml.ws.WebServiceRef;
> 
> @Stateless
> //@LocalBean
> public class CategoryManagerImpl implements CategoryManagerLocal {
> //    @WebServiceRef(wsdlLocation =
> "META-INF/wsdl/www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services.wsdl")
>     @WebServiceRef(wsdlLocation =
> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl")
>     private CategoryWebService_Service service;
>     
> //    private static final Logger logger =
> Logger.getLogger(CategoryManagerImpl.class);
> 
>     @Override
>     public Collection<CategorySubcategories> findAll() {
>         List<CategorySubcategories> result = new
> ArrayList<CategorySubcategories>();
>         try { // Call Web Service Operation
>             ix.houseware.category.service.CategoryWebService port =
> service.getCategoryWebServiceImplPort();
>             result = port.findAll();
> //            logger.info("Result = " +result.toString());
>             System.out.println("Result = "+result);
>         } catch (Exception ex) {
>             throw new RuntimeException(ex.getMessage());
>         }
>         return result;
>     }
>     
>     @Override
>     public Collection<CategorySubcategories> find(final String name, final
> String desc) {
>         List<CategorySubcategories> result = new
> ArrayList<CategorySubcategories>();
>         try { // Call Web Service Operation
>             ix.houseware.category.service.CategoryWebService port =
> service.getCategoryWebServiceImplPort();
>             // TODO initialize WS operation arguments here
>             result = port.find(name, desc);
> //            logger.info("Result = " +result.toString());
>         } catch (Exception ex) {
>             throw new RuntimeException(ex.getMessage());
>         }
>         return result;
>     }
>     
>     @Override
>             public int add(int a, int b) {
>                 return a+b;
>     }
> }
> 
> 

CategoryWebService_Service.java code:



> 
> import java.net.MalformedURLException;
> import java.net.URL;
> import java.util.logging.Logger;
> import javax.xml.namespace.QName;
> import javax.xml.ws.Service;
> import javax.xml.ws.WebEndpoint;
> import javax.xml.ws.WebServiceClient;
> import javax.xml.ws.WebServiceFeature;
> 
> 
> /**
>  * This class was generated by the JAX-WS RI.
>  * JAX-WS RI 2.1.3-b02-
>  * Generated source version: 2.1
>  * 
>  */
> @WebServiceClient(name = "CategoryWebService", targetNamespace =
> "http://service.category.houseware.ix/", wsdlLocation =
> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl")
> public class CategoryWebService_Service
>     extends Service
> {
> 
>     private final static URL CATEGORYWEBSERVICE_WSDL_LOCATION;
>     private final static Logger logger =
> Logger.getLogger(ix.houseware.category.service.CategoryWebService_Service.class.getName());
> 
>     static {
>         URL url = null;
>         try {
>             URL baseUrl;
>             baseUrl =
> ix.houseware.category.service.CategoryWebService_Service.class.getResource(".");
>             url = new URL(baseUrl,
> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl");
>         } catch (MalformedURLException e) {
>             logger.warning("Failed to create URL for the wsdl Location:
> 'http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl',
> retrying as a local file");
>             logger.warning(e.getMessage());
>         }
>         CATEGORYWEBSERVICE_WSDL_LOCATION = url;
>     }
> 
>     public CategoryWebService_Service(URL wsdlLocation, QName serviceName)
> {
>         super(wsdlLocation, serviceName);
>     }
> 
>     public CategoryWebService_Service() {
>         super(CATEGORYWEBSERVICE_WSDL_LOCATION, new
> QName("http://service.category.houseware.ix/", "CategoryWebService"));
>     }
> 
>     /**
>      * 
>      * @return
>      *     returns CategoryWebService
>      */
>     @WebEndpoint(name = "CategoryWebServiceImplPort")
>     public CategoryWebService getCategoryWebServiceImplPort() {
>         return super.getPort(new
> QName("http://service.category.houseware.ix/",
> "CategoryWebServiceImplPort"), CategoryWebService.class);
>     }
> 
>     /**
>      * 
>      * @param features
>      *     A list of {@link javax.xml.ws.WebServiceFeature} to configure
> on the proxy.  Supported features not in the <code>features</code>
> parameter will have their default values.
>      * @return
>      *     returns CategoryWebService
>      */
>     @WebEndpoint(name = "CategoryWebServiceImplPort")
>     public CategoryWebService
> getCategoryWebServiceImplPort(WebServiceFeature... features) {
>         return super.getPort(new
> QName("http://service.category.houseware.ix/",
> "CategoryWebServiceImplPort"), CategoryWebService.class, features);
>     }
> 
> }
> 
> 

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3809306.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
and here is the error:


Romain Manni-Bucau wrote:
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running org.superbiz.calculator.CalculatorTest
> Apache OpenEJB 4.0.0-SNAPSHOT    build: 20110911-12:59
> http://openejb.apache.org/
> INFO - openejb.home = C:\work\test2\simple-webservice
> INFO - openejb.base = C:\work\test2\simple-webservice
> INFO - Configuring Service(id=Default Security Service,
> type=SecurityService, provider-id=Default Security Service)
> INFO - Configuring Service(id=Default Transaction Manager,
> type=TransactionManager, provider-id=Default Transaction Manager)
> INFO - Found EjbModule in classpath:
> C:\work\test2\simple-webservice\target\test-classes
> INFO - Found EjbModule in classpath:
> C:\work\test2\simple-webservice\target\classes
> INFO - Searched 11 classpath urls in 1545 milliseconds.  Average 140
> milliseconds per url.
> INFO - Beginning load: C:\work\test2\simple-webservice\target\test-classes
> INFO - Beginning load: C:\work\test2\simple-webservice\target\classes
> INFO - Configuring enterprise application:
> C:\work\test2\simple-webservice\classpath.ear
> INFO - Configuring Service(id=Default Stateless Container, type=Container,
> provider-id=Default Stateless Container)
> INFO - Auto-creating a container for bean CategoryManagerImpl:
> Container(type=STATELESS, id=Default Stateless Container)
> INFO - Enterprise application
> "C:\work\test2\simple-webservice\classpath.ear" loaded.
> INFO - Assembling app: C:\work\test2\simple-webservice\classpath.ear
> INFO - Jndi(name=CategoryManagerImplLocal) -->
> Ejb(deployment-id=CategoryManagerImpl)
> INFO -
> Jndi(name=global/classpath.ear/simple-webservice/CategoryManagerImpl!org.superbiz.calculator.CategoryManagerLocal)
> --> Ejb(deployment-id=CategoryManagerImpl)
> INFO -
> Jndi(name=global/classpath.ear/simple-webservice/CategoryManagerImpl) -->
> Ejb(deployment-id=CategoryManagerImpl)
> INFO - Jndi(name=CalculatorImplLocal) -->
> Ejb(deployment-id=CalculatorImpl)
> INFO -
> Jndi(name=global/classpath.ear/simple-webservice/CalculatorImpl!org.superbiz.calculator.CalculatorLocal)
> --> Ejb(deployment-id=CalculatorImpl)
> INFO - Jndi(name=global/classpath.ear/simple-webservice/CalculatorImpl)
> --> Ejb(deployment-id=CalculatorImpl)
> INFO - Created Ejb(deployment-id=CalculatorImpl, ejb-name=CalculatorImpl,
> container=Default Stateless Container)
> INFO - Created Ejb(deployment-id=CategoryManagerImpl,
> ejb-name=CategoryManagerImpl, container=Default Stateless Container)
> INFO - Started Ejb(deployment-id=CalculatorImpl, ejb-name=CalculatorImpl,
> container=Default Stateless Container)
> INFO - Started Ejb(deployment-id=CategoryManagerImpl,
> ejb-name=CategoryManagerImpl, container=Default Stateless Container)
> INFO - LocalClient(class=org.superbiz.calculator.CalculatorTest,
> module=test-classes) 
> INFO - Deployed
> Application(path=C:\work\test2\simple-webservice\classpath.ear)
> INFO - Initializing network services
> INFO - Creating ServerService(id=httpejbd)
> INFO - Creating ServerService(id=cxf)
> INFO - Creating ServerService(id=admin)
> INFO - Creating ServerService(id=ejbd)
> INFO - Creating ServerService(id=ejbds)
> INFO - Initializing network services
>   ** Starting Services **
>   NAME                 IP              PORT  
>   httpejbd             127.0.0.1       4204  
>   admin thread         127.0.0.1       4200  
>   ejbd                 127.0.0.1       4201  
>   ejbd                 127.0.0.1       4203  
> -------
> Ready!
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.775 sec
> <<< FAILURE!
> 
> Results :
> 
> Tests in error: 
>  
> testCategoryManagerViaRemoteInterface(org.superbiz.calculator.CalculatorTest):
> org.apache.cxf.service.factory.ServiceConstructionException: Failed to
> create service.
> 
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> 
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 14.683s
> [INFO] Finished at: Tue Sep 13 11:17:10 EST 2011
> [INFO] Final Memory: 21M/127M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test)
> on project simple-webservice: There are test failures.
> [ERROR] 
> [ERROR] Please refer to
> C:\work\test2\simple-webservice\target\surefire-reports for the individual
> test results.
> [ERROR] -> [Help 1]
> [ERROR] 
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR] 
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
> 
> 
> 


--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3809310.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i think you should share a unit test if you want more help, it should be
just a typo/address error.

- Romain

2011/9/13 samwun9988 <le...@gmail.com>

> hi if you click the following link,  it works.
>
> http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl
>
> so it is not the network problem.
>
> Thanks
> Sam
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3808892.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
hi if you click the following link,  it works.

http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl

so it is not the network problem.

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3808892.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
Hi,

It may be caused by a proxy issue.
I mean, you are specifying a remote URL to retrieve the WSDL.

CXF does not seem able to get the WSDL.
Could you check if you can access the specified URL without proxy?
>From a company network, it's a common issue.

Jean-Louis


2011/9/12 samwun9988 <le...@gmail.com>

> Hi, after added my own service classes, I got the following error:
>
>
> samwun9988 wrote:
> >
> > ...
> >         at
> >
> org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
> >         at $Proxy0.invoke(Unknown Source)
> >         at
> >
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
> >         at
> >
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
> >         at
> > org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
> > Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> > Failed to create service.
> >         at
> >
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:94)
> >         at
> > org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
> >         at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
> >         ... 35 more
> > Caused by: javax.wsdl.WSDLException: WSDLException:
> > faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF
> > in prolog
> >  at [row,col,system-id]:
> > [1,0,"http://127.0.0.1:4204/CategoryManagerImpl?wsdl"]
> >         at
> >
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:235)
> >         at
> >
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
> >         at
> >
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
> >         ... 37 more
> > Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
> >  at [row,col,system-id]:
> > [1,0,"http://127.0.0.1:4204/CategoryManagerImpl?wsdl"]
> >         at
> > com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:682)
> >         at
> > com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2090)
> >         at
> >
> com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:1996)
> >         at
> > com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1100)
> >         at
> > org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1050)
> >         at
> > org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:947)
> >         at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:874)
> >         at
> >
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226)
> >         ... 39 more
> >
> >
>
> CalculatorTest.java:
>
>
> > @WebServiceRef(
> >             wsdlLocation =
> > "http://127.0.0.1:4204/CategoryManagerImpl?wsdl"
> >     )
> >     private CategoryWebService categoryWs;
> >
> >     //START SNIPPET: setup
> >     private InitialContext initialContext;
> > public void testCategoryManagerViaRemoteInterface() throws Exception {
> >         CategoryManagerLocal cat = (CategoryManagerLocal)
> > initialContext.lookup("CategoryManagerImplLocal");
> >         assertEquals(2, cat.add(1, 1));
> >     }
> >
>
> CategoryManagerLocal.java:
>
>
>
> > package org.superbiz.calculator;
> >
> > import ix.houseware.category.service.CategorySubcategories;
> > import java.util.Collection;
> > import javax.ejb.Local;
> >
> > /**
> >  *
> >  * @author sam
> >  */
> > @Local
> > public interface CategoryManagerLocal {
> >     Collection<CategorySubcategories> findAll();
> >     Collection<CategorySubcategories> find(final String name, final
> String
> > desc);
> >     int add(int a, int b);
> > }
> >
> >
>
> CategoryManagerImpl.java :
>
>
>
> > @Stateless
> > //@LocalBean
> > public class CategoryManagerImpl implements CategoryManagerLocal {
> > //    @WebServiceRef(wsdlLocation =
> > "META-INF/wsdl/
> www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services.wsdl")
> >     @WebServiceRef(wsdlLocation =
> > "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl")
> >     private CategoryWebService_Service service;
> > @Override
> >             public int add(int a, int b) {
> >                 return a+b;
> >     }
> > }
> >
>
> CategoryWebService_Service.java:
>
>
>
> > @WebServiceClient(name = "CategoryWebService", targetNamespace =
> > "http://service.category.houseware.ix/", wsdlLocation =
> > "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl")
> > public class CategoryWebService_Service
> >     extends Service
> > {
> >  static {
> >         URL url = null;
> >         try {
> >             URL baseUrl;
> >             baseUrl =
> >
> ix.houseware.category.service.CategoryWebService_Service.class.getResource(".");
> >             url = new URL(baseUrl,
> > "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl");
> >         } catch (MalformedURLException e) {
> >             logger.warning("Failed to create URL for the wsdl Location:
> > 'http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl',
> > retrying as a local file");
> >             logger.warning(e.getMessage());
> >         }
> >         CATEGORYWEBSERVICE_WSDL_LOCATION = url;
> >     }
> >
> >     public CategoryWebService_Service(URL wsdlLocation, QName
> serviceName)
> > {
> >         super(wsdlLocation, serviceName);
> >     }
> >
> >     public CategoryWebService_Service() {
> >         super(CATEGORYWEBSERVICE_WSDL_LOCATION, new
> > QName("http://service.category.houseware.ix/", "CategoryWebService"));
> >     }
> > @WebEndpoint(name = "CategoryWebServiceImplPort")
> >     public CategoryWebService getCategoryWebServiceImplPort() {
> >         return super.getPort(new
> > QName("http://service.category.houseware.ix/",
> > "CategoryWebServiceImplPort"), CategoryWebService.class);
> >     }
> >  @WebEndpoint(name = "CategoryWebServiceImplPort")
> >     public CategoryWebService
> > getCategoryWebServiceImplPort(WebServiceFeature... features) {
> >         return super.getPort(new
> > QName("http://service.category.houseware.ix/",
> > "CategoryWebServiceImplPort"), CategoryWebService.class, features);
> >     }
> > }
> >
>
> Very appreciate for any further suggestion.
>
> Thanks
> Sam
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3807571.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi, after added my own service classes, I got the following error:


samwun9988 wrote:
> 
> ...
>         at
> org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
>         at $Proxy0.invoke(Unknown Source)
>         at
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
>         at
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
>         at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> Failed to create service.
>         at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:94)
>         at
> org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
>         at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
>         ... 35 more
> Caused by: javax.wsdl.WSDLException: WSDLException:
> faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF
> in prolog
>  at [row,col,system-id]:
> [1,0,"http://127.0.0.1:4204/CategoryManagerImpl?wsdl"]
>         at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:235)
>         at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
>         at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
>         ... 37 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col,system-id]:
> [1,0,"http://127.0.0.1:4204/CategoryManagerImpl?wsdl"]
>         at
> com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:682)
>         at
> com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2090)
>         at
> com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:1996)
>         at
> com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1100)
>         at
> org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1050)
>         at
> org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:947)
>         at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:874)
>         at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226)
>         ... 39 more
> 
> 

CalculatorTest.java:


> @WebServiceRef(
>             wsdlLocation =
> "http://127.0.0.1:4204/CategoryManagerImpl?wsdl"
>     )
>     private CategoryWebService categoryWs;
> 
>     //START SNIPPET: setup	
>     private InitialContext initialContext;
> public void testCategoryManagerViaRemoteInterface() throws Exception {
>         CategoryManagerLocal cat = (CategoryManagerLocal)
> initialContext.lookup("CategoryManagerImplLocal");
>         assertEquals(2, cat.add(1, 1));
>     }
> 

CategoryManagerLocal.java:



> package org.superbiz.calculator;
> 
> import ix.houseware.category.service.CategorySubcategories;
> import java.util.Collection;
> import javax.ejb.Local;
> 
> /**
>  *
>  * @author sam
>  */
> @Local
> public interface CategoryManagerLocal {
>     Collection<CategorySubcategories> findAll();
>     Collection<CategorySubcategories> find(final String name, final String
> desc);
>     int add(int a, int b);
> }
> 
> 

CategoryManagerImpl.java :



> @Stateless
> //@LocalBean
> public class CategoryManagerImpl implements CategoryManagerLocal {
> //    @WebServiceRef(wsdlLocation =
> "META-INF/wsdl/www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services.wsdl")
>     @WebServiceRef(wsdlLocation =
> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl")
>     private CategoryWebService_Service service; 
> @Override
>             public int add(int a, int b) {
>                 return a+b;
>     }
> }
> 

CategoryWebService_Service.java:



> @WebServiceClient(name = "CategoryWebService", targetNamespace =
> "http://service.category.houseware.ix/", wsdlLocation =
> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl")
> public class CategoryWebService_Service
>     extends Service
> {
>  static {
>         URL url = null;
>         try {
>             URL baseUrl;
>             baseUrl =
> ix.houseware.category.service.CategoryWebService_Service.class.getResource(".");
>             url = new URL(baseUrl,
> "http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl");
>         } catch (MalformedURLException e) {
>             logger.warning("Failed to create URL for the wsdl Location:
> 'http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl',
> retrying as a local file");
>             logger.warning(e.getMessage());
>         }
>         CATEGORYWEBSERVICE_WSDL_LOCATION = url;
>     }
> 
>     public CategoryWebService_Service(URL wsdlLocation, QName serviceName)
> {
>         super(wsdlLocation, serviceName);
>     }
> 
>     public CategoryWebService_Service() {
>         super(CATEGORYWEBSERVICE_WSDL_LOCATION, new
> QName("http://service.category.houseware.ix/", "CategoryWebService"));
>     }
> @WebEndpoint(name = "CategoryWebServiceImplPort")
>     public CategoryWebService getCategoryWebServiceImplPort() {
>         return super.getPort(new
> QName("http://service.category.houseware.ix/",
> "CategoryWebServiceImplPort"), CategoryWebService.class);
>     }
>  @WebEndpoint(name = "CategoryWebServiceImplPort")
>     public CategoryWebService
> getCategoryWebServiceImplPort(WebServiceFeature... features) {
>         return super.getPort(new
> QName("http://service.category.houseware.ix/",
> "CategoryWebServiceImplPort"), CategoryWebService.class, features);
>     }
> }
> 

Very appreciate for any further suggestion.

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3807571.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
I am wondering if I have the following web service:

Service cmService = Service.create(new
URL("http://www.ixsystems.com.au/category-ws-0.0.1-SNAPSHOT/services?wsdl"),
null);

What else I have to do so that I can use the following form of service:

Service calcService = Service.create(
                new URL("http://127.0.0.1:4204/CategoryManagerImpl?wsdl"),
                new QName("http://superbiz.org/wsdl", "CategoryWsService"));

What I mean is my web service is written in another project, and it is
located at www.ixsystems.com.au rather than localhost. How would openejb put
that service in localhost openejb server?

Thanks a lot
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3807089.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
It is empty.

- Romain

Le 12 sept. 2011 11:44, "samwun9988" <le...@gmail.com> a écrit :
> Hi, can you post your settings.xml file please?
> Thanks
> Sam
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3806900.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi, can you post your settings.xml file please?
Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3806900.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
ok  after changed the settings.xml to its original copy, it downloaded bsh
repo successfully and the test executed successfully.

I am going to figure out why my nexus failed with https repo.

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3806999.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i did nothing, just downloaded the zip example then installed java + maven 3
and finally run mvn clean install.

- Romain

2011/9/12 samwun9988 <le...@gmail.com>

> Hi,
>
> Do you mind post your bsh configure lines in your pom.xml ?
>
> Thanks
> Sam
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3806857.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi,

Do you mind post your bsh configure lines in your pom.xml ?

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3806857.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i just tried and it works:

Downloading:
> https://repository.jboss.org/nexus/content/groups/public-jboss/org/beanshell/bsh/2.0b5/bsh-2.0b5.jar
>

-------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running org.superbiz.calculator.CalculatorTest
> Apache OpenEJB 4.0.0-SNAPSHOT    build: 20110911-12:59
> http://openejb.apache.org/
> INFO - openejb.home = D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice
> INFO - openejb.base = D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice
> INFO - Configuring Service(id=Default Security Service,
> type=SecurityService, provider-id=Default Security Service)
> INFO - Configuring Service(id=Default Transaction Manager,
> type=TransactionManager, provider-id=Default Transaction Manager)
> INFO - Found EjbModule in classpath: D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice\target\classes
> INFO - Found EjbModule in classpath: D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice\target\test-classes
> INFO - Beginning load: D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice\target\classes
> INFO - Beginning load: D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice\target\test-classes
> INFO - Configuring enterprise application: D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice\classpath.ear
> INFO - Configuring Service(id=Default Stateless Container, type=Container,
> provider-id=Default Stateless Container)
> INFO - Auto-creating a container for bean CalculatorImpl:
> Container(type=STATELESS, id=Default Stateless Container)
> INFO - Enterprise application "D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice\classpath.ear" loaded.
> INFO - Assembling app: D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice\classpath.ear
> INFO - Jndi(name=CalculatorImplLocal) --> Ejb(deployment-id=CalculatorImpl)
> INFO -
> Jndi(name=global/classpath.ear/simple-webservice/CalculatorImpl!org.superbiz.calculator.CalculatorLocal)
> --> Ejb(deployment-id=CalculatorImpl)
> INFO - Jndi(name=global/classpath.ear/simple-webservice/CalculatorImpl) -->
> Ejb(deployment-id=CalculatorImpl)
> INFO - Created Ejb(deployment-id=CalculatorImpl, ejb-name=CalculatorImpl,
> container=Default Stateless Container)
> INFO - Started Ejb(deployment-id=CalculatorImpl, ejb-name=CalculatorImpl,
> container=Default Stateless Container)
> INFO - LocalClient(class=org.superbiz.calculator.CalculatorTest,
> module=test-classes)
> INFO - Deployed Application(path=D:\Documents and
> Settings\Romain\simple-webservice\simple-webservice\classpath.ear)
> INFO - Initializing network services
> INFO - Creating ServerService(id=httpejbd)
> INFO - Creating ServerService(id=cxf)
> INFO - Creating ServerService(id=admin)
> INFO - Creating ServerService(id=ejbd)
> INFO - Creating ServerService(id=ejbds)
> INFO - Initializing network services
>   ** Starting Services **
>   NAME                 IP              PORT
>   httpejbd             127.0.0.1       4204
>   admin thread         127.0.0.1       4200
>   ejbd                 127.0.0.1       4201
>   ejbd                 127.0.0.1       4203
> -------
> Ready!
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.906 sec
>
> Results :
>
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
>

Are you using maven 3.0.3 and a java 6 jdk?

- Romain

2011/9/11 samwun9988 <le...@gmail.com>

> it doesn't work with the following repo in pom.xml:
>
> <repository>
>        <id>bsh</id>
>        <url>https://svn.apache.org/repos/asf/servicemix/m2-repo</url>
>    </repository>
>
>
> the error is still the same:
>
>
> sam@sam-PC /cygdrive/c/work/test2/simple-webservice
> $ mvn  clean install
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building OpenEJB :: Examples :: Simple Webservice 1.1-SNAPSHOT
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 9.802s
> [INFO] Finished at: Sun Sep 11 23:34:00 EST 2011
> [INFO] Final Memory: 7M/87M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal on project simple-webservice: Could not
> resolve dependencies for project
> org.superbiz:simple-webservice:jar:1.1-SNAPSHOT: Failure to find
> org.beanshell:bsh:jar:2.0b5 in
> http://localhost:8081/nexus/content/groups/public was cached in the local
> repository, resolution will not be reattempted until the update interval of
> nexus has elapsed or updates are forced -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please
> read the following articles:
> [ERROR] [Help 1]
>
> http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
>
>
> Thanks
> Sam
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805133.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
it doesn't work with the following repo in pom.xml:

<repository>
        <id>bsh</id>
        <url>https://svn.apache.org/repos/asf/servicemix/m2-repo</url>
    </repository>


the error is still the same:


sam@sam-PC /cygdrive/c/work/test2/simple-webservice
$ mvn  clean install 
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO]
------------------------------------------------------------------------
[INFO] Building OpenEJB :: Examples :: Simple Webservice 1.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 9.802s
[INFO] Finished at: Sun Sep 11 23:34:00 EST 2011
[INFO] Final Memory: 7M/87M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal on project simple-webservice: Could not
resolve dependencies for project
org.superbiz:simple-webservice:jar:1.1-SNAPSHOT: Failure to find
org.beanshell:bsh:jar:2.0b5 in
http://localhost:8081/nexus/content/groups/public was cached in the local
repository, resolution will not be reattempted until the update interval of
nexus has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException


Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805133.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Normally simply add a repository block in THE repositories block.

Then maven will look at the good location to find the artifacts.

Run mvn clean install -e to have stacktrace.

- Romain

- Romain

Le 11 sept. 2011 15:23, "samwun9988" <le...@gmail.com> a écrit :
> not as proficient as you I think.
> How do you add bsh as repo in pom.xml?
>
> Thanks
> Sam
>
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805119.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
not as proficient as you I think. 
How do you add bsh as repo in pom.xml?

Thanks
Sam


--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805119.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi,

Where is bsh in the link below:

https://svn.apache.org/repos/asf/servicemix/m2-repo/org/apache/

I can't see bsh there.

Thanks
Sam


--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805101.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Copy paste your curreny pom please.

Do you know maven?

- Romai.

Le 11 sept. 2011 15:12, "samwun9988" <le...@gmail.com> a écrit :
> Hi,
>
> I tried the following repo, but it still generate the same error:
>
> <repository>
> <id>bsh</id>
> <url>https://svn.apache.org/repos/asf/servicemix/m2-repo/</url>
> </repository>
>
> What is the correct detail for adding "bsh" repo in pom.xml file?
>
> Thanks
> Sam
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805107.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi,

I tried the following repo, but it still generate the same error:

<repository>
        <id>bsh</id>
        <url>https://svn.apache.org/repos/asf/servicemix/m2-repo/</url>
</repository>

What is the correct detail for adding "bsh" repo in pom.xml file?

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805107.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
You need a block like this:

<repositories>
<repository>
<id>additionnal-repo </id>
<url>the url</url>
</repository>
</repositories>

Le 11 sept. 2011 14:55, "samwun9988" <le...@gmail.com> a écrit :
sorry I don't know how to add a bsh repo that relate to the respository  you
provided.

Here is what I tried to add to my pom.xml file:


<dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
<versi...
 </dependencies>

But it still failed with the same error.

Thanks
Sam


--
View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805085.html

Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
sorry I don't know how to add a bsh repo that relate to the respository  you
provided.

Here is what I tried to add to my pom.xml file:

<dependency>
      <groupId>org.beanshell</groupId>
      <artifactId>bsh</artifactId>
      <version>2.0b5</version>
    </dependency>
  </dependencies>

But it still failed with the same error.

Thanks
Sam


--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805085.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Add a maven repository in the pom.

- Romain

Le 11 sept. 2011 14:34, "samwun9988" <le...@gmail.com> a écrit :
> Where is the bsh repo in the url you provided? When I found it, do I need
to
> add it in pom.xml file as an dependency?
>
> Thanks
> Sam
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805069.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Where is the bsh repo in the url you provided? When I found it, do I need to
add it in pom.xml file as an dependency?

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805069.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
The bsh dep can be found here for example:
https://svn.apache.org/repos/asf/servicemix/m2-repo/

- Romain

Le 11 sept. 2011 13:11, "samwun9988" <le...@gmail.com> a écrit :
> The error interrupted the compilation process before generating the Target
> files.
>
> Thanks
> Sam
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805008.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
The error interrupted the compilation process before generating the Target
files.

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805008.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hmm,weird what do you have in target directory?

Le 11 sept. 2011 13:03, "samwun9988" <le...@gmail.com> a écrit :
> Hi, there is no Target/surefire* files
> How to get the surefile report generated?
>
> Thanks
> Sam
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805001.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi, there is no Target/surefire* files 
How to get the surefile report generated?

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3805001.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Target/surefire-reports

Le 11 sept. 2011 12:35, "samwun9988" <le...@gmail.com> a écrit :
> Hi,
>
> I am not sure were is surefire log.
> But I cat the error output as shown below:
>
>
>
> Thanks
> Sam
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3804979.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi,

I am not sure were is surefire log.
But I cat the error output as shown below:



Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3804979.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Can you cat the surefire report please?

Le 11 sept. 2011 12:05, "samwun9988" <le...@gmail.com> a écrit :
> Hi, I still cant' get the beanshell dependency resolved.
>
> Now I changed openejb-cxf to 3.1.4, and I get the error:
>
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running org.superbiz.calculator.CalculatorTest
> Apache OpenEJB 3.1.4 build: 20101112-03:32
> http://openejb.apache.org/
> INFO - openejb.home = C:\work\simple-webservice
> INFO - openejb.base = C:\work\simple-webservice
> INFO - Configuring Service(id=Default Security Service,
> type=SecurityService, provider-id=Default Security Service)
> INFO - Configuring Service(id=Default Transaction Manager,
> type=TransactionManager, provider-id=Default Transaction Manager)
> INFO - Found EjbModule in classpath:
> C:\work\simple-webservice\target\classes
> INFO - Beginning load: C:\work\simple-webservice\target\classes
> INFO - Configuring enterprise application: classpath.ear
> INFO - Configuring Service(id=Default Stateless Container, type=Container,
> provider-id=Default Stateless Container)
> INFO - Auto-creating a container for bean CalculatorImpl:
> Container(type=STATELESS, id=Default Stateless Container)
> INFO - Enterprise application "classpath.ear" loaded.
> INFO - Assembling app: classpath.ear
> INFO - Jndi(name=CalculatorImplLocal) -->
Ejb(deployment-id=CalculatorImpl)
> INFO - Created Ejb(deployment-id=CalculatorImpl, ejb-name=CalculatorImpl,
> container=Default Stateless Container)
> INFO - Deployed Application(path=classpath.ear)
> INFO - Initializing network services
> INFO - Creating ServerService(id=httpejbd)
> INFO - Creating ServerService(id=cxf)
> INFO - Creating ServerService(id=admin)
> INFO - Creating ServerService(id=ejbd)
> INFO - Creating ServerService(id=ejbds)
> INFO - Initializing network services
> ** Starting Services **
> NAME IP PORT
> httpejbd 127.0.0.1 4204
> 2011-9-11 20:02:33
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromClass
> �Ϣ: Creating Service {http://superbiz.org/wsdl}CalculatorWsService from
> class org.superbiz.calculator.CalculatorWs
> 2011-9-11 20:02:33 org.apache.cxf.endpoint.ServerImpl initDestination
> �Ϣ: Setting the server's publish address to be http://nopath:80
> admin thread 127.0.0.1 4200
> ejbd 127.0.0.1 4201
> ejbd 127.0.0.1 4203
> -------
> Ready!
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.811 sec
> <<< FAILURE!
>
> Results :
>
> Tests in error:
> testCalculatorViaWsInterface(org.superbiz.calculator.CalculatorTest):
> Could not find service named null in wsdl
> http://127.0.0.1:4204/CalculatorImpl?wsdl
>
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
>
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3804956.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi, I still cant' get the beanshell dependency resolved.

Now I changed openejb-cxf to 3.1.4, and I get the error:


-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.superbiz.calculator.CalculatorTest
Apache OpenEJB 3.1.4    build: 20101112-03:32
http://openejb.apache.org/
INFO - openejb.home = C:\work\simple-webservice
INFO - openejb.base = C:\work\simple-webservice
INFO - Configuring Service(id=Default Security Service,
type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager,
type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Found EjbModule in classpath:
C:\work\simple-webservice\target\classes
INFO - Beginning load: C:\work\simple-webservice\target\classes
INFO - Configuring enterprise application: classpath.ear
INFO - Configuring Service(id=Default Stateless Container, type=Container,
provider-id=Default Stateless Container)
INFO - Auto-creating a container for bean CalculatorImpl:
Container(type=STATELESS, id=Default Stateless Container)
INFO - Enterprise application "classpath.ear" loaded.
INFO - Assembling app: classpath.ear
INFO - Jndi(name=CalculatorImplLocal) --> Ejb(deployment-id=CalculatorImpl)
INFO - Created Ejb(deployment-id=CalculatorImpl, ejb-name=CalculatorImpl,
container=Default Stateless Container)
INFO - Deployed Application(path=classpath.ear)
INFO - Initializing network services
INFO - Creating ServerService(id=httpejbd)
INFO - Creating ServerService(id=cxf)
INFO - Creating ServerService(id=admin)
INFO - Creating ServerService(id=ejbd)
INFO - Creating ServerService(id=ejbds)
INFO - Initializing network services
  ** Starting Services **
  NAME                 IP              PORT  
  httpejbd             127.0.0.1       4204  
2011-9-11 20:02:33
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
�Ϣ: Creating Service {http://superbiz.org/wsdl}CalculatorWsService from
class org.superbiz.calculator.CalculatorWs
2011-9-11 20:02:33 org.apache.cxf.endpoint.ServerImpl initDestination
�Ϣ: Setting the server's publish address to be http://nopath:80
  admin thread         127.0.0.1       4200  
  ejbd                 127.0.0.1       4201  
  ejbd                 127.0.0.1       4203  
-------
Ready!
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.811 sec
<<< FAILURE!

Results :

Tests in error: 
  testCalculatorViaWsInterface(org.superbiz.calculator.CalculatorTest):
Could not find service named null in wsdl
http://127.0.0.1:4204/CalculatorImpl?wsdl

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0


--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3804956.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Thank you for the suggestion again.
I have executed the following steps:

Step 1.
mvn install:install-file -Dfile=c:\work\bsh-2.0b5.jar
-DgroupId=org.beanshell -DartifactId=bsh -Dversion=2.0b5 -Dpackaging=jar

Step 2
Added the following codes in pom.xml file:

<dependency>
      <groupId>org.beanshell</groupId>
      <artifactId>bsh</artifactId>
      <version>2.0b5</version>
    </dependency>

But it still failed withthe following error:


sam@sam-PC /cygdrive/c/work/test2/simple-webservice
$ mvn clean install
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO]
------------------------------------------------------------------------
[INFO] Building OpenEJB :: Examples :: Simple Webservice 1.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2.487s
[INFO] Finished at: Sun Sep 11 19:48:16 EST 2011
[INFO] Final Memory: 7M/88M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal on project simple-webservice: Could not
resolve dependencies for project
org.superbiz:simple-webservice:jar:1.1-SNAPSHOT: Failure to find
org.beanshell:bsh:jar:2.0b5 in
http://localhost:8081/nexus/content/groups/public was cached in the local
repository, resolution will not be reattempted until the update interval of
nexus has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3804937.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
It works on integration machine, i cant have a look why this dependency is
needed now but i think you can remove it or simply add a repo containing it.

- Romain

Le 11 sept. 2011 11:15, "samwun9988" <le...@gmail.com> a écrit :
> Hi, thank you for your suggestion,
>
> I just downloaded the latest code from here:
>
http://ci.apache.org/projects/openejb/examples-generated/simple-webservice/simple-webservice.zip
> zip file
>
> Now I got another error:
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3:52.017s
> [INFO] Finished at: Sun Sep 11 18:37:48 EST 2011
> [INFO] Final Memory: 6M/33M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal on project simple-webservice: Could not
> resolve dependencies for project
> org.superbiz:simple-webservice:jar:1.1-SNAPSHOT: Could not find artifact
> org.beanshell:bsh:jar:2.0b5
>
> Do you got this error when you execute the maven command "mvn clean
install"
> in your machine?
>
> Thanks
> Sam
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3804902.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by samwun9988 <le...@gmail.com>.
Hi, thank you for your suggestion,

I just downloaded the latest code from here:
http://ci.apache.org/projects/openejb/examples-generated/simple-webservice/simple-webservice.zip
zip file 

Now I got another error:

[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3:52.017s
[INFO] Finished at: Sun Sep 11 18:37:48 EST 2011
[INFO] Final Memory: 6M/33M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal on project simple-webservice: Could not
resolve dependencies for project
org.superbiz:simple-webservice:jar:1.1-SNAPSHOT: Could not find artifact
org.beanshell:bsh:jar:2.0b5

Do you got this error when you execute the maven command "mvn clean install"
in your machine?

Thanks
Sam

--
View this message in context: http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3804902.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Can't invoke web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

Which version?

Can you paste logs please?

For your info, last examples are here
ci.apache.org/projects/openejb/examples-generated/ or on svn.

Le 11 sept. 2011 06:04, "samwun9988" <le...@gmail.com> a écrit :
> Hi,
>
> I have downloaded a Calculator example from the following web page:
>
http://www.java2s.com/Code/Java/EJB3/webserviceandStatelesssessionbeanOpenEJB.htm
> Calculator OpenEJB Junit Test example
>
> There is an error when I execute it:
>
>
>
> Here is the junit code:
>
>
>
> I also attached a copy of the example here for reference.
>
> Any suggestion is very appreciated.
> Thanks
> Sam
> http://openejb.979440.n4.nabble.com/file/n3804670/simple-webservice.zip
> simple-webservice.zip
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/Can-t-invoke-web-service-tp3804670p3804670.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.