I had posted my first Q on http://www.jboss.com/index.html?module=bb
&op=viewtopic&t=134614 instead of this location.
Here's a copy:
I am trying to take the simple echo example (http://jbws.dyndns.org/mediawiki/index.php?
title=JBossWS_JAX-WS_Tools) to the next level and
running into problem.
I want to return a hashmap instead of the string.
Instead of the client printing the hasmap contents it prints
the address of the the hashmap.
Here's the code:
GetPM.java:
=========
package getpm;
import java.util.HashMap;
javax.jws.WebService
public class GetPM
{
HashMap map = new HashMap();
public HashMap getPM()
{
map.put("key1", "value1");
map.put("key2", "value2");
map.put("key3", "value3");
System.out.println("From Server:" +
map.toString());
return map;
}
}
I am using the same web.xml as in the echo example -- is
this were I am going wrong?
web.xml
=======
<web-app xmlns="http://java.sun
.com/xml/ns/j2ee"
xmlns si=&q
uot;http:
//www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/x
ml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet-name>GetPM</servlet-name>
<servlet-class>getpm.GetPM</servlet-class>
<servlet-mapping>
<servlet-name>GetPM</servlet-name>
<url-pattern>/GetPM</url-pattern>
</servlet-mapping>
</web-app>
I created the getpm.war file & deployed it on the jboss
AS.
Using wsconsume created the client files using the online
version of service wsdl file: wsconsume -k http://localho
st:8080/getpm/GetPM?wsdl
The client then calls the service using the following
GetPMclient.java:
=============
import getpm.*;
public class GetPMclient
{
public static void main(String args[])
{
GetPMService service = new GetPMService();
GetPM pm = service.getGetPMPort();
System.out.println("Server said: " + pm.getPM());
//HashMap hm = (HashMap) pm.getPM();
//System.out.println(hm.toString());
}
}
On the server stdout I get the hashmap printed correctly,
but on the client side instead of the hashmap I get the
reference of the hashmap as below:
getpm.HashMap 1a0b53e
instead of
{key1=value1, key2=value2, key3=value3}
C:....webservicesgetpmclientoutput>wsrunclient
GetPMclient
log4j:WARN No appenders could be found for logger
(org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaData
Builder).
log4j:WARN Please initialize the log4j system properly.
Server said:
getpm.HashMap 1a0b53e
View the original post : http://www.jboss.com/index.html?
module=bb&op=viewtopic&p=4147386#4147386
Reply to the post : http://www.jboss.com/index.
html?module=bb&op=posting&mode=reply&p=4147386
a>
_______________________________________________
jbossws-dev mailing list
jbossws-dev lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbossws-dev
|