Not able to invoke ATG  Rest services

Hi,
I'm new ATG Rest service, To just create a dummy rest service I followed the below steps.
1. added REST module in MANIFEST.MF file
ATG-Required: DAS DPS DSS DCS B2CCommerce DAS REST
2. created restSecurityCnfiguration.xml under atg/rest/seurity and following is the content of this file
<programlisting>
     <rest-security>
          <default-acl value="Profile$login$admin:read,write,execute" />
          <resource component="/atg/service/TestComponent" secure="false"/>
     </rest-security>
</programlisting>
3. Created a TestComponent in my existing application and created a method testName
public class TestComponent {
     public String getTestName(){
          return "arvind";
4. Deployed my application on jboss.
Now I'm trying to invoke this from a java class
protected void execute() throws RestClientException {
          String mUsername = "admin";
          String mPassword = "admin";
          String mHost = "localhost";
          int mPort = 8080;
          RestSession mSession = null;
          RestResult result = null;
          mSession = RestSession.createSession(mHost, mPort, mUsername, mPassword);
          mSession.setUseHttpsForLogin(false);
          mSession.setUseInternalProfileForLogin(false);
          try {
               mSession.login();
               println("Login Successful");
               result = RestComponentHelper.executeMethod("/atg/service/TestComponent", "testName", new Object[] {}, null, mSession);
          catch (Throwable t) {
               println(t);
          } finally {
               try {
                    mSession.logout();
                    println("Logout Successful");
               } catch (RestClientException e) {
                    println(e);
----------------------------------------------------------------------out put ---------------------------------------------
Login Successful
atg.rest.client.RestClientException: java.io.IOException: Unauthorized Server returned HTTP response code: 401 for URL: http://localhost:8080/rest/bean/atg/service/TestComponent/testName
     at atg.rest.client.RestSession.createHttpRequest(RestSession.java:755)
     at atg.rest.client.RestComponentHelper.executeMethod(RestComponentHelper.java:252)
     at com.techm.restclient.RestClientSample.execute(RestClientSample.java:63)
     at com.techm.restclient.RestClientSample.main(RestClientSample.java:87)
Caused by: java.io.IOException: Unauthorized Server returned HTTP response code: 401 for URL: http://localhost:8080/rest/bean/atg/service/TestComponent/testName
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
     at atg.rest.client.RestSession.createHttpRequest(RestSession.java:745)
     ... 3 more
Logout Successful
Even if I provide any username and password, which don't even exist, it says login succussful but while invocation it fails. Please help me here,
What is default user I can use? or way to create new user ?
Thanks in Advance,
Arvind
Edited by: Arvind Pal on Oct 4, 2012 10:21 AM
Edited by: Arvind Pal on Oct 4, 2012 10:22 AM

I created a user through ACC, and made the following changes.
<programlisting>
     <rest-security>
          <default-acl value="Profile$login$arvind:read,write,execute" />
          <resource component="/atg/service/TestComponent" secure="false"/>
     </rest-security>
</programlisting>
and now I'm getting the loginStatus i.e userid of user "arvind".
But while executing the invocation of web service call I'm getting the same exception.
Do we need to give some permission somewhere for this user ? or I'm doing something wrong with restSecurityConfiguration.xml
Login status[390002]
Login Successful
atg.rest.client.RestClientException: java.io.IOException: Unauthorized Server returned HTTP response code: 401 for URL: http://localhost:8080/rest/bean/atg/service/TestComponent/getTestName
     at atg.rest.client.RestSession.createHttpRequest(RestSession.java:755)
     at atg.rest.client.RestSession.createHttpRequest(RestSession.java:722)
     at atg.rest.client.RestComponentHelper.getPropertyValue(RestComponentHelper.java:182)
     at com.techm.restclient.RestClientSample.execute(RestClientSample.java:98)
     at com.techm.restclient.RestClientSample.main(RestClientSample.java:128)
Caused by: java.io.IOException: Unauthorized Server returned HTTP response code: 401 for URL: http://localhost:8080/rest/bean/atg/service/TestComponent/getTestName
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
     at atg.rest.client.RestSession.createHttpRequest(RestSession.java:745)
     ... 4 more
Logout Successful
Edited by: Arvind Pal on Oct 4, 2012 12:36 PM

Similar Messages

  • + Symbol is not working on ATG Rest Service Request.

    When calling loginUser ATG Rest services and passing email id "[email protected]" in the request parameter but the server received the request without +symbol
    +symbol is getting replaced with the whitespace.
    Request Sent with email - "[email protected]"
    Reached in the server - "test [email protected]"
    Can anybody explain me why + symbol is getting replaced by white space ?

    Hi D.J,
    A '+ ' in the query string represent space ' '. If you want to use '+' in query string encode it before send it to server and decode again on server before using it or you can use another symbol instead of '+', if you don't have specific requirement to use '+' in query string.
    Hope this will help.
    Thanks,

  • Not able to deploy axis2 web service on oc4j 10g server

    Not able to deploy axis2 web service on oc4j 10g server, getting internal server every time I click on services link....
    Edited by: 974237 on Nov 30, 2012 4:17 AM

    Not able to deploy axis2 web service on oc4j 10g server, getting internal server every time I click on services link....
    Edited by: 974237 on Nov 30, 2012 4:17 AM

  • I bought new i phone 5 3 days back, after that asked for new update which is 6.1.4, after updating my iphone i am not able to use cellular data services. I called up data provider, they says its the problem with new software update. There is no option add

    I bought new i phone 5 3 days back, after that asked for new update which is 6.1.4, after updating my iphone i am not able to use cellular data services. I called up data provider, they says its the problem with new software update. There is no option add APN. Now when i switch to safari its showing you are not subscribed for cellular data. But I am able to use data on other phone.
    Will you please help me in this regard?
    Another issue, since i bought my new iphone there is dust inside back main camera.
    Your advises are highly appreciated.

    Hey Shaiju isac,
    I'd take a look at the following article, it'll guide you though steps to you troubleshoot cellular data issues on your iPhone:
    iPhone: Troubleshooting a cellular data connection
    http://support.apple.com/kb/ts3780
    Cheers,
    David

  • Not able to start isql*plus service

    hello,
    My problem is that I am not able to start isql*plus service,its continuosly showng "starting.." status but doesnt start.In the event viewer there is an error of isql*plus service which says
    The description for Event ID ( 11 ) in Source ( iSQL*Plus Application Server ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: 1056, An instance of the service is already running.
    Please help me resolving this problem
    The database is Oracle 10g r2 10.2.0.1.0.
    Thanx

    Ensure that your iSQL service is running..
    which OS you use?

  • Oracle Service Bus 10.3 - Invoke a REST service in split join flow

    Hi
    I am using WebLogic Workshop to design a split-join service that needs to call 2 services and combine their responses.
    Service A - WSDL based service
    Service B - REST service
    In the split join flow I am able to invoke Service A just fine. However I do not have a way to call Service B. When I open the invoke dialog it only list WSDL based services.
    Does this mean in a split join I can only invoke WSDL based services or is this a bug in Weblogic Workshop.
    I can get around this by creating a WSDL based proxy that calls the REST service but was hoping I do not have to go down this route.
    Any guidance is appreciated.
    Thanks,
    -Nilay

    I think that Split-Joins are implemented in BPEL. Just look at your .flow file and you will see all those BPEL directives. That's why you probably need your service to be described by WSDL, so you are probably on the right way.
    http://technology.amis.nl/blog/1273/invoking-http-services-from-oracle-bpel-pm-soa-enabling-php-servlets-rss

  • Not able to receive the web service response to java client - jax-rpc

    HI,
    Have a wsdl and created the java client using wscompile and got the set of files (Port, Binding, ServiceLocator, Service and all related java files).
    My java client sends the valid java request to the webserver and i could see the correct response coming back to my machine as the reply from the webserver.
    But i couldnt get the response printed using System.out.println in my java client when i invoke call.invoke() method with needed input parameters.
    Do i need to set any encoding or how do i get the response in the my java client which is returned from the webserver?

    The whole PL/SQL which fails in case it helps to solve the issue
    declare
    peticion VARCHAR2(32767);
    env VARCHAR2(32767);
    url varchar2(1000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    begin
    url:='http://<HOST>:7778';
    -- soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    -- <auth:BasicChallenge
    -- xmlns:auth="http://www.soap-authentication.org/2002/01/">
    -- <Realm>Oracle Calendar Web Services</Realm>
    -- </auth:BasicChallenge>
    peticion:='
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
    <auth:BasicAuth xmlns:auth="http://soap-authentication.org/2002/01/">
    <Name>sysadmin</Name>
    <Password>sysadmin1</Password>
    </auth:BasicAuth>
    </soap:Header>
    <soap:Body>
    <cwsl:Create xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/">
    <CmdId>Testoraptor Command 31</CmdId>
    <iCalendar>
    <vcalendar prodid="-//Oracle//Calendaring//Calendarlet//EN" version="2.0">
    <vevent>
    <class>PUBLIC</class>
    <description>a long description</description>
    <dtstart>20061003T090909</dtstart>
    <duration>60M</duration >
    <location>my location</location>
    <priority>2</priority>
    <summary>a title</summary>
    <uid>4567</uid>
    <x-oracle-eventtype>APPOINTMENT</x-oracle-eventtype>
    </vevent>
    </vcalendar>
    </iCalendar>
    </cwsl:Create>
    </soap:Body>
    </soap:Envelope>';
    http_req := utl_http.begin_request(url||'/ocws-bin/ocas.fcgi', 'POST','HTTP/1.0');
    utl_http.set_header(http_req, 'Content-Type', 'text/xml');
    utl_http.set_header(http_req, 'Content-Length', length(peticion));
    utl_http.set_header(http_req, 'SOAPAction', '"http://www.oracle.com/WebServices/Calendaring/1.0/Create"');
    utl_http.write_text(http_req, peticion);
    dbms_output.put_line (length(peticion));
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, env);
    utl_http.end_response(http_resp);
    end;
    We have tried many different XML structures but we are not able to create an appointment.

  • ATG Rest Services - capture IP of caller

    Is it possible to capture the IP address of who is calling a REST service?
    The reason I am asking is that we seem to be having a lot of the following errors in our log file:
    ERROR [RepositoryServlet??] Error code: 500 CONTAINER:atg.repository.RepositorySecurityException; SOURCE:atg.security.PermissionDeniedException: You do not have read access to the category item descriptor.
    null
    atg.rest.RestException??: CONTAINER:atg.repository.RepositorySecurityException; SOURCE:atg.security.PermissionDeniedException: You do not have read access to the category item des criptor.
    Now, We have a mobile site which makes use of the REST services and they are all set up with the correct login/security.
    What I am trying to determine is who else is making these REST calls - something internal - or some unkown entity outside the application. I figured that if I can capture the IP then that will narrow down things. If it is outside, then the system is operating as expected and the error is justified. But if it is internal then need to do a bit more digging of what the root cause is.
    thanks

    I added the following to my method:
                   if ("/rest".equalsIgnoreCase(pRequest.getContextPath()))
                        String clientAddressStr = pRequest.getHeader("x-forwarded-for");
                        if (StringUtils.isNotBlank(clientAddressStr))
                             //clientAddressStr will be of format: clientIp, Proxy1, Proxy2
                             String[] clientAddressArr = clientAddressStr.split(",");
                             if (isLoggingInfo())
                                  logInfo("service(DynamoHttpServletRequest, DynamoHttpServletResponse) - IP Address is:: " + clientAddressArr[0].trim()); //$NON-NLS-1$
    This does not work - the line
    String clientAddressStr = pRequest.getHeader("x-forwarded-for");
    always comes back as null.
    Any issue of just grabbing the remote addr from the request?

  • Not able to use Airtel121 selfcare service

    Hi,
    I m using airtel service. I m able to get messages from 121, I m able to send messages to my friends but I am not able to send messages on 121 which is selfcare service of Airtel. Whenever I try to send messages (Like DATA USE, CL or BP) on 121, I always get this error "Network out of order". I have made complaint about this on airtel customer care many times and they have escalated this issue many times but the issue is still same. I have talked to Appellate officer of airtel Delhi NCR Circle but according to him they are receiving message from my side whenever I try to use 121 selfcare service and airtel server also reply to me but I m not getting that on my mobile, instead I am getting error "Network out of order" in Red with "X" mark, he said he confirmed this with airtel technical team.
    What shud I do ? Please suggest.
    Thanx

    Works for me! I’m using Q5, I was unable to reply sms to selfcare 3636 Telkomsel (indonesia). I put 3636 on my contact, then delete all previous 3636 sms, then try to send sms to 3636 again (without restart). Thx.

  • Not able to start Saprouter from services.msc

    Hi,
    We have installed a saprouter into Windows 2003 Server. It is running fine. When we start the system then we need to manually start the saprouter by a batch file, so i am trying to register a service so that we need not to start the router manually.
    i have read the note 525751 and install a new service by this command
    ntscmgr install saprouter -b c:\saprouter\saprouter.exe -p "service -r -W 60000 -R c:\saprouter\saprouttab -K "p:CN=SAPROUTER, OU=0000835750, OU=SAProuter, O=SAP, C=DE""
    Service successfully created. I have followed the note and done everything as per the note, but when i try to start the service i am getting this error  couldnot start saprouter service on local computer, error 1067 process terminated unexpectedly
    When i checked the event log i found this message.
    RROR       Unable to load the GSS-API DLL
                 named "sncgss32.dll"
    TIME        Tue Oct 06 16:30:17 2009
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     5
    RC          -17
    MODULE      sncxxdl.c
    LINE        342
    DETAIL      SncPDLInit
    SYSTEM CALL LoadLibrary
    COUNTER     1
    I have checked some thread on related to issue but not able to solve the problem. Could you please assist what's wrong.
    Regards,
    Subhash

    >
    Tomas Gustafsson wrote:
    > I'm sorry to put a silly question here, but this message is a little bit hard to get the grip on:
    > Do you use the same user for both the command prompt and the service?
    Yes I understand it's frustrating now., and Yes i am using the same user srvsolmgr to run from Services.msc and from command prompt also.
    > Also
    > Can you please post the command which runs successfulll (from the command prompt)
    > and the complete command for the saprouter-service.
    C:\>cd saprouter
    C:\saprouter>saprouter -r -G log.txt -R C:\saprouter\saprouttab -S 3299 -K "p:CN
    =SAPROUTER, OU=0000835750, OU=SAProuter, O=SAP, C=DE"
    trcfile  dev_rout
    logfile  log.txt
    Connection test OK
    u Oct 08 16:03:56 2009
    SAP Network Interface Router, Version 37.11
    command line arg 0:     saprouter
    command line arg 1:     -r
    command line arg 2:     -G
    command line arg 3:     log.txt
    command line arg 4:     -R
    command line arg 5:     C:\saprouter\saprouttab
    command line arg 6:     -S
    command line arg 7:     3299
    command line arg 8:     -K
    command line arg 9:     p:CN=SAPROUTER, OU=0000835750, OU=SAProuter, O=SAP, C=DE
    SncInit(): Initializing Secure Network Communication (SNC)
          PC with Windows NT (mt,ascii,SAP_UC/size_t/void* = 8/32/32)
    SncInit(): Trying environment variable SNC_LIB as a
          gssapi library name: "C:\saprouter\sapcrypto.dll".
      File "C:\saprouter\sapcrypto.dll" dynamically loaded as GSS-API v2 library.
      The internal Adapter for the loaded GSS-API mechanism identifies as:
      Internal SNC-Adapter (Rev 1.0) to SECUDE 5/GSS-API v2
    main(): pid = 2776, ppid = 0, port = 3299, parent port = 0 (0 = parent is not a SAProuter)
    reading routtab: C:\saprouter\saprouttab
    Regards,
    Subhash

  • Not able to connect ot Blackberry services

    Hi ! when i try to create blackberry internet services account, i get following message : "Your account has been suspended. Please contact the system administrator."
    I am not able to get into EDGE network.
    please help 

    Confirm that it is unlocked:
    http://www.blackberryfaq.com/index.php/How_do_I_determine_if_my_BlackBerry_is_%22unlocked%22%3F
    http://www.blackberryfaq.com/index.php/Buying_a_BlackBerry_off_eBay
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • EHPI not able to start and stop services shadowsystem

    All,
    I am working on an installation of EHP4 but am running in the following issue:
    When I get to the phase SHDINST_OS the EHPI is not able to stop and start the service for the shadowsystem. The ehpi log gives:
    Phase SHDINST_OS:
    SAPehpi> Starting subprocess sapstartsrv.exe with id 7348 at 20100512081320
    Environment: JAVA_HOME=C:\Program Files\Java\jdk1.5.0_19
    Environment: PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    Environment: Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;F:\usr\sap\HRS\SYS\exe\uc\NTAMD64;F:\usr\sap\HRS\SYS\exe\nuc\NTAMD64
    Environment: auth_shadow_upgrade=0
    Environment: dbs_mss_schema=hrs
    Service not started.
    Process with ID 8132 terminated with status -1
    The EHPI gives:
    An error occurred during the installation of the
    SAP service SAPHRS_03:
    Possibly the password for user .\SAPServiceHRS entered in phase
    INITPUT was wrong. You can reset it by calling 'SAPehpi set stdpar'.
    Try to execute SAPSTARTSRV.EXE manually using the following syntax:
    G:\EHPI\abap\exe\sapstartsrv.exe -r
    -p G:\EHPI\abap\HRS\SYS\profile\START_DVEBMGS03_NLDBHRS01 -s HRS -n 03
    -U .\SAPServiceHRS -P <PASSWORD> -e NLDBHRS01\hrsadm
    and check if the service SAPHRS_03 can be stopped and restarted.
    When I follow up on the sapstartsrv first I can start/create it but that when I restart the EHPI it fails again on the same issue.
    Anybody any ideas?
    the passwords given in the EHPI are the ones of the SAPService user in the windows environment
    Chris

    Hi
    Have you tried below option as suggested in logs ?
    > Possibly the password for user .\SAPServiceHRS entered in phase
    > INITPUT was wrong. You can reset it by calling 'SAPehpi set stdpar'.
    > Try to execute SAPSTARTSRV.EXE manually using the following syntax:
    > G:\EHPI\abap\exe\sapstartsrv.exe -r
    > -p G:\EHPI\abap\HRS\SYS\profile\START_DVEBMGS03_NLDBHRS01 -s HRS -n 03
    > -U .\SAPServiceHRS -P <PASSWORD> -e NLDBHRS01\hrsadm
    > and check if the service SAPHRS_03 can be stopped and restarted.
    >
    Thanks
    Sunny

  • Not able to connect to Data service on Airtel

    Hi!
    I have a nokia Lumia 800 handset with airtel as service provider, I activated their GPRS data service (read edge) and I am not able to connect to internet, however earlier I had Vodafone and I never faced such issues with it, I have tried out every possible solution in book i.e.
    1. Set Apn to airtelgprs.com
    2. Using Nokia network setup app.
    3. restarting my phone several times .
    Nothing seem to work has anyone faced such issue if yes could you please help me.

    Have you contacted Airtel to make sure every thing is working and activated their end?

  • Not able to invoke business rules from BPM

    Hi,
    I have a simple business rule (Used Bank class in Alias and created a simple rule set) and able to invoke successfully from webdynpro application.
    But the problem comes when I try to run the same webdynpro application (as a part of BPM process) from UWL, it always throws ClassNotFoundException for Bank Class.
    The thing is that I'm able to run webdynpro application properly (and is doesnt  throw error) as standalone but when I run the same application from UWL (I have binded UI to BPM process), it throws class not found error.
    Thanks for your time and help.
    Best Regards,
    Shiva

    Hi Shiva,
    sorry to bother but how did you integrate the rule in the BPM? I'm trying to use a rule as automated activity but I'm unable to create the Webservice from the rule...
    kind regards,
    Matthias

  • DAC not able to connect to Informatica services

    Hi All,
    I have an issue in connecting DAC with Informatica. In this scenario Informatica Server and DAC server in installed in Linux machine and Informatica Client and DAC client in Windows. I have given all configurations required. But DAC not able to communicate with Informatica and throwing below error for Testing to connect with Informatica Repository
    Failure connecting to "INFORMATICA_REP_SERVER"!
    ANOMALY INFO::: Error while pinging informatica repository server
    MESSAGE:::/u01/oracle/DAC/log/pmrepConnect.log (No such file or directory)
    EXCEPTION CLASS::: java.io.FileNotFoundException
    java.io.FileInputStream.open(Native Method)
    java.io.FileInputStream.<init>(FileInputStream.java:106)
    java.io.FileInputStream.<init>(FileInputStream.java:66)
    com.siebel.etl.functional.ReadFileToBuffer.readFileToBuffer(ReadFileToBuffer.java:39)
    com.siebel.analytics.etl.infa.interaction.PmrepInvoker.pmrep(PmrepInvoker.java:100)
    com.siebel.etl.gui.data.StaticDatabaseCalls.testRepositoryServer(StaticDatabaseCalls.java:959)
    com.siebel.etl.gui.data.StaticDatabaseCalls.testInformaticaServer(StaticDatabaseCalls.java:890)
    com.siebel.etl.net.ExecutionPlan.getInformaticaStatus(ExecutionPlan.java:275)
    com.siebel.etl.net.ClientMessageDispatcher$WorkerThread.mBeanRequestInformaticaStatus(ClientMessageDispatcher.java:433)
    com.siebel.etl.net.ClientMessageDispatcher$WorkerThread.consoleMessage(ClientMessageDispatcher.java:224)
    com.siebel.etl.net.ClientMessageDispatcher$WorkerThread.run(ClientMessageDispatcher.java:144)
    For Integration services also showing as
    Failure connecting to "INFORMATICA_INT_SERVER"!
    I have set path variables and added "InformaticaPowercenterClient\Client\bin". Also copied pmcmd.exe from "Informatica\Server\bin". Here i would mention that i have installed Informatica Services in Windows and copied pmcmd.exe from there as mentioned in oracle documents. Now i am able to ping pmcmd as pmrep. Please suggest me if anyone having any solutions.
    Thanks
    BKS

    For Informatica, I believe you have to run the Linux installer on linux, not on Windows. There is a component for which you need to run the Windows installer and move the files to linux but the INFA server install itself much be run on Linux if you are using Linux as your INFA server.

Maybe you are looking for