JSP WebService call problems

Source: Internet
Author: User
I recently tested WebService. I used myeclipse5.1.1 to create a WebService named "user" and added two methods to the service.

Public String example (string message ){
Return message;
}

Public String [] usercheck (string username, string password ){
String s [] = NULL;
If (username. inclusignorecase ("Robin") & password. inclusignorecase ("password ")){
S = new string [3];
S [0] = "Robin ";
S [1] = "Robin ";
S [2] = "Robin ";
}
Return S;
}

Publish it to Tomcat 6, generate a client using myeclipse, and call the service in the client for testing. The call is normal on the client. Next, we want to implement the user authentication function in JSP, that is, to submit the user name and password on the leaf, which is returned by wenservice.
Then write the authentication Bean
Public class TT {

Private Static userclient UC = new userclient ();
Private Static userporttype ut = UC. getuserhttpport ();

Public String getexmple (){
String S = UT. Example ("Robin ");
Return S;
}

Public list getuser (string username, string password ){
List S = NULL;
Arrayofstring as = (arrayofstring) ut. usercheck (username, password );
Try {
S = (list) as. getstring ();
} Catch (exception e ){
S = NULL;
}

Return S;
}

Public static void main (string [] ARGs ){
// Todo auto-generated method stub

Tt t = new TT ();
System. Out. println (T. getexmple ());
List L = T. getuser ("Robin", "password ");
If (L = NULL ){
System. Out. println ("DD ");
} Else {
System. Out. println (L. Size ());
}

// System. Out. println (. Size ());

}

}

It runs directly in eclipse and is normal. But when I reference it in JSP
<% @ Page import = "com. Zoo. tt" %>
<%
Tt t = new TT ();
Out. println (T. getexmple ());
List L = T. getuser ("Robin", "password ");
Out. println ("________");
Out. println (L. Size ());
Out. println ("________");
%>

the string reference is correct, that is, an error occurs when calling the list
unable to locate jaxb. properties for package com. Zoo. Service. User

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.