Web Service access

I am trying to access a web service that I created in Visual Studio. I've downloaded the sample code from http://www.simplified-tech.com/website/webapp.nsf/webpages/ArticlesBBWebServices and modified it to query my web service. When I run my app in the simulator it just stalls at the "Sending" portion. The same result happened in the original web service sample (the language translator). I then created an MDS project to connect to my web service and another MDS project to access the language translator. Both of them worked with no problem. The problem is that I do not want to use MDS since it requires a BES to run the apps you create. I just want to develop in JRE so I can load my app on BB's in the office. The sample article didn't work becuase the web service had changed since they posted it so I changed the input values to reflect the new web service format and it still did not work. On my web service I created a log file to tell me who and when the last call was to the service. When I access it from my MDS project I get a record in the log but when I try it from the JRE I don't get any record entry in the log.
I'm new to JRE so syntax kills me most of the time. I don't know enough to fix the problem. Does anyone have any full samples that connect to a web service that currently work?

Hello,
When try to call my business method, get_number() I get a runtime error
"ava.lang.ExceptionInInitializerError: java.lang.SecurityException: Prohibited package name: java.util.logging.........."
My code is:
PortalServiceService_Impl service =
               new PortalServiceService_Impl();
          PortalService ps= service.getComSapPortalPrtSoapPortalService();     
          String s=ps.getClass().toString();
          int hc=ps.hashCode();
          int ii=ps.get_number();
          System.out.println (s);
          System.out.println(hc);

Similar Messages

  • Enable Web Service access for a Web service-enabled client

    Hi,
    I want to access data in Oracle CRM On Demand from a Web services-enabled client. The "Oracle Web Services On Demand Guide" suggest the Web Services Access should be granted by Customer Care representative. By default, this access is enabled for the Administrator role for new companies. However my admin account can't access web services from a web enable client.
    Can anyone please suggest me the setting/step that i need to enable Oracle On Demand Web service access from a Web services-enabled client?
    Note: I am new to oracle on demand so my query can be a silly thing.
    Thanks & Regards
    Ravish

    I was able to resolve this issue. Actually, i was trying with trial account that don't allow the OCOD web service integration.

  • Newbie question: how to tell if account has web services access?

    As the title suggests I am new to CRMOD though I have worked with other web Apis.
    Right now I have a CRM account but keep getting the "capslock" response in my SOAP call. I think it is because the account is just a regular account and is missing certain rights. How do I tell the admin to grant my account those rights? I'm not sure how to make such a request in words they will understand.

    Hello Daniel,
    You need to identify your role. If you go to mysetup you would know your role.
    Ask the admin to grant "Enable Web Services Access" prvilege to your role.
    This should be fine.
    Regards,
    Paul Swarnapandian

  • Project Server 2010 Web services access with Client Certificate Authentication

    We switched our SharePoint/Project Server 2010 farm to use client certificate authentication with Active Directory Federation Services (AD FS) 2.0, which is working without issue. We have some administrative Project Server Interface (PSI)
    web service applications that no longer connect to server with the new authentication configuration.  Our custom applications are using the WCF interface to access the public web services.
    Please let us know if it is possible to authenticate with AD FS 2.0 and then call
    Project Server web services. Any help or coding examples would be greatly appreciated.

    what is the error occurred when the custom PSI app connects?
    can you upload the ULS logs here for research?
    What is the user account format you specified in the code for authentication?
    For proper authorization, the “user logon account” in PWA for the user needs to be changed from domain\username to the claims token (e.g.
    'I:0#.w|mybusinessdomain\ewmccarty').
    It requires you to manually call the UpnLogon method of
    “Claims to Windows Token Service”. if (Thread.CurrentPrincipal.Identity is ClaimsIdentity)  
    {  var identity = (ClaimsIdentity)Thread.CurrentPrincipal.Identity;  }  
    if (Thread.CurrentPrincipal.Identity is ClaimsIdentity)
    var identity = (ClaimsIdentity)Thread.CurrentPrincipal.Identity;
    Than you need to extract UPN-Claim from the identity.
    Upload the verbose log if possible.
    Did you see this?
    http://msdn.microsoft.com/en-us/library/ff181538(v=office.14).aspx
    Cheers. Happy troubleshooting !!! Sriram E - MSFT Enterprise Project Management

  • Web Service Access to a extension field

    Hello All:
       Scoping against solution capability, how easy, or at all possible, is to access a extension fields to a native ByD business Objects via web services? In my specific case, the E-Commerce Sales Order Creation Web Service.
       But the question is pretty general, This can be a data retrieve web services as well? Any limitations? does it needed to be rebuild by SAP? or can we generate them by ourselves?
       Also, if in future new extension required on web services, can this process be done after implementation and go live? Without too much trouble?
       Any documentation will be greatly appreciated! Thank You!

    This is doubtful as it is a Standard service (we use it for several different solutions).. and is the same across all tenants and I do not think it can be applied as a custom one off..
    asking your dev coach would probally be your best bet.
    Another solution for you would be to have a simple Read,Update Service you write that just deals with your extension fields... so after an order is created you can update your field on the sales order, or read the value given a specific sales order. 
    Unless this has changed it is my understanding that you have to add the Extension field via the Development studio not the Key user tools if you wish to have access to it in the Studio for releasing a webservice like I described above.(Most my work so far has involved integrations and the standard  webservices)

  • Generating Ruby Web Service Access Classes from a WSDL

    If you have tried to consume a web service from Ruby you surely have noticed how annoying is to write manually all the Ruby code just to invoke a service with complext input parameters' structure:
    - You have to know what do the input parameters, their structure and type look like;
    - You have to write Ruby classes for them to encapsulate the structures;
    - You have to instantiate these classes and pass the objects to the web service proxy class;
    - You have to interprete the output parameters.
    All this is not impossible of course, but if you are just consumer of the web service and not the developer, if you don't have the exact documentation, you have to read the WSDL description of the service and create the Ruby classes (structures) for the parameters.
    Fortunately there is a small, though handy tool, called <b>wsdl2ruby.rb</b>. It accomplishes all these boring tasks for you.
    In the following example I will try to show you how <b>wsdl2ruby</b> can be used to generate Ruby classes for accessing a SAP NetWeaver web service, called <b>CreditChecker1</b> (a web service for checking if a person is reliable credit consumer).
    To generate the necessary classes we will create a ruby script. Let us name it <b>ws2rgen.rb</b>. Here is what this file looks like:
    # Import the wsdl2ruby library.
    require 'wsdl/soap/wsdl2ruby'
    require 'logger'
    # Callback function for the WSDL 2 Ruby generation options.
    def getWsdlOpt(s)
         optcmd= {}
         s << "Service"
         optcmd['classdef'] = s
         #should work but doesn't, driver name is derived from classname
         #if you specify both it breaks, same thing for client_skelton
         #optcmd['driver'] = s
         optcmd['driver'] = nil
         #optcmd['client_skelton'] = nil
         optcmd['force'] = true
         return optcmd
    end
    # Create logger.
    logger = Logger.new(STDERR)
    # Create WSDL2Ruby object and generate.
    worker = WSDL::SOAP::WSDL2Ruby.new
    worker.logger = logger
    # WSDL file location.
    worker.location = "http://mysapserver:53000/CreditChecker1/Config1?wsdl"
    # Where to generate.
    worker.basedir = "temp"
    # Set options.
    worker.opt.update(getWsdlOpt("Service"))
    # Heat.
    worker.run
    The procedure is straightforward. First we create the WSDL2Ruby object, set its properties <b>location</b> and <b>basedir</b> and then set all other options via the callback function <b>getWsdlOpt()</b>. For further information about these parameters one could consult the source code of wsdl2ruby or contact the developers. Nevertheless the default options are pretty satisfactory. With the last line we start the generation. Two Ruby files will be generated in the <b>temp</b> folder, which is a subfolder of the script's current folder. <b>Please, create the folder "temp" before executing the script.</b>
    This generates two files. The first one is <b>CreditChecker1Wsd.rb</b>, containing the necessary data structures:
    require 'xsd/qname'
    # {urn:CreditChecker1Vi}areReliable
    class AreReliable
      @@schema_type = "areReliable"
      @@schema_ns = "urn:CreditChecker1Vi"
      @@schema_qualified = "true"
      @@schema_element = [["persons", "ArrayOfPerson"]]
      attr_accessor :persons
      def initialize(persons = nil)
        @persons = persons
      end
    end
    # {urn:CreditChecker1Vi}areReliableResponse
    class AreReliableResponse
      @@schema_type = "areReliableResponse"
      @@schema_ns = "urn:CreditChecker1Vi"
      @@schema_qualified = "true"
      @@schema_element = [["response", ["ArrayOfboolean", XSD::QName.new("urn:CreditChecker1Vi", "Response")]]]
      def Response
        @response
      end
      def Response=(value)
        @response = value
      end
      def initialize(response = nil)
        @response = response
      end
    end
    # {urn:CreditChecker1Vi}isReliable
    class IsReliable
      @@schema_type = "isReliable"
      @@schema_ns = "urn:CreditChecker1Vi"
      @@schema_qualified = "true"
      @@schema_element = [["person", "Person"]]
      attr_accessor :person
      def initialize(person = nil)
        @person = person
      end
    end
    # {urn:CreditChecker1Vi}isReliableResponse
    class IsReliableResponse
      @@schema_type = "isReliableResponse"
      @@schema_ns = "urn:CreditChecker1Vi"
      @@schema_qualified = "true"
      @@schema_element = [["response", ["SOAP::SOAPBoolean", XSD::QName.new("urn:CreditChecker1Vi", "Response")]]]
      def Response
        @response
      end
      def Response=(value)
        @response = value
      end
      def initialize(response = nil)
        @response = response
      end
    end
    # {urn:java/lang}ArrayOfboolean
    class ArrayOfboolean < ::Array
      @@schema_type = "boolean"
      @@schema_ns = "http://www.w3.org/2001/XMLSchema"
      @@schema_element = [["boolean", ["SOAP::SOAPBoolean[]", XSD::QName.new("urn:java/lang", "boolean")]]]
    end
    # {urn:com.sap.scripting.test.services.creditchecker.classes}Person
    class Person
      @@schema_type = "Person"
      @@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
      @@schema_element = [["age", "SOAP::SOAPInt"], ["name", "SOAP::SOAPString"], ["purse", "Purse"]]
      attr_accessor :age
      attr_accessor :name
      attr_accessor :purse
      def initialize(age = nil, name = nil, purse = nil)
        @age = age
        @name = name
        @purse = purse
      end
    end
    # {urn:com.sap.scripting.test.services.creditchecker.classes}Purse
    class Purse
      @@schema_type = "Purse"
      @@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
      @@schema_element = [["color", "SOAP::SOAPString"], ["money", "Money"]]
      attr_accessor :color
      attr_accessor :money
      def initialize(color = nil, money = nil)
        @color = color
        @money = money
      end
    end
    # {urn:com.sap.scripting.test.services.creditchecker.classes}Money
    class Money
      @@schema_type = "Money"
      @@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
      @@schema_element = [["amount", "SOAP::SOAPDouble"], ["currency", "SOAP::SOAPString"]]
      attr_accessor :amount
      attr_accessor :currency
      def initialize(amount = nil, currency = nil)
        @amount = amount
        @currency = currency
      end
    end
    # {urn:com.sap.scripting.test.services.creditchecker.classes}ArrayOfPerson
    class ArrayOfPerson < ::Array
      @@schema_type = "Person"
      @@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
      @@schema_element = [["Person", ["Person[]", XSD::QName.new("urn:com.sap.scripting.test.services.creditchecker.classes", "Person")]]]
    end
    The second file is <b>CreditChecker1WsdDriver.rb</b>. In it you can find a generated child class of SOAP::RPC::Driver, containing all methods of this web service, so you don't need to add every method and its parameters to call the web service.
    require 'CreditChecker1Wsd.rb'
    require 'soap/rpc/driver'
    class CreditChecker1Vi_Document < ::SOAP::RPC::Driver
      DefaultEndpointUrl = "http://mysapserver:53000/CreditChecker1/Config1?style=document"
      MappingRegistry = ::SOAP::Mapping::Registry.new
      Methods = [
      def initialize(endpoint_url = nil)
        endpoint_url ||= DefaultEndpointUrl
        super(endpoint_url, nil)
        self.mapping_registry = MappingRegistry
        init_methods
      end
    private
      def init_methods
        Methods.each do |definitions|
          opt = definitions.last
          if opt[:request_style] == :document
            add_document_operation(*definitions)
          else
            add_rpc_operation(*definitions)
            qname = definitions[0]
            name = definitions[2]
            if qname.name != name and qname.name.capitalize == name.capitalize
              ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
                __send__(name, *arg)
              end
            end
          end
        end
      end
    end
    There is a problem with this script, since the <b>Methods</b> array is empty. I suppose it is due to the imports in the SAP NetWeaver WSDL, maybe wsdl2ruby is not mighty enough to handle these WSDL imports. When I succeed in overcoming this, I will post again in this thread to let everybody know.
    Message was edited by: Vasil Bachvarov

    Hi,
    I find Ruby to be really tough to consume SAP WebServices. For simple scenarios like currency conversion may it is good. But for complex scenarios such as Purchase Order entry etc..I found it very annoying to use wsdl2ruby and see that it didnt generate correct proxies.
    Until wsdl2ruby is stable enough to support complex datatypes, authentication etc. my recommendation is to use JRuby and use Java Proxies generated by NW Developer studio until pure Ruby's web service support improves.
    Following link might be of interest w.r.t wsdl2ruby
    http://derklammeraffe.blogspot.com/2006/08/working-with-wsdl2r-soap4r-and-complex.html
    Regards
    Kiran

  • ADCS Policy Web Service - Access was denied by the remote endpoint. 0x803d0005 (-2143485947)

     Hi there fellow colleagues,
    I am currently facing a problem with ADCS Policy Web Service on Windows Server 2008 R2 Enterprise (SP1).
    • Hotfix installed
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;2545850
    • Application Pool Identity: ApplicationPoolIdentity (also tested custom service account)
    • Testing from local machine and another machine
    • CA and CEP on same system
    • I am getting a Kerberos ticket for the service and I can see a successful logon event for the my user.
    • Kerberos authentication is working - directly calling the URL I get a 403.14 (Directory Listing Denied) with Logon Method Negotiate
    The following message is shown in the Certificate Services Client - Certificate Enrollment Policy Server
    The remote endpoint could not process the request. 0x803d000f (-2143485937)
    The following WS-Errors are in the WebServices analytic log
    •WsCall API failed by 0x803D0005
    •Error occurred: 0x0 - There was an error communicating with the endpoint at 'https://cep.example.com/ADPolicyProvider_CEP_Kerberos/service.svc/CEP'.
    •Error occurred: 0x0 - The server returned HTTP status code '401 (0x191)' with text 'Unauthorized'.
    •Error occurred: 0x0 - The requested resource requires user authentication.
    •Error occurred: 0x803D0005 - Access was denied by the remote endpoint.
     In the application log I can see an event ID 3, source System.ServiceModel 3.0.0.0, Level Error
     WebHost failed to process a request.
     Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/45653674
     Exception: System.ServiceModel.ServiceActivationException: The service '/ADPolicyProvider_CEP_Kerberos/service.svc' cannot be activated due to an exception during compilation.  The exception message is: Software\Microsoft\CEP. ---> System.Configuration.ConfigurationErrorsException:
    Software\Microsoft\CEP
       at Microsoft.CertificateServices.Policy.DerivedHost.Initialize()
       at Microsoft.CertificateServices.Policy.DerivedHost.OnOpening()
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
       --- End of inner exception stack trace ---
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
       at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)
     Process Name: w3wp
     Process ID: 3108
    The EnrollmentPolicyWebService log on the other hand tries to tell me:
    The Certificate Enrollment Policy Web Service failed to initialize. Confirm that the Certificate Enrollment Policy Web Service is properly installed. Try to restart Internet Information Services (IIS) by using iisreset.exe. If the problem persists, enable
    tracing in the web.config file, restart IIS, attempt to obtain policy information from any client, and then contact Microsoft Customer Service and Support with the trace file information.  Unknown HResult Error code: 0x80131902
    I am kind of lost and I'd appreciate some help...
    Thanks,
    MMF

    Calling the CES URL, the following pops up:
    Process information:
    Process ID: 3636
    Process name: w3wp.exe
    Account name: IIS APPPOOL\WSEnrollmentServer
    Exception information:
    Exception type: FileNotFoundException
    Exception message: Could not load file or assembly 'Microsoft.CertificateServices.Certcli.Interop, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
    But - the assembly is installed in the GAC (%windir%\assembly) with the right culture, version, etc.

  • Web Service access with J2EE1.3?

    Hi,
    I'm relatively new to the whole Web Services technology, so my question might be dumb... but anyway:
    What I'm trying to do is to write some code to access a Web Service (I'm not trying to make one, it's supplied by an outside provider). We currently use WebSphere 4, so that puts me with J2EE 1.3. I started looking for tutorials on java.sun.com, and strangely, I couldn't run any one of them (tried SAAJ and JAX-RPC). I then inspected the J2EE API specifications and found out that the packages used in the tutorials do not exist in J2EE 1.3, only in 1.4. So, my question is - do I have to use J2EE 1.4 to use Web Services, or there's a way to access them in 1.3, and if so, how?
    Thanks,
    Alex Savitsky

    You can write an AXIS client for any web services that can run from JDK1.3. See http://ws.apache.org/axis for details.

  • Web services access from PL/SQL. It is possible?

    Hello,
    I need to access some data from one database, using a Web Services (it's the only way I have permisson). It's possible to do that from an PL/SQL function/procedure from another database?
    Thanks,
    XaM

    Yes it is,
    You could use a java stored procedure
    http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html
    Regards
    Peter

  • Java Web Services accessing rmi server

    Hi,
    I want to access the rmi server from a java web services.My java web services is running under Sun application server9.The rmi server is not using any application server.Please help me to sort out the problem.
    Bye
    Binay

    What's the problem exactly? I assume you understand that the RMI server has to run like any RMI server, it has to bind itself into a Registry; the Web server acts as an RMI client so it has to look up the Registry to get a remote reference so it can call the required remote methods.

  • Java Web Service Access SOP Header and SOAP Body

    Hi
    I am newbie to Web Service. I had a Java class and I converted it to Web Service(LoginWebService has methods login, register).
    Now my client is accessing my web services and calling methods login and register.
    Now I want to add few values in SOAP header in client side.
    My Questions:
    1. How can I access the SOAP headers and SOAP Body in my Server Web Service method implementations?
    2. Is there any API that I have to use?
    3. Does anyone have any sample code for these things?
    Thanks

    Seems like the exception handling logic is not sound - but your posting is difficult to read. Please use the *\* tag to mark and end source code snippets.
    Have a look at the sample code in {message:id=4205205} - does a SOAP call using PL/SQL only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Web services Access Error: 404 -- Not Found

    I'm going through the web service example on the help menu.  The vi is built exactly as required and the deployment works.  Labview is running and the vi is open, but when i start up firefox and go to the url, i get the error "Access Error: 404 -- Not Found".  Any ideas?  Thanks.

    Hi Pojoaque,
    Thanks for the update. Which example is called add? 
    Maybe its the address book example, if so, please see this KnowledgeBase article with a known issue with this example - also please double check your configuration of LabVIEW. 
    In the VIs you create yourself what are you trying to do?
    Why Does the Address Book RESTful Web Service Project Found in the LabVIEW 8.6 Example Finder Not Work?
    http://digital.ni.com/public.nsf/allkb/A8830F04188D2835862574AA0059055E?OpenDocument
    If its the VI itself which does work - have you checked your LabVIEW configuration allows access to the webserver for all vis?
    Hope this helps, 
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • Omni Portlet - Web Service access outside firewall

    According to http://download-east.oracle.com/docs/cd/B32110_01/webcenter.1013/b31074/jpsdg_portletconfig.htm#CEGECDBC
    to access a web service outside the firewall we need to modify 'provider.xml'
    From the JDEV HOME, I could see multiple 'provider.xml' files, Could some one help me with the exact 'provider.xml' file I need to modify and the entries to be modified.
    note, we are using Jdeveloper 10.1.3.2.0
    Thanks,
    Kalyan.

    Hi Kalyan,
    You can find provider.xml related to omniportlet at the following location.
    JDEV_HOME\jdev\extensions\oracle.adfp.seededoc4j.10.1.3.2.0\j2ee\home\applications\portalTools\omniPortlet\WEB-INF\providers\omniPortlet
    We need to configure proxy here so as to enable omniportlet to access the websites outside the fire wall.
    In Webcenter 10.1.3.2, we also have dependecy to configure webclipping proxy as well. So will have to do the same with webclipping's provider.xml too. You can find it at the following location.
    JDEV_HOME\jdev\extensions\oracle.adfp.seededoc4j.10.1.3.2.0\j2ee\home\applications\portalTools\webClipping\WEB-INF\providers\webClipping.
    You will have to add the following in the provider.xml
    A) If you dont have any authentication for your proxy
    <proxyInfo class="oracle.portal.provider.v2.ProxyInformation">
    <httpProxyHost>Your_HOST_NAME</httpProxyHost>
    <httpProxyPort>Your_Port</httpProxyPort>
    <proxyUseAuth>false</proxyUseAuth>
    </proxyInfo>
    B) Basic Authentication
    Basic Authentication
    <proxyInfo class="oracle.portal.provider.v2.ProxyInformation">
    <httpProxyHost>Your_HOST_NAME</httpProxyHost>
    <httpProxyPort>Your_Port</httpProxyPort>
    <proxyUseAuth>true</proxyUseAuth>
    <proxyType>Basic</proxyType>
    <proxyRealm>Your_Realm</proxyRealm>
    <proxyUseGlobal>true</proxyUseGlobal>
    <proxyUser>User_Name</proxyUser>
    <proxyPassword>User_Passwd</proxyPassword>
    </proxyInfo>
    C) Digest Authentication
    Basic Authentication
    <proxyInfo class="oracle.portal.provider.v2.ProxyInformation">
    <httpProxyHost>Your_HOST_NAME</httpProxyHost>
    <httpProxyPort>Your_Port</httpProxyPort>
    <proxyUseAuth>true</proxyUseAuth>
    <proxyType>Digest</proxyType>
    <proxyRealm>Your_Realm</proxyRealm>
    <proxyUseGlobal>true</proxyUseGlobal>
    <proxyUser>User_Name</proxyUser>
    <proxyPassword>User_Passwd</proxyPassword>
    </proxyInfo>
    Thanks,
    Seshan K.

  • Restricting Web Service Access from specific machines (IP)

    Is there any way by which we can restrict access of our web service to some specific machines i.e., restricting to some specific IPs.

    maybe a Filter helps you since you can know the remoteIP from the httprequest
    http://java.sun.com/products/servlet/Filters.html
    public class TestFilter implements Filter {
    FilterConfig config = null;
    public void init(FilterConfig filterConfig) throws ServletException {
    this.config = filterConfig;
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
    HttpServletRequest request = (HttpServletRequest) servletRequest;
    HttpServletResponse response = (HttpServletResponse) servletResponse;
    String ssoToken=null;
    System.out.println("+++++++ENTRANDO AL FILTER DE WS++++++++");
    System.out.println("+++++++IPLOCAL++++++++"+request.getLocalAddr());
    System.out.println("+++++++HOSTLOCAL++++++++"+request.getLocalName());
    System.out.println("+++++++IPREMOTE++++++++"+request.getRemoteAddr());
    System.out.println("+++++++HOSTREMOTE++++++++"+request.getRemoteHost());
    System.out.println("+++++++REMOTE USER++++++++"+request.getRemoteUser());
    System.out.println("+++++++Filter chein++++++++");
    filterChain.doFilter(servletRequest,servletResponse);
    System.out.println("***despues de doFilter****");
    public void destroy() {
    config = null;
    }

  • RESTful web services : Accessing the param id resource URI parameter.

    Hello all,
    I created restful web services using Netbeans 6.1--->New RESTful web services from patterns-->Container-Item.
    This gives me 2 class files, for example : MyWSsResource and MyWSResource.
    Now in MyWSResource there are 3 generated methods GET, PUT and Delete.
    Here is an example of the GET
    @Path("/myws/{arg1}")
        @GET
        @ProduceMime("application/xml")
        public String getXml(@PathParam("id")
        String id) {
            if(context.equals(null)) {
            throw new UnsupportedOperationException();
           //My code below
            FpkSentDB fpkSent = new FpkSentDB();
            MultivaluedMap<String, String> params = context.getTemplateParameters();
            String arg1       = params.getFirst("arg1");
            return fpkSent.getFPKSent(arg1).toString();
    {code}I am not understanding the following code:
      {code:java} (@PathParam("id") String id) {code}
    .... I can access arg1 using the URI/arg1value.
    How is PathParam("id")  meant to be accessed?
    If I do a {code:java} logger.debug("ID equals:" + id);{code}
    id returns null always.
    My code works just fine as it is but I am new to REST and wanted to follow spec as closely as possible.
    Any Ideas?
    TIA!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Any possible solution for the issue?, so much thanks for it.

Maybe you are looking for