Java Restful Web service client

Hello,
I need to know a piece of informations:-
requirement is - there will 2 applications, typically, 2 war files - 1 war will be Restful web service producer and 2nd war will be the consumer.
My producer is working fine, so how can I make consumer which will basically call the producer and get the data.
will it be like producer would be a typical jar(in my case war file) file base app which will connect o db and the service related task.
Let me know if there is any better desiging.
Regards,
R

Hello,
I need to know a piece of informations:-
requirement is - there will 2 applications, typically, 2 war files - 1 war will be Restful web service producer and 2nd war will be the consumer.
My producer is working fine, so how can I make consumer which will basically call the producer and get the data.
will it be like producer would be a typical jar(in my case war file) file base app which will connect o db and the service related task.
Let me know if there is any better desiging.
Regards,
R

Similar Messages

  • Java - rest web services question.

    Hi all,
    I am new to SOAP and Rest based web services.
    In my current standalone application, the request and response payload of a query are in the form of a xml document. This application needs to be accessed by several applications that are written in diffrent programming languages(.net, python etc).
    Thus I want my application to be exposed as a web service. Some web services need to be SOAP based and others need not be.
    I understand that I need to follow the below steps to make Rest based web service :
    1a) I would expose my application interface description and business methods as URIs in a html/xml document.
    1b) If client wants to retrieve data, how will he programatically access the associated URI and set the method parameters (if any)?
    Also how does he send the request back to my application and how will my application understand it?
    1d) Can the code to understand the client request be written in any programming language since Rest does not restrict usage of specific tools.
    1f) It looks like the key feature of Rest is to have URIs in the reponse payload xml.
    Is this always required? In other words, can the reponse xml be one long xml without URIs to the embedded resources?
    Please let me know if Java has any API/tutorials to support the above requirements.
    Your input is highly appreciated.
    Thanks in advance for your valuable time and interest.

    You will be interested in JSR 311 JAX-RS: The JavaTM API for RESTful Web Services. This JSR is in the very early stages. The SWDP (Sun Web Developers Pack) 1.0 contains a very preliminary implementation of RESTBeans which is the basis for this JSR. Download the SWDP and look at the docs/samples in the rest-impl directory. http://developers.sun.com/web/swdp/. Here is a link to some docs on the REST APIs http://developers.sun.com/docs/web/swdp/r1/rest-impl/docs/getting-started.html

  • 2 Java ME Web Service Errors of "Not Compliant with JSR-172"

    This happened when I use Microsoft's ASMX-based WSDL file on a Java ME WS client.
    Say I had a test.asmx WSDL. Then I use NetBeans, and I go to New > Java ME Web Service Client
    I tried to import from running web service, URL "http://www.testhost.com/wspackage/test.asmx?WSDL"
    and then the popup validation error told me "Reference in element is not supported by this version of stub compiler"
    also the X logo error told me "testasmx.wsdl is not compliant with Java ME Web Services specification (JSR-172)"
    I wondered what's going on? Is there any data types not supported by JSR-172? Which is it?
    When I "Validate XML" this ASMX file, it pops this:
    "Error: src-resolve: Cannot resolve the name 's:schema' to a(n) 'element declaration' component."
    The "types" section of my WSDL are like this:
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/MMWebServices/Coverage"
    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    targetNamespace="http://tempuri.org/MMWebServices/Coverage" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/MMWebServices/Coverage">
    <s:import namespace="http://www.w3.org/2001/XMLSchema" />
    <s:element name="ViewListDoctor">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="iUserId" type="s:int" />
    <s:element minOccurs="1" maxOccurs="1" name="iASchId" type="s:int" />
    <s:element minOccurs="0" maxOccurs="1" name="sSearchKeyword" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="dsView">
    <s:complexType>
    <s:sequence>
    <s:element ref="s:schema" /> // <<error occured on this line, and every time the ref="s:schema" shows up <<
    Anyone have experienced this?

    Yes, thx u. I didn't realized I was posting on the wrong section (Enterprise) so I posted again to the J2ME/MIDP section since it was all about mobility. Please delete the first post.

  • How to debug sercued web service client ?

    I ususally use TCPMon or Jdeveloper Http analyzer to debug non-secured Java SE web service client application . however, how do I debug secured web service client, e.g. web service with OWSM policy enable service?
    I tried and got bad certificate error since the TCPMon or Jdeveloper Http analyzer act as proxy.
    BTW, I'm not able to install any such proxy on server side.
    Thanks

    Hi,
      As far as i know. the only way to debug a webservice is from SE80.
    open your webservice from se80,
    Give your REQUEST as an XML file,(put a break point in side ur web-class)and analyis ur RESPONSE.
    you are using RFC but it seams that problem is not in that function module else you can use SRDEBUG tcode to debug remote enabled function module.
    If you are getting error in CALL TRANSFORMATION.
    The only posibility is the data u r passing it for converting it in XML.
    just post your code with CALL TRANSFORMATION or the point which is going into dump....
    Regards,
    Raj

  • URGENT: Rest web service with get method works fine in browser but not with java client(Android)

    Hi ,
    I have created one REST web service which accepts two parameters send back JSON results.
    I tested the it in browser with URL as http://+Inteernal server+/ords/utimes/login_info?p1=+first_param+&p2=+second_para+
    Web service URL :  http://+Inteernal server+/ords/utimes/login_info?p1={p1}&p2={p2}
    But when java team wants to access it from java code it gives error as "400- Bad Request".
    one more IMP thing : when I test it in RESTful web service by using "set bind variable" , it only set value of first parameter.
    APEX version : 4.2
    Database : 11g (XE)
    ords : 2.0.8
    please help me ASAP.
    regards,
    Nagesh Patil

    Hi Pragya,
    thank you for the update.
    Another question: could you please give us any reference about these corrections you told about? Maybe they could be relevant in our case too.
    Our raised incident number is: 3100851983
    Kind regards,
    Davide

  • Thin-client uses a RESTful Web Service

    Hello everyone!
    Once I've develop a few web services, it's time to "consume" them. I'm trying to develop a thin-client in JAVA (with the netbeans ide) but I haven't found the best way to do it.
    So, which is the best way to create a LabVIEW RESTful webservice?
    Obviously, JAVA is an option, how about create a client with another VI?
    Greetings!
    Francisco José Gómez López
    Software Engineer

    1) Are you trying to create a RESTful web service in LabVIEW?
    or
    2) Are you wondering about creating a thin client to consume the web service?
    A1) Web Services in LabVIEW
    A2) LabVIEW WebUI Builder  You can create a VI to act as a client for your web services, but not a thin client (i.e. running in the browser)
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • Java.lang.OutOfMemoryError in a web service client

    Please...
    I'm doing a web service client.
    To access to the webservice I have to enter a date
    I'm using Axis api to connect to the webservice
    everything its ok until in some day an exception appears
    Exception in thread "main" AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
    faultSubcode:
    faultString: [java.lang.OutOfMemoryError]
    faultActor: /apiws/Manifiesto
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}stackTrace: [java.lang.OutOfMemoryError]
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
         at javax.xml.parsers.SAXParser.parse(Unknown Source)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:2443)
         at org.apache.axis.client.Call.invoke(Call.java:2366)
         at org.apache.axis.client.Call.invoke(Call.java:1812)
         at MANIF.QueryManif_wsdl.QueryManifBindingStub.consultaManif(QueryManifBindingStub.java:218)
         at prueba.main(prueba.java:75)
         {http://xml.apache.org/axis/}hostname:Martin-ciappe
    [java.lang.OutOfMemoryError]
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
         at javax.xml.parsers.SAXParser.parse(Unknown Source)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:2443)
         at org.apache.axis.client.Call.invoke(Call.java:2366)
         at org.apache.axis.client.Call.invoke(Call.java:1812)
         at MANIF.QueryManif_wsdl.QueryManifBindingStub.consultaManif(QueryManifBindingStub.java:218)
         at prueba.main(prueba.java:75)
    I already change the virtual machine memory with -Xms256m -Xmx1200m
    And I tried everything... so please if you know the answer to my problem please answer me
    Thanks a lot
    Edited by: elchape on Jun 18, 2008 1:22 PM

    can't anybody help me?

  • Processing ABAP Idocs in SAP Java AS CE 7.1 web service client applicatin

    I am trying to build a Java web service client which would call a web service in a non-SAP system.  I am trying to send  Idocs from the back-end CRM system to my Java web service client using a Jco RFC Provider.  I have already created the RFC Destination on the ABAP side to send my Idocs to my Jco RFC Provider program on the Java side.  The connections between the ABAP and Java are working fine.  My question is how in my Java web service client do I pick up the IDoc sent from ABAP to the Jco RFC Provider? 
    Please let me know if more clearification is needed

    I do receive the IDoc with the SAP Java AS "RFC Jco Provider" component I created, and in my Java application I created a class for "IDOC_INBOUND_ASYNCHRONOUSBean" which has a method "processFunction(Function function)" and in that method I can do function.write("filename.xml") and it writes out an xml document of the Idoc sent from the ABAP server.  I can further process the Idoc by pulling field values from the xml structure.  However, my problem is I am now trying to write a second Java application to do the same thing but with a different Idoc type.  I created a a second RFC Jco provider(listener) on the server but the Idocs still flow through the first Java application, which is an undesirable affect.  I got this idea from this document originally "http://nwadave.com/NwadExplorer/data/SAPDoc/ProcessingIDocsWithTheSAPJavaConnector.doc", and it works fine until now when I'm trying to add a second application to do similar work.  This is makeing me wonder if I should have even done the first one this way?  Bottomline is what tell the RFC Jco provider(listener) on the Java server which application to send the Idocs too?

  • 2-java clients communicate with java based web-service

    I'm new 2 web-services.
    I need to create 2-java clients(a game like chess) & communicate them through a java based web-service.
    I can create the web service.(using Netbeans getting started tutorial.only the basic stuff)
    when we create the 2-clients are those should be web-clients or are they should be normal java
    applications.
    (clients should be GUI based)
    ??

    I'm new 2 web-services.
    I need to create 2-java clients(a game like chess) & communicate them through a java based web-service.
    I can create the web service.(using Netbeans getting started tutorial.only the basic stuff)
    when we create the 2-clients are those should be web-clients or are they should be normal java
    applications.
    (clients should be GUI based)
    ??

  • Get the client (caller) IP in a RESTFul web service resource

    Hello,
    How i can get the client (caller) IP inside a RESTFul web service resource?
    Something like for SOAP Web Services
              MessageContext msgCtxt = wsCtxt.getMessageContext();
              HttpServletRequest req = (HttpServletRequest) msgCtxt.get(MessageContext.SERVLET_REQUEST);
              String clientIP = req.getRemoteAddr();
    Thank You

    1) Are you trying to create a RESTful web service in LabVIEW?
    or
    2) Are you wondering about creating a thin client to consume the web service?
    A1) Web Services in LabVIEW
    A2) LabVIEW WebUI Builder  You can create a VI to act as a client for your web services, but not a thin client (i.e. running in the browser)
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • RESTFUL Web Services vs Socket Programming Performance

    Hi guys,
    I will have an application which will have a service serving about to 30 million users/day and a mean of 5 requests/user.
    It means that there will be about 150 million requests per day. I will have two servers behind a load balancer and my clients will be both Java and C++.
    I think to implement RESTFUL Web Services but afraid of performance issues.
    Did you have a knowledge about the performances of web service and socket programming in such a high loaded project?
    Tnx.
    Ayberk

    ayberkcansever wrote:
    Hi guys,
    I will have an application which will have a service serving about to 30 million users/day and a mean of 5 requests/user.
    It means that there will be about 150 million requests per day. I will have two servers behind a load balancer and my clients will be both Java and C++.
    I think to implement RESTFUL Web Services but afraid of performance issues.
    Did you have a knowledge about the performances of web service and socket programming in such a high loaded project?It depends on the CPUs, RAM, disks, and network configurations of those servers.
    It depends on how the requests are distributed throughout the day.
    It depends on how big the requests are and how big the responses are.

  • Is it possible to invoke external REST web service hosted in WebLogic web application from an Adobe LiveCycle Process (ES-4)

    Is it possible to invoke an external REST web-service hosted in WebLogic web application from an Adobe LiveCycle Process (ES-4) with parameters as input and manipulating the response depending on the type of parameters it gets back. Then invoking an Adobe Form and prepopulating the Form based on the response parameters? Do you have sample projects that do this invocation. The part highlighted in red is what I need examples.

    You can simply use "Execute Script" operation in Workbench and make use of java.net.URL. Below links should help :
    http://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/
    http://www.adobe.com/devnet/livecycle/articles/building-xml.html
    http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.htm?content=000581.html
    Hope this helps.
    -Wasil

  • Consume Restful Web Services

    Hi,
    I have experience consuming Soap Web Services using utl_dbws.
    Our client provides various rest web services that we need to access within the database.
    We wan't a pure pl/sql solution without any additional java components.
    Does anyone have any information on how to consume REST web services?
    Thanks

    Check out APEX_WEB_SERVICE.
    Ta,
    Trent

  • RESTFUL Web Services and Classic Reports....

    NEVERMIND...... Setting in our instance was NOT enabled...
    Thank you,
    Tony Miller
    Ruckersville, VA

    ayberkcansever wrote:
    Hi guys,
    I will have an application which will have a service serving about to 30 million users/day and a mean of 5 requests/user.
    It means that there will be about 150 million requests per day. I will have two servers behind a load balancer and my clients will be both Java and C++.
    I think to implement RESTFUL Web Services but afraid of performance issues.
    Did you have a knowledge about the performances of web service and socket programming in such a high loaded project?It depends on the CPUs, RAM, disks, and network configurations of those servers.
    It depends on how the requests are distributed throughout the day.
    It depends on how big the requests are and how big the responses are.

  • Need to auto-generate SDK for REST web service.

    My company has developed a REST API for some web services, and we'd like to provide users with a Java SDK for consuming those services.
    Our services are described by an XSD schema. On the backend, we are using JAXB to create Java classes corresponding to the schema. We create the request objects based on the parameters in the REST url, and JAXB converts our response objects from Java to XML.
    We'd like to provide our users with similar Java classes on the client side. They should be able to create the object corresponding to the request, fill in various parameters, and submit it to our web service. The SDK should automatically convert the object into a REST URL, hit the URL with a Get, read the XML response, and convert that response into Java objects.
    It seems like we should be able to auto-generate such an SDK based on our schema.
    It seems like there are several tools for doing this for SOAP web services. For example, Apache Axis has Java2WSDL and WSDL2Java.
    Can anyone recommend tools for creating client-side libraries for consuming RESTful web services? Does anyone have advice on products to avoid?

    Replying to my own post here. The WADL2Java project on java.dev seems to be more like what I need. The only user-experience I've seen on the 'net is in this forum post:
    http://forum.java.sun.com/thread.jspa?threadID=5239123&tstart=0
    Anyone else used it?

Maybe you are looking for

  • How to change the value in a matrix...

    Hi, I want to update the price field in the Sales Order matrix. This I want to do as soon as the user selects the Item from the choose window. I trapped the ItemEvent of the SAPSBOUIApplication. But after getting the control of the matrix I am unable

  • Streaming photos from main itunes library (syncing library)

    I have synced my AppleTV (40G) with my main computer and iTunes library - this works fine. But since my iTunes & Photo libraries are larger than the space on my AppleTV I wanted to stream the rest of the content including photos from this same comput

  • Parameter in the select

    hi, SELECT hp.party_name CustomerName,   csi.incident_number SRNumber,   csi.incident_date SRDate,   csi.close_date SRCloseDate,   mtl.concatenated_segments SRItemName,   csi.summary Summary,   csi.problem_code,   csi.incident_address SRAddress,   cs

  • How can I purchase Creative Cloud in the United Kingdom?

    Adobe US site will not allow purchase of Photoshop CC on UK site. Comes to loading bank details assumes US based!..

  • Fan keeps running

    Last night before bed I started to do the software update on my MacBook Pro. Now the fan is constantly running,the screen does not work, and I can't turn it off. Help!