Rest client in PHP

hi does anyone tried to used a php rest client to access a web service in labview? if so how did work? tanks

Hi,
I don't understand what you want to do. REST is a server architecture, if you want to control you web service with php, you can do this:
http://zone.ni.com/reference/en-XX/help/371361E-01/lvdialog/routing_template_rws_page/
http://zone.ni.com/reference/en-XX/help/371361E-01/lvhowto/web_service_ex/
Regards,
Aurélien J.
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
>> Du 30 juin au 25 août, embarquez pour 2 mois de vidéo-t'chat ! Prenez place pour un voyage au coe...

Similar Messages

  • Error while running an Odata service in Advanced Rest Client

    Hi Experts,
    We have created one simple OData model (using Integration gateway) with datasource as SOAP web service. We are able to test the SOAP Web service in STORM tool and getting desired response. But when we run the converted OData URL in Advanced REST Client we are getting the following exceptions/errors.
    Could not send message
    Also, while looking at SMP3 server log, we came across below error logs:
    +0530#ERROR#com.sap.gateway.core.ip.odata.ODataErrorCallbackImpl##anonymous#http-bio-8080-exec-1###handleError(): failed to serve request for URI http://<ip>:8080/gateway/odata/sap/REL2;v=1/GetUserDets(Applid='****',Applpwd='****',Fund='***',Userid='****.***@gmail.com',Password='***@1234'), message = Could not instantiate data provider based on class null |
    +0530#ERROR#com.sap.gateway.core.ip.runtime.PathInfoExtractor##anonymous#http-bio-8080-exec-1###null java.lang.IllegalArgumentException: null
    Any help?
    Regards,
    JK

    Jitendra Kansal
    After updating my DB and do the ODATA service after completion of that hit the server in chrome it shows error like
    <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <code/> 
    <message xml:lang="en"> 
    Could not instantiate data provider based on class null
    </message>
    </error>
    expet that service i did another one it is working fine using the same server with out set the proxy

  • REST Client Proxy Question

    Objective: To call REST service from PB12.5.2 Classic application.
    Current implementation: Using MSXML and INET objects to call GET and POST methods.
    Problem: This implementation works fine until we have bulk calls (like 100K calls to the service in a single session). Sometimes it errors out because the XML sent to the service is 0 bytes (as seen on Fiddler)
    Better alternative: Can we create a new PB.NET PB assembly with a REST client proxy and call the proxy function from our PB classic application? Can we build DLL and reference it from our classic application?
    Is there any working example of the same?
    Bruce - I have seen your example in http://brucearmstrong.sys-con.com/node/2133766/mobile
    You talk about calling the WCF service from the classic application, have you tried the REST service call? I have followed the same steps you have mentioned and hit a roadblock when it came to the REGASM command, not sure which DLL to register now that I have 3 different DLLs. I have explained the steps I have taken in this document - http://www.pbgeeks.com/wp-content/uploads/pbnet.docx
    Thanks,
    Praveen

    You notes show:
    REST client assembly:          CalcPremrequest.dll
    Wrapper assembly:               restsvc_assembly.dll
    The wrapper assembly should already be strong named in the project.  The assembly that doesn't get strong named when PB generates it is the REST client assembly.  That's the one that you'll need to disassemble to IL and then recompile with a strong key name file in order to give it a strong name.  Your document shows you're doing that on the wrapper.
    Both assemblies need to be added to the GAC if that is where you are going to have them.
    You might start out without signing the REST client assembly, and just using the /codebase argument to REGASM to have it create registry entries that point to the local file location.  Once you have it working that way you can then deal with adding the assemblies to the GAC.
    The error you are getting may be a result of the wrapper assembly getting corrupted when you attempted to strong name it.

  • How to upload file from java client to php

    hi
    i am trying to upload/send a file from client using swing/applet
    and receiving it with php code.
    here is the php code which uploads the post file from the client
    $uploaddir = "/home/raghavendra/Documents/";
    $file = basename( $_FILES["uploadedfile"]["name"]);
    echo "file:\n".$file;
    $uploadfile = $uploaddir. $file;
    if (move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],$uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
    else {
    echo "File upload failure Possible file upload attack!\n";
    and corresponding different java code which post the
    1)
    public void postmethodTest(String filefrom){
    try{
    String hostname = "localhost";
    int port = 80;
    InetAddress addr = InetAddress.getByName(hostname);
    Socket socket = new Socket(addr, port);
    // Send header
    String path ="/php_prgs/var/www/nsboxng/htdocs/tryupdate.php";
    File theFile = new File(filefrom);
    System.out.println ("size: " + (int) theFile.length());
    DataInputStream fis = new DataInputStream(new BufferedInputStream(new FileInputStream(theFile)));
    byte[] theData = new byte[(int) theFile.length( )];
    fis.readFully(theData);
    fis.close();
    DataOutputStream raw = new DataOutputStream(socket.getOutputStream());
    Writer wr = new OutputStreamWriter(raw);
    String command =
    "POST "+path+" HTTP/1.0\r\n"
    + "Content-type: multipart/form-data, boundary=mango\r\n"
    + "Content-length: " + ((int) theFile.length()) + "\r\n"
    + "\r\n"
    + "--mango\r\n"
    + "content-disposition: name=\"MAX_FILE_SIZE\"\r\n"
    + "\r\n"
    + "\r\n--mango\r\n"
    + "content-disposition: attachment; name=\"datafile\"" ;
    String filename="test.doc\"\r\n"
    + "Content-Type: text/doc\r\n"
    + "Content-Transfer-Encoding: binary\r\n"
    + "\r\n";
    wr.write(command);
    wr.flush();
    raw.write(theData);
    raw.flush( );
    wr.write("\r\n--mango--\r\n");
    wr.flush( );
    BufferedReader rd = new BufferedReader(new
    InputStreamReader(socket.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
    System.out.println("out"+line);
    wr.close();
    raw.close();
    socket.close();
    } catch (Exception e) {System.out.println(e.toString());}
    2)
    public void postMethod(String strURL, String filefrom){
    try {
    String fname = filefrom.substring(filefrom.lastIndexOf("/")+1, filefrom.length());
    File input=new File(filefrom);
    // Prepare HTTP post
    PostMethod post = new PostMethod(strURL);
    // Request content will be retrieved directly
    // from the input stream
    // Per default, the request content needs to be buffered
    // in order to determine its length.
    // Request body buffering can be avoided when
    // content length is explicitly specified
    post.setRequestEntity(new InputStreamRequestEntity(new FileInputStream(input), input.length()));
    // Specify content type and encoding
    // If content encoding is not explicitly specified
    // ISO-8859-1 is assumed
    //post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");
    post.setRequestHeader("Content-Type","multipart/form-data");
    post.setRequestHeader("Content-Disposition", "form-data; name="+fname);
    // Get HTTP client
    HttpClient httpclient = new HttpClient();
    // Execute request
    try {
    int result=httpclient.executeMethod(post);
    // Display status code
    System.out.println("Response status code: " +result);
    // Display response
    System.out.println("Response body: ");
    // System.out.println(post.getResponseBodyAsString());
    BufferedReader console = new BufferedReader(new InputStreamReader(post.getResponseBodyAsStream()));
    String name = null;
    String line = null;
    try {
    while ((line = console.readLine()) != null) {
    System.out.println("output"+line);
    //name = console.readLine();
    catch (IOException e) { name = "<" + e + ">"; }
    // System.out.println("Hello " + name);
    } finally {
    // Release current connection to the connection pool
    // once you are done
    post.releaseConnection();
    catch(IOException e){
    but am getting else condition response from php code
    but if i post with html code it is working fine.
    can anybody help me please where i have to change the code
    please suggest me. am in a big trouble and i have to complete this as soon as possible

    One thread is enough.
    http://forum.java.sun.com/thread.jspa?threadID=5198449
    You could have bumped it instead. Also, you still just posted a junk of unformatted stuff. Furthermore, for HttpClient support ask at an HttpClient mailing list of rorum.

  • Best practice for JSON-REST client server programming

    I did use SOAP quiet a bit a while back but now on a new project I have to get a handle on JSON-REST communication.
    Basically I have the following resource on the server side
    import org.json.JSONObject;
    import org.restlet.resource.Get;
    import org.restlet.resource.ServerResource;
    * Resource which has only one representation.
    public class UserResource extends ServerResource
         User user1 = new User("userA", "secret1");
         User user2 = new User("userB", "secret2");
         User user3 = new User("userC", "secret3");
         @Get
         public String represent()
              return user1.toJSONobject().toString();
         public static class User
              private String name;
              private String pwd;
              public User( String name, String pwd )
                   this.name = name;
                   this.pwd = pwd;
              public JSONObject toJSONobject()
                   JSONObject jsonRepresentation = new JSONObject();
                   jsonRepresentation.put("name", name);
                   jsonRepresentation.put("pwd", pwd);
                   return jsonRepresentation;
    }and my mapping defined as
         <servlet>
              <servlet-name>RestletServlet</servlet-name>
              <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
              <init-param>
                   <param-name>org.restlet.application</param-name>
                   <param-value>firstSteps.FirstStepsApplication </param-value>
              </init-param>
         </servlet>
         <!-- Catch all requests -->
         <servlet-mapping>
              <servlet-name>RestletServlet</servlet-name>
              <url-pattern>/user</url-pattern>
         </servlet-mapping>and I have a test client as follows
              HttpClient httpclient = new DefaultHttpClient();
              try {
                   HttpGet httpget = new HttpGet("http://localhost:8888/user");
                   // System.out.println("executing request " + httpget.getURI());
                   // Create a response handler
                   ResponseHandler<String> responseHandler = new BasicResponseHandler();
                   String responseBody = httpclient.execute(httpget, responseHandler);
                   JSONObject obj = new JSONObject(responseBody);
                   String name = obj.getString("name");
                   String pwd = obj.getString("pwd");
                   UserResource.User user = new UserResource.User(name, pwd);
                   user.notify();
              }Everything works fine and I can retrieve my USer object on the client side.
    What I would like to know is
    Is this how the server side typically works, you need to implement a methot to convert your model class to a JSON object for sending to the client
    On the client side you need to implement code that knows how to build a User object from the received JSON object.
    Basically is there any frameworks available I could leverage to do this work?
    Also, what would I need to do on the server side to allow a client to request a specific user using a URL like localhost:8888/user/user1?
    I know a mapping like /user/* would direct the request to the correct Resource on the server side but how would I pass the "user1" parameter to the Resource?
    Thanks

    I did use SOAP quiet a bit a while back but now on a new project I have to get a handle on JSON-REST communication.
    Basically I have the following resource on the server side
    import org.json.JSONObject;
    import org.restlet.resource.Get;
    import org.restlet.resource.ServerResource;
    * Resource which has only one representation.
    public class UserResource extends ServerResource
         User user1 = new User("userA", "secret1");
         User user2 = new User("userB", "secret2");
         User user3 = new User("userC", "secret3");
         @Get
         public String represent()
              return user1.toJSONobject().toString();
         public static class User
              private String name;
              private String pwd;
              public User( String name, String pwd )
                   this.name = name;
                   this.pwd = pwd;
              public JSONObject toJSONobject()
                   JSONObject jsonRepresentation = new JSONObject();
                   jsonRepresentation.put("name", name);
                   jsonRepresentation.put("pwd", pwd);
                   return jsonRepresentation;
    }and my mapping defined as
         <servlet>
              <servlet-name>RestletServlet</servlet-name>
              <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
              <init-param>
                   <param-name>org.restlet.application</param-name>
                   <param-value>firstSteps.FirstStepsApplication </param-value>
              </init-param>
         </servlet>
         <!-- Catch all requests -->
         <servlet-mapping>
              <servlet-name>RestletServlet</servlet-name>
              <url-pattern>/user</url-pattern>
         </servlet-mapping>and I have a test client as follows
              HttpClient httpclient = new DefaultHttpClient();
              try {
                   HttpGet httpget = new HttpGet("http://localhost:8888/user");
                   // System.out.println("executing request " + httpget.getURI());
                   // Create a response handler
                   ResponseHandler<String> responseHandler = new BasicResponseHandler();
                   String responseBody = httpclient.execute(httpget, responseHandler);
                   JSONObject obj = new JSONObject(responseBody);
                   String name = obj.getString("name");
                   String pwd = obj.getString("pwd");
                   UserResource.User user = new UserResource.User(name, pwd);
                   user.notify();
              }Everything works fine and I can retrieve my USer object on the client side.
    What I would like to know is
    Is this how the server side typically works, you need to implement a methot to convert your model class to a JSON object for sending to the client
    On the client side you need to implement code that knows how to build a User object from the received JSON object.
    Basically is there any frameworks available I could leverage to do this work?
    Also, what would I need to do on the server side to allow a client to request a specific user using a URL like localhost:8888/user/user1?
    I know a mapping like /user/* would direct the request to the correct Resource on the server side but how would I pass the "user1" parameter to the Resource?
    Thanks

  • Different md5 in phpMyAdmin and in mySql client (and PHP)

    I have trouble with md5 function - mySql in command line and PHP returns one value, phpMyAdmin another. I have current packaged - PHP 5.2.9-3, mysql 5.1.34-1 and phpmyadmin  3.1.5-1. I searched web for possible reason, only one I found was different encoding, but I doubt that binary representation of string 'aaa' differ between any common encoding (at my machine 8859-1, 8859-2,utf-8). Please, could somebody post here result what is result at your system of
    SELECT MD5('aaa');
    from command line mysql client and from phpmyadmin ?
    Last edited by stabele (2009-05-23 18:58:56)

    they are identical for both:
    Variable_name Value
    character_set_client utf8
    character_set_connection utf8
    character_set_database latin1
    character_set_filesystem binary
    character_set_results utf8
    character_set_server latin1
    character_set_system utf8
    character_sets_dir /usr/share/mysql/charsets/

  • Instant Client and PHP

    I tried to compile php 4.3 against the instant client but the config test failed as it could not find a whole bunch of oracle directories which are in the normal client. I also tried the normal 10g client, but that did not work as it required Redhat 2.1 or 3.
    A workaround was to copy the Oracle 10g Client directories from a Redhat 2.1 system. This works for configure, but fails with :
    /usr/bin/ld: cannot find -lclntsh on a non Redhat 2.1 system.

    Re Instant Client SDK availability, see
    LINUX AND DBD-Oracle
    Re Client download, it is part of the Database product suite.
    Following the Database links until you get to the page offering the
    Enterprise, Standard, Client, Companion etc releases.
    It would help Oracle if you could post a comment on the Downloads
    forum (something I just discovered) at
    Downloads Issues about your
    experiences trying to find the software.
    -- CJ

  • Using a client login php to mysql in as2

    hi all mighty guru's i was wondering how i can set my flash
    site so i can use the php coding i create to sign people in to
    different pages due to their username. can anyone help the scrip is
    called login.php so if anyone can help that would be create the
    login bit looks like this
    www.tphotography.co.uk/clientproof.php

    use loadvars (lv) to call your php with two different send
    and receive lv instances. for debugging use the onData method of
    the receive lv and view the parameter value passed back to flash
    from your php. make sufficient use of the php echo function to
    debug the issue.

  • Is CF slated to catch up on PHP in next version?

    Looking at the difference between CF and PHP it seems that CF
    still has
    plenty of lessons to learn from the creators of PHP. PHP has
    many features
    and api's built right in that are either missing in CF or
    rather less
    powerful (drawing, file handling etc) - will CF future
    versions try and
    bridge this gap?
    I realise that CF has some things PHP does not (but can be
    found via third
    parties) but the pressure would have to be on them (Adobe) to
    make sure they
    offer all PHP has and then some, thats is if it hopes to
    compete.
    I am a bit concerned that the old "java can do it" excuse
    will induce
    laziness - I am sure people want a scripting language and its
    why they
    chose CF, not to have to learn a full blown OO language after
    having spent a
    small fortune to avoid having to do so!
    Is there any conscious goal on Adobe's part for CF to become
    better than
    PHP?

    >>The phrase "take it with a grain of
    salt" implies that a person should read the statments within
    this thread and
    weigh them against their own thoughts and experiences before
    coming to a
    conclusion, as opposed to taking them at face value.
    I think the phrase generally means "dont put much faith in
    what is being
    said" and is used in situations where you suspect the person
    is either lying
    or simply not correct. I have never heard it described as
    nicely as you put
    it ... weigh them against their own thoughts and experiences
    before coming
    to a conclusion" - but I see what you are sayinng
    >>My experience with CF seems to be in marked contrast
    to your experience
    >>with
    CF. So, who is a casual web surfer stumbling across this
    thread supposed to
    believe?
    The more common cases, or the cases applicable his/her
    environment. cfml is
    used relatively rarely, whereas the ms. java and php tools
    are used all over
    and are very pervasive. If one is solely looking to improve
    job
    oppurtunities, it may be safe to say in most cases that cfml
    is not the way
    to go unless you are likley to stumble upon a cf hotspot.
    >So, don't blame me for being pro-CF. The tool does what I
    need it
    > to do, is backed by a stable company
    Weird, this was one thing I was told was against it - that it
    was not backed
    by a stable company and that it was changing ownership every
    few years or
    so. Not sure ho wtrue this is, but it was certainly a concern
    raised by 2
    local developers. I also picked up on a vibe of
    uncertaintainty here in
    these threads.
    >Like I said, don't blame the tool. Blame the developer
    for either not
    >knowing
    how to USE the tool, or for choosing the wrong tool for their
    particular
    application.
    No, I think this is totally untrue in the general case. Each
    of these tools
    all do the same job, albeit with slightly different
    approaches. You would be
    hard pressed to find something one could magically do that
    the other
    couldn't. Developers don't really get too much choice in most
    cases, they
    use the languages that offer the jobs. I can totally agree
    with the other
    posters who point out that cf is probably overlooked by many
    developers who
    would love to have given it a chance but simply couldn't
    afford to.
    >>or for choosing the wrong tool for their particular
    application.
    You seem to see value in developers switching from langauge
    to another for
    each application they may need to do. This is not the
    reality. Possibly in
    the cfml world it is as cfml guys need to know another
    language to survive
    normally. But java AND .net, even php people can make a
    living off just the
    one.
    >Am I supposed to
    abandon it because it does not have very good drawing
    tools?!?!?! Or because
    it
    is not very popular in Austraila?
    No, it works for you. Makes no sense to abandon it. I just
    think its a tough
    sell given that anyone wanting to learn it may soon find out
    that they need
    to learn php or .net anyway, just to make a dollar. Kind of
    negates the
    "simplicity" angle thats marketed.
    "tclaremont" <[email protected]> wrote in
    message
    news:[email protected]...
    >I did not tell anyone who to listen to. The phrase "take
    it with a grain of
    > salt" implies that a person should read the statments
    within this thread
    > and
    > weigh them against their own thoughts and experiences
    before coming to a
    > conclusion, as opposed to taking them at face value.
    >
    > I have been using CF on a full time basis for over eight
    years. I have
    > been
    > gainfully employed as a full time web developer solving
    real world
    > business
    > problems for three different companies and several dozen
    clients on the
    > side.
    >
    > My experience with CF seems to be in marked contrast to
    your experience
    > with
    > CF.
    >
    > So, who is a casual web surfer stumbling across this
    thread supposed to
    > believe?
    >
    > As was expressed by another poster, the client
    oftentimes could not care
    > less
    > what tool you used to develop with. Someone with PHP
    skills can often come
    > up
    > with a solution more beneficial to the client with PHP
    than he can with
    > CF. The
    > CF expert is likely going to bring more bang for the
    buck with CF. Again,
    > the
    > client is paying for results. If you can do the job with
    one tool in a
    > more
    > cost effective manner than another tool, so be it.
    >
    > For the most part, we are all web developers here. Our
    objectives are
    > pretty
    > much the same. I, personally, have the skills and
    experience in CF that
    > allow
    > me to make my customers overwhelmingly content and keep
    a very healthy
    > income
    > for myself. So, don't blame me for being pro-CF. The
    tool does what I need
    > it
    > to do, is backed by a stable company, and has more than
    enough support and
    > resources to meet my needs. How can you argue with that?
    Am I supposed to
    > abandon it because it does not have very good drawing
    tools?!?!?! Or
    > because it
    > is not very popular in Austraila?
    >
    > The enlightening part, however, is that I am NOT
    anti-PHP or any other
    > language. This is not an "all or nothing" or a "pick one
    and forget the
    > rest"
    > type of argument. When the time comes that CF does not
    allow me to keep
    > customer satisfaction where it needs to be, I will
    investigate other
    > options.
    >
    > Like I said, don't blame the tool. Blame the developer
    for either not
    > knowing
    > how to USE the tool, or for choosing the wrong tool for
    their particular
    > application.
    >

  • TNS timed out error while testing REST service

    4.2
    11g
    Hi There,
    We had a new application which was to get and post data using REST API which connects to an internal server. This works fine when we use the Google Chrome Advance REST application through the browser, but get a TNS timed out when trying through Apex
    Even a simple sql in the SQL workarea in Apex throws the same error
    select utl_http.request( 'http://ourserver.com/api/subscriptions') test
    from dual;
    ORA-29273: HTTP request failed ORA-06512: at &quot;SYS.UTL_HTTP&quot;, line 1130 ORA-12535: TNS:operation timed out
    Any idea, what the issue could be?   Works fine from the browser though using a REST client
    Trying this for the first time.
    thanks,
    Ryan

    Hi Ryan,
    During your installation, did you follow the steps to enable Network Services, which is one of the requirements when using web services in APEX.  You'll find the necessary information in the installation guide.   Also in your utl_http.request call, have you tried specifying a proxy, if one is required?  You might also want to take a look at at apex_web_service API, specifically the make_rest_request function, which might be useful if you're looking to invoke a RESTful Service via PL/SQL in your application.
    Regards,
    Hilary

  • Error while bringing up ATG REST Webservice

    Hi,
    I am trying to bring a REST Webservice using ATG 9.3 version.I am getting the below errors in the startup of the instance.I have added "REST" module in the Manifest file and am able to see the entry " C:\ATG\ATG9.3\REST\config\config.jar" in CONFIGPATH(Please let me know if there are other ways to find if the service has come up properly).I am trying to connect to the server using JAVA based REST Client as given below.Also,i have placed the jar files in the CLASSPATH of the module.I am hoping that the webservice have not come up properly because of these startup errors.Please help me out to resolve this issue.
    STARTUP EXCEPTION SEEN IN SERVER
    ========================
    2012-06-25 06:20:36,815 INFO [STDOUT] Unable to create class atg.rest.servlet.HeadRestServlet for configuration /atg/dynamo/servlet/dafpipeline/HeadRestServlet java.lang.ClassNotFoundException: No ClassLoaders found for: atg.rest.servlet.HeadRestServlet
    2012-06-25 06:21:56,325 INFO [nucleusNamespace.atg.userprofiling.sso.PassportAuthorityService] Starting passport authority service
    2012-06-25 06:21:56,460 INFO [STDOUT] **** Error
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] Mon Jun 25 06:21:56 EDT 2012
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] 1340619716460
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] /
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] Unable to set configured property "/atg/dynamo/servlet/Initial.initialServices" atg.nucleus.ConfigurationException: Unable to resolve component /atg/dynamo/servlet/dafpipeline/HeadRestServlet
    2012-06-25 06:22:06,528 INFO [STDOUT] Unable to create class atg.rest.RestConfiguration for configuration /atg/rest/Configuration java.lang.ClassNotFoundException: No ClassLoaders found for: atg.rest.RestConfiguration
    2012-06-25 06:22:06,528 INFO [STDOUT] **** Error
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] Mon Jun 25 06:22:06 EDT 2012
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] 1340619726528
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] /
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] Unable to set configured property "/atg/rest/Initial.initialServices" atg.nucleus.ConfigurationException: Unable to resolve component /atg/rest/Configuration
    CLASSPATH ENTRY
    ============
    <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/atg-rest-1.0.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/commons-fileupload-1.2.1.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/commons-io-1.4.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/dom4j-1.6.1.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/log4j-1.2.15.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/client-lib/java/atg-rest-client-1.0.jar"/>
    REST CLIENT:
    ========
    import java.util.HashMap;
    import java.util.Map;
    import atg.rest.client.RestClientException;
    import atg.rest.client.RestComponentHelper;
    import atg.rest.client.RestResult;
    import atg.rest.client.RestSession;
    public class RestClient {
    RestSession mSession;
    protected void execute() throws RestClientException {
         System.out.println("inside execute");
         mSession = RestSession.createSession("localhost", 8080, "<USERNAME>", "<PASSWORD>");
         mSession.setUseHttpsForLogin(false);
         try {
         mSession.login();
         System.out.println("Login Successful");
         catch (Throwable t) {
         System.out.println(t);
         finally {
         try {
         mSession.logout();
         System.out.println("Logout Successful");
         catch (RestClientException e) {
         System.out.println(e);
    * @param args
    public static void main(String[] args) {
         System.out.println("inside main");
         // TODO Auto-generated method stub
         RestClient testATGRest = new RestClient();
         try {
         testATGRest.execute();
         catch (Throwable t) {
         System.out.println(t);
    REST CLIENT ERROR SEEN:
    =================
    atg.rest.client.RestClientException: java.io.IOException: Not Found http://localhost:8080/rest/bean/atg/userprofiling/ProfileServices/loginUser
    atg.rest.client.RestClientException: This session is not logged in and cannot be logged out

    I am trying to expose a method using REST Webservice and access the method using the browser.I have followed the steps specified in the thread:
    http://ecomwriter.com/2012/03/19/building-restful-web-services-using-atg/ .Have added a component called ProfileRESTWebservice and have defined a method “getLoginInfo” in the class file. The following entry is placed in the restSecurityConfiguration.xml
    <resource component="/atg/userprofiling/ProfileRESTWebservice" secure="true">
    <method name="getLoginInfo" secure="false"></method>
    </resource>
    But, I am receiving the following exception when trying to access the method using http://localhost:8080/rest/bean/atg/userprofiling/ProfileRESTWebservice/getLoginInfo
    10:07:33,147 ERROR [BeanServlet] Error code: 400
    atg.beans.PropertyNotFoundException: Can't find property named: getLoginInfo in class: com.vs.commerce.profile.ProfileRESTWebservice
    Can't find property named: getLoginInfo in class: com.vs.commerce.profile.ProfileRESTWebservice
    atg.rest.RestException: atg.beans.PropertyNotFoundException: Can't find property named: getLoginInfo in class: com.vs.commerce.profile.ProfileRESTWebservice
    at atg.rest.output.RestOutputCustomizerImpl.outputBeanProperty(RestOutputCustomizerImpl.java:616)
    at atg.rest.processor.BeanProcessor.doRESTGet(BeanProcessor.java:157)
    at atg.rest.servlet.RestPipelineServlet.serviceRESTRequest(RestPipelineServlet.java:394)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:237)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:298)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:241)
    Can you pl help me out on this?

  • Need help in creating SOA SUITE RESTFul Service.

    Hi All,
    I have a requirement to provide a restful service url to other party to post plain xml message.
    So i have configured HTTBinding as below
    Type : Service
    Operation Type : One Way
    OperationName : Send
    Verb : Post
    Payload type : xml
    its one way transaction, we dont need to send response back to other party.
    After my configuration, when i use the URL to post some xml message from REST client
    i get a error "<error>oracle.fabric.common.FabricException: Unable to find operation: unknown</error>" same error even in composite with no instace created
    and when i add a header property SOAPAction : Send then message goes through adapter and i see instances in composite.
    But unfortunatly the team whos posting messages to fusion were not able to add any property
    Is there any we can solve this with out Header Property added at client side.
    Or Do we have any other way to create a RESTFull service in soa suite(i guess OSB allows this.)
    Help appreciated
    im using soa suite 11g
    thanks in advance guys
    Regards
    Sujan.

    Amir
    You need to set the compatibility of the setup.exe file that was downloaded
    - right click setup.exe
    - click on properties
    - go to the compatibility tab, check the box that says 'run this program in compatibility mode for',
    - select 'Windows XP service pack 2' from the drop down list.
    - Click ok and try again
    It then runs it as if it was XP (v 5.2 )
    However there are a bunch of other tasks to do install on vista
    check
    'Start SOA Suite' fails after laptop restart.
    for details of other config..
    It would be interesting to see if you are successful as I currently cannot install it on my vista machine..
    Good luck
    Will

  • Inserting Metadata events in a live stream using non-flash client app

    Hi all,
    I wish to insert captions into a live flash video stream.
    I found an example here : http://www.adobe.com/devnet/flashmediaserver/articles/metadata_video_streaming_print.html
    but this example uses a Flash client app wich can invoke something like
    video_nc.call("sendDataEvent",null,inputfield_txt.text);
    How can do this without any Flash client/environment ? (I of course still use an FMS 3.5)
    I would like to use a python (or php...whatever) piece of code to extract caption from VBI in the incoming video stream and insert it in the flash stream.
    Any help / experience appreciated.
    Regards
    Michel

    Well, I'll ask it a different way :
    Is there any documentation on the protocol used between Flash client and FMSI so that I can  "fake" the flash client using php ?
    Is there a way to call sendDataEvent function on the FMSI NOT using a Flash client ?
    Thanks
    Regards

  • SOA Suite 11.1.1.4.0 - Unable to invoke REST service from BPEL

    Hi all,
    I am trying to invoke a REST service from BPEL.
    I am supposed to call the following REST URL:
    http://apolloiserdev.corp.webex.com/ExportComplianceWS/webresources/ECCheck/emailDomainCheck/[email protected]
    In order to achieve this:
    1. I created an empty composite
    2. Added a HTTP Binding as external reference
         2.1 In the HTTP Binding wizard, I copied the above URL in 'Endpoint'
         2.2 Operation Name --> request-response
         2.3 Verb --> GET
         2.4 Created XSD for Req and resp and added those in 'Messages'
    Now, when I deploy and test this process, I get the following error messages:
    Unable to access the following endpoint(s): REPLACE_WITH_ACTUAL_URL
    Unable to access the following endpoint(s): http://apolloiserdev.corp.webex.com/ExportComplianceWS/webresources/ECCheck/emailDomainCheck/[email protected]/ExportComplianceWS/webresources/ECCheck/emailDomainCheck/[email protected]
    However, when I open the same URL using my web browser or test it using Mozilla REST client, I get a success response.
    Am I missing out something in my BPEL process?
    Regards,
    Arindam

    Not sure if this helps. But for rest based services we need to create a WSDL which has http protocol and get/post method like below
    types>
    <message name="HttpPostParamIn">
    <part name="param1" type="xsd:string"/>
    <part name="param2" type="xsd:string"/>
    </message>
    <message name="HttpPostParamOut">
    <part name="Body" element="get:Request"/>
    </message>
    <portType name="HttpPostParamPortType">
    <operation name="PostData">
    <input message="tns:HttpPostParamIn"/>
    <output message="tns:HttpPostParamOut"/>
    </operation>
    </portType>
    <binding name="HttpPostParamBinding" type="tns:HttpPostParamPortType">
    <http:binding verb="POST"/>
    <operation name="PostData">
    <http:operation location="/EchoApp/echo"/>
    <input>
    <mime:content type="application/x-www-form-urlencoded"/>
    </input>
    <output>
    <mime:mimeXml part="Body"/>
    </output>
    </operation>
    </binding>
    <service name="PostParamService">
    <port name="HttpPostParamPort" binding="tns:HttpPostParamBinding">
    <http:address location="http://localhost:7001"/>
    </port>
    </service>
    <plnk:partnerLinkType name="PostParamService">
    <plnk:role name="PostParamServiceProvider">
    <plnk:portType name="tns:HttpPostParamPortType"/>
    </plnk:role>
    </plnk:partnerLinkType>
    definitions>
    And then use this wsdl to invoke it from BPEL.like any other wsdl using partner link.

  • Not able to print anything on ATG Rest webservices

    Hi..I am new to ATG Rest.. Just for the heads up, i followed following steps :-
    1 ) Added rest module to MANIFEST.MF
    2) Created a custom class which looks like this -
    package com.sgs.utils;
    import atg.nucleus.GenericService;
    public class SGSdummy extends GenericService {
      public void dummy() throws Exception {
        logDebug("sdbfhj");
    3) Mapped it to the property file -
    $class=com.sgs.utils.SGSdummy
    $scope=global
    loggingInfo=true
    4) Configured the security for above component in restSecurityConfiguration.xml
    <rest-security>
    <resource component="/atg/commerce/order/dummy" secure="false">
    <!--  <default-acl value="Profile$role$admin:read,write,execute"/> -->
      <method name="dummy" secure="false"/>
    </resource>
    </rest-security>
    I commented acl as i really didn't need it for a POC plus it was throwing 401 unauthorized.
    5) Now I am calling it from chrome's Advanced Rest Client. However, status is 200 OK but I am not able to print a logDebug or sysout in my SGSdummy class.
         When i check console, it says "Depth 0 is greater than maximum depth 0"
         I tried to change maxDepthAllowed in configuration.properties but in vain..I need help to proceed.

    Now I am trying to create a REST request using custom client. I believe it should be a POST request as I am trying to call a method. My custom client looks like this :-
    package atg.rest.client;
    import java.io.IOException;
    import java.util.HashMap;
    import java.util.Map;
    import atg.rest.client.RestClientException;
    import atg.rest.client.RestComponentHelper;
    import atg.rest.client.RestResult;
    import atg.rest.client.RestSession;
    public class RestDemoClient {
      /** The m username. */
      private String mUsername;
      /** The m password. */
      private String mPassword;
      /** The m host. */
      private String mHost;
      /** The m port. */
      private int mPort;
      /** The m session. */
      private RestSession mSession = null;
       * Instantiates a new method call by rest.
      public RestDemoClient() {
       * Execute.
       * @throws RestClientException the rest client exception
      private void execute() {
       mSession = RestSession
         .createSession(mHost, mPort, mUsername, mPassword);
       mSession.setUseHttpsForLogin(false);
       Map<String,Object> params = new HashMap<String,Object>();
       params.put("atg-rest-input", "json"); 
       RestResult result = null;
       try {
        result = RestComponentHelper.executeMethod("/atg/rest/SGSdummy", "addOrder", new
          Object[] {}, params, mSession);
       } catch (RestClientException e1) {
        System.out.println(e1);
       try {
        if (result != null && result.getResponseCode() == 200) {
         System.out.println("Executed Successfully.");
        } else {
         System.out
           .println("Error while execution : Error Code ["
             + result.getResponseCode()
             + "] and Message ["
             + result.getResponseMessage() + "]");
       } catch (IOException e) {
        System.out.println("Error while execution Successfully.");
       * @param args
      public static void main(String[] args) {
       RestDemoClient stepUtils = new RestDemoClient(); 
       stepUtils.mUsername = "admin";
       stepUtils.mPassword = "admin";
       stepUtils.mHost = "localhost";
       stepUtils.mPort = 8080; 
       stepUtils.execute();
    But everytime i execute this, I get following exception :-
    atg.rest.client.RestClientException: java.io.IOException: Unauthorized Server returned HTTP response code: 401 for URL: http://localhost:8080/rest/bean/atg/rest/SGSdummy/addOrder
    Exception in thread "main" java.lang.NullPointerException
      at atg.rest.client.RestDemoClient.execute(RestDemoClient.java:64)
      at atg.rest.client.RestDemoClient.main(RestDemoClient.java:82)
    I tried different set of credentials but nothing seems to work out for me.
    However it always works fine for GET requests. I am able to see status as 200 OK but it never hits my addOrder() method in SGSdummy class, hence I am not able to print sysout in that method. For status 200 OK GET requests, my logs say "[JSONOutputCustomizer] Depth 0 is greater than maximum depth 0. Outputting object of class java.lang.String as string rather than continuing to nest."
    Can you give me some pointers how to run it without any errors plus it should print a random sysout in my custom class. Thanks

Maybe you are looking for

  • Need to restrict Print out in back Ground Job

    Hi all, The T.Code COHVPI  will use for mass processing of Relealse process order. It the same time it will give print out for all process orders which are successfule change status to REALEASE status.Presently it is running forground Job , it is giv

  • Mac mini - install OS permanently.

    Dear support, Can you suggest how to mount OS onto Mac mini from bootable USB? Earlier I had linux installed on mac mini but now need Mac OS permanently. I can work on Mac If I use bootable USB with key combination but my concern is how to permanentl

  • Word count application

    Hi am attempting a previous exam question and would appreciate some advice: I have been given a class that has been partly implemented. The class called Document that determines how many words are in the document, and how many certain specified words

  • Raw files from Nikon d810 won't import

    I have LR 5.7 and  new Nikon d810. Every time I try to import raw files, it doesn't work. Just stalls, and sometimes even crashes. I've tried different memory cards, a card reader, and importing directly by connecting the camera itself. Please advise

  • Integrated Planning : URGENT

    Hello I am having some problem with my budgets for the 12th period. I have posted ques but nobody has replied to it. Can someone please give me their email id so that i can explain what the issue is. I would be really thankful to you. It has been 2 d