2015-05-07 10:40 GMT+02:00 mauro2java2011 <[email protected]>:
> i have used the following url into the client inside the @Scheduled method > annotated . > > http://maurotomee17-mauro.rhcloud.com/openshiftScheduler/rest-prefix/pojo > > > http://maurotomee17-mauro.rhcloud.com/openshiftScheduler/rest-prefix/ejb > > i think so that is like the ip external and not internal. > > . > A last ask on client of REST. > > I have successfull added my websersive rest on services panel of netbenas. > Newxt i have created with netbeans a java client standalone for the > resources. > > the client it is : > ---------------------------------------------- > > package mauro.myapplication; > > import javax.ws.rs.ClientErrorException; > import javax.ws.rs.client.Client; > import javax.ws.rs.client.WebTarget; > > /** > * > * @author utente_javaee7 > */ > public class MyClient { > > static class ClientEjb { > > private WebTarget webTarget; > private Client client; > private static final String BASE_URI = > "http://maurotomee17-mauro.rhcloud.com/openshiftScheduler/rest-prefix/"; > > public ClientEjb() { > client = javax.ws.rs.client.ClientBuilder.newClient(); > webTarget = client.target(BASE_URI).path("ejb"); > } > > /** > * @param responseType Class representing the response > * @return response object (instance of responseType class) > */ > public <T> T get_application_octet_stream(Class<T> responseType) > throws ClientErrorException { > return webTarget.request().get(responseType); > } > > public void close() { > client.close(); > } > } > > static class ClientPojo { > > private WebTarget webTarget; > private Client client; > private static final String BASE_URI = > "http://maurotomee17-mauro.rhcloud.com/openshiftScheduler/rest-prefix/"; > > public ClientPojo() { > client = javax.ws.rs.client.ClientBuilder.newClient(); > webTarget = client.target(BASE_URI).path("pojo"); > } > > /** > * @param responseType Class representing the response > * @return response object (instance of responseType class) > */ > public <T> T get_application_octet_stream(Class<T> responseType) > throws ClientErrorException { > return webTarget.request().get(responseType); > } > > public void close() { > client.close(); > } > } > > public static void main(String[] arg) { > String resultfromejb; > String resultfrompojo; > > ClientPojo cpojo = new ClientPojo(); > resultfrompojo = (String) > cpojo.get_application_octet_stream(String.class); > System.out.println(".......\n"); > System.out.println("Result from call to pojo\n"); > System.out.println(resultfrompojo); > > System.out.println(".......\n"); > cpojo.close(); > > System.out.println(".......\n"); > System.out.println("Result from call to pojo\n"); > ClientEjb cejb = new ClientEjb(); > resultfromejb = (String) > cejb.get_application_octet_stream(String.class); > System.out.println(resultfromejb); > cejb.close(); > > } > } > ------------------------------- > > netbeans when from wizard create the client for the resources it import the > jersey librarìes into java project . > > For my simple java client of rest it work!!!!!!!!! > > So i ask: > > 1) > if i create with jersey libvrary a client for a rest web services deployed > on tomee (cxf implementation of rest) , it work also for big applications > or > can create problems use a client create with jersey and the side server > with > cxf implementation of rest? > > the issue is on the API not the implementation but the effect are the same. If possible I would avoid. > 2) if i would use only cxf library for the client , what jars i have to > import into the java client project ? > > For TomEE 1 using jaxrs 2 client is quite hard and fragile. TomEE 2 will have it built in (available on snapshots). > tank you very much . > Mauro > > > > > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/how-get-the-url-for-a-wadl-of-a-REST-web-service-tp4674662p4674674.html > Sent from the TomEE Users mailing list archive at Nabble.com. >
