Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8554985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:00:51+00:00 2026-06-11T15:00:51+00:00

I am studying ‘Web Service’ this week and found good tutorial and example code.

  • 0

I am studying ‘Web Service’ this week and found good tutorial and example code.

IBM developerWorks

on the page of 3, you can see CheckCard.java file which provide Web Service on server side.

This file contains a few methods such as

public static boolean validCC(String number)
public static boolean validCCNumber(String n)
public static int getCardID(String number)
public static boolean isNumber(String n)
public static String getCardName(int id)
public String doCheck(String aCard)

and 'doCheck()' method is the one I can invoke from client-side. What I want to ask you is why other methods are all static? Is this a rule or should it be static?

Web Service is very complicated for beginner and I just wonder every little things..
Could anybody give me a clue?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:00:52+00:00Added an answer on June 11, 2026 at 3:00 pm

    A WebMethod ,in this case doCheck(String Card) is intended for remote method invocation and cannot be static. Doing so goes against the Web services model of relying on a proxy class, which, by its nature, needs to be instantiated as a genuine object to call the Web service.

    That is why other methods are all static and cannot be exposed as a service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was just studying OCPJP questions and I found this strange code: public static
When studying the project 'gproc' source code files, I have found several patch files
Im studying some ruby code and I see this varx variable being used with
I'm studying java web services and trying to follow the oracle tutorial but it
Studying asp.net mvc 3 + EF code-first. I am new to both. My example
After studying TCP/UDP difference all week, I just can't decide which to use. I
When studying a snippet of unknown Python code, I occasionally bump into the varName.methodName()
I started studying Haskell one week ago and have one strange problem. I created
I was studying an open source code where I came across the following line
I am studying an existing Perl program, which includes the following line of code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.