Below jsp displays the returned HashMap value from the webservice
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@page import="com.action.AuraDecisionWorsheetDetailsService"%>
<%@page import="com.action.AuraDecisionWorsheetDetailsServiceLocator"%>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<form name="form1" method="post" action='gawd.jsp'>
<center><h1>DETAILS</h1></center>
<%
try{
AuraDecisionWorsheetDetailsService psi = new AuraDecisionWorsheetDetailsServiceLocator();
com.action.AuraDecisionWorsheetDetails ps = psi.getAuraDecisionWorsheetDetails();
if(request.getParameter("PolId")!=null){
String pol_id=request.getParameter("PolId");
%>
<center><b>RESULT :</b> <%= ps.service(pol_id)%></center>
<% }else
{%>
<TABLE align="center">
<TR>
<TD>ENTER POLICY NUMBER</TD>
<TD><input type="text" name= "PolId" /></TD>
</TR>
<TR>
<TD colspan="2" align="center"> </TD>
</TR>
<TR>
<TD colspan="2" align="center"><input type="submit" value="Submit"></TD>
</TR>
</TABLE>
<% }
}catch(Exception exe)
{
exe.printStackTrace();
}
%>
</form>
</BODY>
</HTML>
Received below exception
faultString: java.io.IOException: No serializer found for class com.solcorp.pathfinder.uidefs.UIElement in registry org.apache.axis.encoding.TypeMappingDelegate@c87621
Caused by: java.io.IOException: No serializer found for class com.solcorp.pathfinder.uidefs.UIElement in registry org.apache.axis.encoding.TypeMappingDelegate@c87621
Web service takes one parameter i.e. pol_id and returns HashMap.
It is created using Apache Axis.
You have so many problems in this code:
alert(pol_id);without opening any script tag.alertis a javascript function and must be contained inside<script></script>.<TD><input type="text" name= "PolId" %></TD>, it should obviously be:<input type="text" name= "PolId" /></TD>(note that i changed%at the end to/.<%= ps.service(pol_id)%>you are missing;at the end.You have this condition:
you are doing the same check twice, either remove the if or the ternary operator.
Fix these problems (the first one is really more of a best practice, so you can skip it for now), and then if you have more problems come back and post your question.
EDIT:
in your code you are eching the result from the service:
but as you mentioned it is a Hashmap, so i don’t think you can echo it directly. you need to echo the values you extract from it, so try doing this for testing: