Using the UWL API inside a Web Service

I wrote a Web Service to get the number of new tasks and the total number of tasks for a user like it is displayed in the UWL in the DefaultView.
The numbers are retrieved by the following code:
user = com.sap.security.api.UMFactory.getAuthenticator().getLoggedInUser();
// JNDI lookup for getting the service because we are not in the PRT container
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sapportals.portal.prt.registry.PortalRegistryFactory");
InitialContext initialContext = new InitialContext(env);
uwlService = (IUWLService) initialContext.lookup("/broker/services/" + IUWLService.ALIAS_KEY);
if (uwlService == null) {
     throw new Exception("Cannot get UWL Service");
context = new UWLContext();
if (user == null) {
     throw new Exception("No user");
context.setUser(user);
context.setLocale(user.getLocale());
session = uwlService.beginSession(context, 200);
context.setSession(session);
context.setAllowBackEndConnections(true);
itemManager = uwlService.getItemManager(context);
UWLView view = uwlService.getViewManager(context).getView("DefaultView", context);
if (view != null) {
     QueryProperties properties = new QueryProperties();
     properties.setMaxNumberOfItemsToFetch(0);
     QueryResult result = itemManager.getItemsForView(context, view, properties, null);
     totals = itemManager.getTotalAndEmphasizedItemCountForView(context, view, "", null);
In the first step I chose basic authentication. When debugging I see that the web service gets the information about the logged on user. The UWLService, item manager, session and view, all of them are determined resp. created.
But when calling getItems the UWL exception "Logged in users context or session doesn't exist" is thrown.
When calling the same functionality from Web Dynpro everything works fine.
Service and session are determined like this
uwlService = (IUWLService) WDPortalUtils.getServiceReference(IUWLService.ALIAS_KEY);
context = new UWLContext();
IUser user = WDClientUser.getLoggedInClientUser().getSAPUser();
wdContext.currentUIStateElement().setUserName(user.getFirstName() + " " + user.getLastName());
context.setUser(user);
context.setLocale(WDResourceHandler.getCurrentSessionLocale());
session = uwlService.getUwlSessionForWebDynproClient(context);
Does anyone know how to work with the UWL API in a web service context?
Thanks in advance
Antje

Hi Experts,
We are also facing the same issue as of Yomesh.
The strange part here is that, yesterday, the code was fetching the User and we were able to run the whole web service.
Suddenly, this doesnt seems to be working today. And after debugging, we found that, the User is not being returned with the below code:
user = UMFactory.getAuthenticator().getLoggedInUser(wsContext.getHttpServletRequest(), null);
Any help is highly appreciated.
Thanks in Advance!!
BR,
Uday

Similar Messages

  • Problems using the Java API inside a Web Service

    Hi,
    after I've built a standalone Java RMI client, using the API, I wanted to use the same code in a Web Service I've built and deployed in tomcat (jwsdp-1.3). But i ran into a few problems..
    - although I have the exact same code in both programs, the one in the web service simply blocks when I initiate the Locator class (see above...);
    - all the .jar's that I use in the client are deployed in the WEB-IF/lib of the web service directory on tomcat;
    - no exceptions are thrown in tomcat, so i don't know what's going on;
    Is there any specific configuration for the API to run on tomcat?
    Could it be that the .jar's needed by the Locator class may have some kind of conflict with the ones in tomcat?
    Thanks...
    Note: The code on the client is totaly stable and fully operational.
    The web service uses java.rmi.Remote (extends Remote).
    Here's part of the code:
    Properties env = new Properties();
    env.setProperty("orabpel.platform", "oc4j_10g");
    env.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
    env.setProperty("java.naming.provider.url","ormi://dellpc05/orabpel");
    env.setProperty("java.naming.security.principal","admin");
    env.setProperty("java.naming.security.credentials","welcome");
    Locator locator = new Locator("default", "bpel", env);
    IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
    (...)

    I've put a
    try{Locator...}
    }catch(Throwable t) {
    System.out.println(t.getMessage());
    t.printStackTrace();
    around the Locator..
    I still don't know why it's throwing this...
    Here's what it gets:
    before Locator
    javax/jms/JMSException
    java.lang.NoClassDefFoundError: javax/jms/JMSException
         at com.evermind.server.ThreadState.getCurrentState(ThreadState.java:206)
         at com.evermind.server.rmi.RMIConnection.checkServletCaller(RMIConnection.java:3448)
         at com.evermind.server.rmi.RMIConnection.<init>(RMIConnection.java:181)
         at com.evermind.server.rmi.RMIServer.addNode(RMIServer.java:856)
         at com.evermind.server.rmi.RMIServer.getConnection(RMIServer.java:953)
         at com.evermind.server.rmi.RMIInitialContextFactory.getInitialContext(RMIInitialContextFactory.java:309)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.init(InitialContext.java:219)
         at javax.naming.InitialContext.<init>(InitialContext.java:195)
         at com.collaxa.cube.util.CXBeanRegistry.lookupDomainManagerBean(CXBeanRegistry.java:205)
         at com.oracle.bpel.client.auth.DomainAuthFactory.authenticate(DomainAuthFactory.java:84)
         at com.oracle.bpel.client.Locator.<init>(Locator.java:120)
         at com.oracle.bpel.client.Locator.<init>(Locator.java:91)
         at dmc.tm.resultprovider.ResultProviderImpl$ResultProviderThread.taskTimeoutExceeded(ResultProviderImpl.java:231)
         at dmc.tm.resultprovider.ResultProviderImpl$ResultProviderThread.run(ResultProviderImpl.java:160)

  • Error while using the UWL APIs?

    Hi All,
    I am using the UWL APIs for Task generation.
    Following line is giving error in my code :
    <b>IUWLService uwlService =
                             (IUWLService) PortalRuntime.getRuntimeResources().getService(
                                  IUWLService.ALIAS_KEY);
          UWLContext myContext = new UWLContext();
              try {
                  IUWLSession mySession = uwlService.getUwlSessionForWebDynproClient(myContext);
                catch (Exception e) {
                   response.write("Can not create session");
                                                 [</b>
    The error is " The method getUwlSessionForWebDynproClient is undefined for the type IUWLService
    Please help. I am using the right jar
    <b><property name="ServicesReference" value="SAPJ2EE::library:tckmcbc.uwl~api"/></b>
    Please help.
    Marks given for early and helpful replies.
    Sumit

    Hi All,
    This is just to share my experience.
    I haved solved the problem by adding the SAP:J2EE library reference to the above library in Deployment Descriptor.
    Sumit

  • We are using the Azure server for our web services. Server is generating an error "Unable to connect to the remote server". What is this error means

    We are using the Azure server for our web services. Server is generating an error "Unable to connect to the remote server". What is this error means  

    Hello,
    Did you means that you use the Windows Azure Virtual Machine DNS name as the server name in the Reporting Server Web Services URL?
    For example:
    Report server:http://uebi.cloudapp.net/reportserver
    Report manager:http://uebi.cloudapp.net/reports
    If you want to connect to Report Manager on the virtual machine from a remote computer, you should create a  virtual machine TCP Endpoint and open the port in the virtual machine’s firewall. By default, the report server listens for HTTP requests
    on port 80.
    Reference:http://msdn.microsoft.com/en-us/library/jj992719.aspx#bkmk_ssrs_connect_2_remote_RM
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • How to use the same element in different Web-Services?

    I have defined a web-services in two WSDL files.
    I want to use the same type in this two services. Because if one service call the other one, it could pass the class it just got. Otherwise, the classes can't be casted.
    Web-Service1:
    public com.package1.State inputValue (com.package1.State state) {
    return state;
    Web-Service2:
    public com.package2.State inputValue (com.package2.State state) {
    return state;
    }And now, If I call from the Service2, the Service1 and put
    Service1.inputValue(com.package2.State state) ;
    I can't do this, can't cast and so on. But I want my tool WSDL2Java, will create the same State.class for two Web-Services, like:
    Web-Service1:
    public com.package3.State inputValue (com.package3.State state) {
    return state;
    Web-Service2:
    public com.package3.State inputValue (com.package3.State state) {
    return state;
    }Is it possible? How to define it in wsdl?
    Thanks in advance.

    You can certainly do this in WSDL, simply put your
    common element in a schema file and "include" it into
    each of your WSDL files. Obviously your element will
    have to use the same namespace in all places.
    I'm not sure whether wsdl2java can cope with
    "include" statements in WSDL. I know plenty of other
    similar tools, e.g. Axis and .Net tools, didn't
    support this however they may have moved on since I
    used them.
    To get around this you have to "manually" include the
    schema in each wsdl for code generation purposes.Thanks for the answer. I did as you said and it works fine.

  • Using datasource with streaming api inside a web service

    I am using the 9.1 server and accessing a datasource
    created with aldsp3.0. When I run the code below as a
    standalone java app, everything works fine. When I run it
    on the server, I get a class cast exception when trying to cast an object returned from the stream to MyData type.
    When running the java app in the debugger, the objects
    dataServiceDoc, dog , and dObj all have
    the correct type. When running the web service in the debugger, the objects are all of type
    DataObjectGeneral, thus causing the cast error.
    <p><p>
    Any help will be greatly appreciated!
    <p>
    Thanks.
    <p><p>
    package services;
    <p>
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import weblogic.jndi.Environment;
    import com.bea.dsp.RequestConfig;
    import com.bea.dsp.das.DASResult;
    import com.bea.dsp.das.DataAccessServiceFactory;
    import com.bea.dsp.das.PreparedExpression;
    import com.bea.sdo.impl.data.DataObjectGeneral;
    import commonj.sdo.DataObject;
    <p>
    @WebService
    <p>
    public class MyService
    <p>
    private final static String DS_URL = "t3://localhost:7001";
    <p>
    @WebMethod
    <p>
    public String testMethod2()
    <p>
    StringBuilder result = new StringBuilder();
    <p>
    try
    <p>
    // Get the initial context to the WebLogic Server passing in user credentials
    <p>
    Context ctx = getInitialContext(DS_URL,"weblogic", "weblogic");
    <p>
    RequestConfig reqConfig = new RequestConfig();
    <p>
    reqConfig.enableFeature(RequestConfig.RETURN_DATA_SERVICE_AUDIT);
    <p>
    reqConfig.enableFeature(RequestConfig.RETURN_AUDIT_PROPERTIES);
    <p>
    reqConfig.setStringArrayAttribute(RequestConfig.RETURN_AUDIT_PROPERTIES,
    new String[] { "common", "query" });;
    <p>
    String dspDataSpace = "MY_DS";
    <p>
    String adhoc = createQuery();
    <p>
    PreparedExpression pe = DataAccessServiceFactory.prepareExpression(ctx, dspDataSpace, adhoc);
    <p>
    DASResult<Object> dasResult = pe.executeQuery(reqConfig);
    <p>
    int i = 0;
    <p>
    int N = 100;
    <p>
    Long[] ids = new Long[N];
    <p>
    while (dasResult.hasNext() && i<N)
    <p>
    Object dataServiceDoc = dasResult.next();
    <p>
    // Convert Object to a Data Object
    <p>
    DataObjectGeneral dog = (DataObjectGeneral) dataServiceDoc;
    <p>
    DataObject dObj = dog.getRootObject();
    <p>
    // Cast the Data Object to the SDO Type (MyDataType)
    <p>
    MyDataType p = (MyDataType) dObj;
    <p>
    i++;
    <p>
    <p>
    catch (Exception e)
    <p>
    result.append(e);
    <p>
    <p>
    return result.toString();
    <p>
    <p>
    private static InitialContext getInitialContext(String url, String username, String password) throws NamingException
    <p>
    Environment env = new Environment();
    <p>
    env.setProviderUrl(url);
    <p>
    env.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
    <p>
    env.setSecurityPrincipal(username);
    <p>
    env.setSecurityCredentials(password);
    <p>
    return new InitialContext(env.getInitialContext().getEnvironment());
    <p>
    <p>
    public static void main(String [] args)
    <p>
    MyService ms = new MyService();
    <p>
    System.out.println(ms.testMethod2());
    <p>
    <p>
    <p>

    test

  • [ALBPM-5.7] - How to use the result of a invoked web service?

    Using PBL I wrote the following piece of code:
    ........some rows........
    request as Ex1_WebServices.Ph.GetSuperiorRequest2
    response as Ex1_WebServices.Ph.GetSuperiorResponse2
    lm as MyPrj.LineManager
    request.alias = "danieas"
    getSuperior PeopleHierarchyNavigatorService
    using getSuperiorRequest = request
    returning response = superiorResponse
    if response is not null then
    lm.firstname = String(response.people.person.firstname)
    lm.lastname = String(response.people.person.lastname)
    else
    logMessage "response is null" using severity = DEBUG
    end
    the service is correctly called and the right answer is received:
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header />
    <SOAP-ENV:Body>
    <tns:people xmlns:tns="http://ws1.example.com">
    <tns:person>
    <tns:deptNumber>1111111111111</tns:deptNumber>
    <tns:unit>16</tns:unit>
    <tns:team>49</tns:team>
    <tns:email>[email protected]</tns:email>
    <tns:firstname>Franz</tns:firstname>
    <tns:lastname>PAGNOTTA</tns:lastname>
    </tns:person>
    </tns:people>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    anyway
    lm.firstname = String(response.people.person.firstname)
    fails reporting the following stacktrace:
    Null reference found in 'response.people'. The expected type was 'ROQ_WebServices.Ph.ListOfPeople'.
    fuego.compiler.NullReferenceException: Null reference found in 'response.people'. The expected type was 'ROQ_WebServices.Ph.ListOfPeople'.
         at fuego.compiler.MemberReference.run(MemberReference.java:553)
         at fuego.compiler.Node.value(Node.java:2279)
    Anybody can help?

    A partial solution
    The real answer is:
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header />
    <SOAP-ENV:Body>
    <ns1:people xmlns:ns1="http://ws1.example.com">
    <ns1:person>
    <ns1:deptNumber>1111111111111</ns1:deptNumber>
    <ns1:unit>16</ns1:unit>
    <ns1:team>49</ns1:team>
    <ns1:email>[email protected]</ns1:email>
    <ns1:firstname>Franz</ns1:firstname>
    <ns1:lastname>PAGNOTTA</ns1:lastname>
    </ns1:person>
    </ns1:people>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    instead of
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header />
    <SOAP-ENV:Body>
    <tns:people xmlns:tns="http://ws1.example.com">
    <tns:person>
    <tns:deptNumber>1111111111111</tns:deptNumber>
    <tns:unit>16</tns:unit>
    <tns:team>49</tns:team>
    <tns:email>[email protected]</tns:email>
    <tns:firstname>Franz</tns:firstname>
    <tns:lastname>PAGNOTTA</tns:lastname>
    </tns:person>
    </tns:people>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    that is there is ns1 instead of tns as name prefix (I see it by the debugger).
    To get out a string, for example the lastname, an Xpath expression can be used:
    "/ns1:people/ns1:person/ns1:lastname"
    that put into BPL becomes:
    selectString(response, xpath : "/ns1:people/ns1:person/ns1:lastname")
    but to write this code I can only figure out that BPM substituted tns with ns1 in other words noone garantee that the prefix will be always ns1.
    Is there a way to get it out by a program?

  • How to use an ABAP exception as a web service fault

    Hi experts,
    I have created a web service out of an ABAP function module, using the SAP standard wizard for web services. The ABAP function has some exceptions defined. Now the question is: How can I "translate" these ABAP function exceptions to web service faults?
    In the WSDL file I can see that the web service defines the faults, but they are not part of the web service operation (in the WSDL file). So when I load the definition into JDeveloper, the faults are not recognized.
    Any ideas what I am missing here?
    Thanks in advance!
    Kind regards, Matthias

    Exceptions from SAP function module are not translated as web service fault message, this is a standard behaviour due among other to the fact that exceptions are not "in line" with the definition a web service fault message.
    Usually when you want to use a standard SAP function module and expose it as web service, you need to "wrap-it" into a new Z function module.
    In that new function module you must capture the exceptions and convert them into a web service fault message structure (usually containing error type, text and number)
    Karim

  • How to count number of lines inside methods() using the Doclet API

    Wrote a custom doclet using the [Doclet API|http://java.sun.com/j2se/1.3/docs/tooldocs/javadoc/doclet/index.html ] .
    The purpose for the doclet is to load Java source files and create stubs (which are identical Java source files but do not contain any method implementation details).
    Instead, the method implementation details need to be replaced with blank lines...
    public class MyDoclet {
         private static String TAB = "\t";
         public static boolean start(RootDoc root) {
              ClassDoc[] classes = root.classes();
              // Parse through class or interface
              for (ClassDoc clazz : classes) {
                   Type superClass = clazz.superclassType();     
                   // Print Methods
                   MethodDoc[] methods = clazz.methods();
                   for (MethodDoc method : methods) {
                        Parameter[] parameters = method.parameters();
                        println();
                        if (!method.isPrivate()) {
                             print(TAB + method.modifiers() + " "
                                                    + method.returnType().simpleTypeName() + " " + method.name());
                             print("(");
                             for (int i=0; i < parameters.length; i++) {
                                  Parameter parameter = (Parameter) parameters;
                                  print(parameter.type().simpleTypeName() + " " + parameter.name());
                                  if (i != parameters.length - 1) {
                                       print(", ");
                             print(")");
                             println(" {");
                             println("\n");
                             println(TAB + "}");
              return true;
    As one can see, I am just creating the method and placing the opening and closing curly braces (along with a new \n line escape sequence, in between).
    Am not really that familiar with the Doclet API...
    Question(s):
    (1) What is the best way to figure out how many lines of code are inside each method and then use a for loop to insert the exact same number of blank lines inside the methods?
    (2) Is there a way to do it using the com.sun.javadoc.SourcePosition.line() method?
    Would really appreciate it if someone could help me because this is an important requirement (hence the 10 Duke Stars).
    Happy coding to all,
    Mike                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    This is not possible using the Doclet API, because JavaDoc does not store any information regarding implementation detail. Although MethodDoc#position will give you the line where the method is declared, there is no way to determine where the method body starts and ends.
    If you need that much information, maybe you would be better of using a tool such as Eclipse's Abstract Syntax Tree parser. AST will provide you with line numbers for each code expression, hence it is relatively easy to compute the first and last line in a method body.

  • Using the Desktop API in Java SE 6 (Mustang)

    <p>The Java platform continues to evolve, and Java applications can now integrate with the host desktop better than ever before. This new article describes how to integrate your Java application into the desktop using new Java SE 6 features:</p>
    http://java.sun.com/developer/technicalArticles/J2SE/Desktop/mustang/desktop_api/

    peterwkc wrote:
    Hello to all,
    this is some sort of theoretical question.
    I been reading the JMS documentation for a while.
    1.I could not understand what this statement means :
    >
    This section describes the ways in which using the JMS API in enterprise bean applications or web applications differs from using it in application clients.
    What a developer is allowed to do is different depending on whether they are writing code to run in a container or not. The container already provides lots of services so some code you would write for outside a container is not needed when you write for a container. There are APIs that you are not allowed for in container code if you want to adhere to the spec.
    >
    2. What is the difference to use the JMS in java EE web orEJB container and application client ?
    Thanks.Read more of that document to find out the differences. Application components in Web/EJBs must not create more than one active session per connection while application clients are allowed to do so.

  • Using the JMS API in Java EE Applications

    Hello to all,
    this is some sort of theoretical question.
    I been reading the JMS documentation for a while.
    1.I could not understand what this statement means :
    >
    This section describes the ways in which using the JMS API in enterprise bean applications or web applications differs from using it in application clients.
    2. What is the difference to use the JMS in java EE web orEJB container and application client ?
    Thanks.

    peterwkc wrote:
    Hello to all,
    this is some sort of theoretical question.
    I been reading the JMS documentation for a while.
    1.I could not understand what this statement means :
    >
    This section describes the ways in which using the JMS API in enterprise bean applications or web applications differs from using it in application clients.
    What a developer is allowed to do is different depending on whether they are writing code to run in a container or not. The container already provides lots of services so some code you would write for outside a container is not needed when you write for a container. There are APIs that you are not allowed for in container code if you want to adhere to the spec.
    >
    2. What is the difference to use the JMS in java EE web orEJB container and application client ?
    Thanks.Read more of that document to find out the differences. Application components in Web/EJBs must not create more than one active session per connection while application clients are allowed to do so.

  • Access user inside of web service stub (or web service)

    i am trying to access the current portal user from inside a web service and/or a web service stub. (note, ws is generated using xslt)...
    i found in an otn document (http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/articles/understanding.web.services.for.portlets.html) the following:
    *** begin
    By using information specified in the XML provider definition (provider.xml), the renderers allow inputs to a web service to be "wired up" declaratively to any of the following sources of information.
    Portlet render request parameters, such as the username, locale and authentication level
    *** end
    it continues, but the above section seems relevant to me. it indicates that i should be able to get this information to my web service (through the renderer???). can someone please explain how? are there examples of this?
    thank you very much.
    chris

    found it...
    http://portalcenter.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/ARTICLES/HOW.TO.BUILD.WEB.SERVICES.PORTLETS.HTML

  • Using the Preferences API

    I've never used this API before, so excuse my ignorance. I have a web application that I have been using a properties file to store base app info, such as the backend database, the url for the ldap, etc. This has been working fine, but after reading about the Preferences API, I thought that this might be the better place to store this info. However, I'm having permission problems that I haven't been able to figure out.
    I've got a development copy of everything on a single computer (using Windows XP), Sun One App Server, and Oracle.
    I created a small test class to see if I could load preferences from an xml file. Here's the class
    package portal.common;
    import java.util.*;
    import java.util.prefs.*;
    import java.io.*;
    import java.lang.*;
    public class PortalPreferences{
         Preferences sysPreferencesRoot;
         public void prefs() throws SecurityException{
    sysPreferencesRoot = Preferences.systemRoot();
         public void uploadPrefs(String file) throws IOException, InvalidPreferencesFormatException{
         FileInputStream fis = new FileInputStream(file);
         RuntimePermission rpermiss = new RuntimePermission("preferences.*");
         Preferences.importPreferences(fis);
         public Preferences getPrefs(){
         return sysPreferencesRoot;
    I then used a jsp to instantiate the class and call the uploadPrefs method. The class instantiates without error, but when I try to load the xml file I get the following error:
    access denied (java.lang.RuntimePermission preferences)
    I've never done anything with the security manager before so I'm not sure how to get around this. I tried creating a RuntimePermission object above, but that didn't work.
    If anyone has any ideas, I'd much appreciate it.

    No, actually I've got the Sun One App server loaded on a desktop I built that I'm using as a test box - its not a server. The Sun server is running fine, as is Oracle. The only problem I'm having is figuring out how to use the Preferences API. Maybe this API isn't the right thing to be using, that's why I'm asking for advice as well as how to get around the security issue that I'm having. My goal is to have application level information that can be stored somewhere other than in a database - this is because one of the pieces of app info is the database that's being used. This app will work with any backend. Currently, this info is stored in a properties file inside the WEB-INF directory. This works fine as is. However, my issue with that is that in order to load the properties file, I've got to have a real drive path. This again isn't that much of an issue except when trying to access from a class that doesn't have the servlet context, however, I am looking for an alternative solution to the properties file. The Preferences seemed like a good solution.

  • How to use a cascading LOV as a Web Services Consumer?

    How to use a cascading LOV as a Web Services Consumer?
    We are trying to populate a prompt programmatically.
    Our program is a Web Services Consumer.
    As an example we use Island Resorts Marketing
    The cascading LOV for City is
    Country -> Region -> City
    The City object is key-aware to the customer table
    The query is
    Customer | Revenue
    (where) City = [prompt]
    In order to make the key-awareness work, we must select the value (rowIndex) from the LOV
    When we run our program below, the LOV for City is not populated, as expected since we must first select the Country, then the Region.
    The code snippet below shows that the LOV for Country is populated. We have no idea how to go from there.
    Any hint will be immensely appreciated.
    Let us know if anything is unclear in the code.
    Source       
    RetrieveMustFillInfo retrieveMustFillInfo = RetrieveMustFillInfo.Factory.newInstance();
            RetrievePromptsInfo retrievePromptInfo = RetrievePromptsInfo.Factory.newInstance();
            retrievePromptInfo.setPromptLOVRetrievalMode(PromptLOVRetrievalMode.ALL);
            retrievePromptInfo.setRefreshReturnedLOVs(true);
            retrievePromptInfo.setReturnLOVOnMustFillPrompts(true);
            retrieveMustFillInfo.setRetrievePromptsInfo(retrievePromptInfo);
            // *-- need the "Refresh" action to get the .promptToBeFilled
            Action[] boActions = new Action[1];
            boActions[0] = Refresh.Factory.newInstance();
            try {
                documentInformation = reportEngine.getDocumentInformation(Integer.toString(infoObject.getID()), retrieveMustFillInfo, boActions, null, null);
                m_Token = documentInformation.getDocumentReference();
            } catch (Exception ex) {
                System.out.println(GetWSError(ex));
                return;
            if (documentInformation.getMustFillPrompts()) {
                PromptInfo[] promptInfoS = documentInformation.getPromptInfoArray();
                for (PromptInfo promptInfo : promptInfoS) {
                    System.out.println(String.format("Prompt '%1$s', hasLOV=%2$s", promptInfo.getName(), (promptInfo.getHasLOV() ? "Yes" : "No")));
                    if (promptInfo.getHasLOV()) {
                        LOV boLOV = promptInfo.getLOV();
                        for (Value boLOVValue : boLOV.getValuesArray()) {
                            System.out.println(String.format(" LOV item '%1$s' RowIndex=%2$s", boLOVValue.getColumnsArray(0), (boLOV.getRowIndexed() ? boLOVValue.getRowIndex() : "")));
                    System.out.println("--End LOV");
                    PromptInfo[] promptInfoS2 = promptInfo.getPromptToBeFilledArray();
                    if (promptInfoS2.length > 0) {
                        PromptInfo promptInfo2 = promptInfoS2[0];
                        System.out.println(String.format(" linked to %1$s", promptInfo2.getName()));
                        if (promptInfo2.getHasLOV()) {
                            LOV boLOV2 = promptInfo2.getLOV();
                            for (Value boLOVValue : boLOV2.getValuesArray()) {
                                System.out.println(String.format(" LOV item '%1$s' RowIndex=%2$s", boLOVValue.getColumnsArray(0), (boLOV2.getRowIndexed() ? boLOVValue.getRowIndex() : "")));
                            System.out.println("--End LOV");
    Result
    Prompt 'Enter value(s) for City:', hasLOV=Yes
    --End LOV
    linked to Enter value for Country of origin
    LOV item 'Australia' RowIndex=6
    LOV item 'France' RowIndex=2
    LOV item 'Germany' RowIndex=4
    LOV item 'Holland' RowIndex=7
    LOV item 'Japan' RowIndex=5
    LOV item 'UK' RowIndex=3
    LOV item 'US' RowIndex=1
    --End LOV

    Hi,
    Refer SAP Note 1278947. You would require a Service Market Place logon to access this article.
    Let me know if this helps.
    Regards,
    Shreyans Surana

  • Using JAX-RPC handlers to proxy web service traffic

    Hi,
    I want to use JAX-RPC handlers to proxy web service traffic. In some instances the handler should modifiy / verify the message before forwarding the request to the remote web service end-point. Hence, the handler should forward the call by invoking the remote web service. In some cases the result from invoking the remove service should be post-processed by another proxy handler. To ensure that the result from invoking the remote service is available for post-processing I assume that the handler invoking the remote service must add the response message to the message context ( e g setProperty method) in the handler. Is this correctly understood?
    I would like to understand that this is a technically feasible and reasonable approach of using JAX-RPC. I'd really appreciate some feedback here.
    Many thanks,
    Tom

    Hi Eric,
    Thanks for your response. we are trying to access WSRR( manages end point urls for 7 different environments) and generate the end point dynamically at the design time. As we figured out WSRR is not compatible with OSB we are trying to implement these client side (OSB Proxy service) handlers which would get the dynamic endpoint depending on the environment used. I was able to create the handlers for this and set the jar in the classpath but the client service which should be using these handlers have to have these handlers defined in the deployment descriptor(web.xml) which am unable to see with a OSB project.
    Will there be a deployment descriptor(web.xml/webservices.xml) associated with Proxy services on OSB? Or Is there any other way to add custom JAX-RPC Handlers to a proxy service? Or is there any way to connect to WSRR directly?
    Thanks,
    Swetha

Maybe you are looking for

  • Error: Could not connect to SAPR3_Financials

    Hi all I am trying to launch MSS Services for my organization. Specifically the My Budget area of the package. I am getting this error I have pasted in the subject on almost all the iViews for any user. The only way the system fetches the data withou

  • ISE and UC

    hello all, We're currently implementing Cisco Unified Communications side to side with ISE. there is a profile set on ISE for the phones. however we're experiencing a few issues with ISE and phone registration I'm not the expert on ISE. I'd like to k

  • Who Wants to debug in Production?

    This issue is about my previous thread which has been resolved: "Missing segment in invoice idoc" https://www.sdn.sap.com/irj/sdn/collaboration Can we debug this in production system? please vote to NO or YES then give your wildest comments... Thank

  • Conversion from CHARacter to CURRENCY ???

    Hi Experts, Pls. let me know that, How to convert a CHAR acter field to CURRENCY field? Is there any FM? or How to get it done? thanq

  • My N8 not updating Emailbox????

    Hello All, My facing problem to update my mailbox in my N8. I create ovi,yahoo,gmail account throguh default mailbox(Email). Even it create the account succesfully. But not sychronizing the mail. I am using WLAN for connection.Plz give me suggestion.