Webservice Serializing/Deserializing WOStringKeyMap fails

Kristof Cossement <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Hey everyone,

I try to create a webservice with one input parameter of type   
WOStringKeyMap.
WOStringKeyMap has a serializer and a deserializer class !   However  
exchanging the hash through webservices is not working in Webobjects!

Has anyone experienced this too? Does anyone have a workaround ?



SERVICE
========

WOWebServiceRegistrar.registerWebService(Service.class, true);

//Class Service.java
import com.webobjects.webservices.support.xml.WOStringKeyMap;


public class Service {

	public String doitnow(WOStringKeyMap w)
	{
		return "OK DUDE";
	}

}


CLIENT
======

         try {
             URL url = new URL("http://localhost:8838/cgi-bin/ 
WebObjects/HService.woa/ws/Service?wsdl");

			WOWebServiceClient caller = new WOWebServiceClient(url);
			
			WOStringKeyMap w = new WOStringKeyMap();
			w.takeValueForKey("now","time");
			w.takeValueForKey("30 m", "size");
			Object [] o = new Object [] {w};
			Object result = caller.invoke("Service","doitnow", o);
		}
         catch (Exception e) {
			e.printStackTrace();
         }

which generates an exception

com.webobjects.foundation.NSForwardException for  
javax.xml.rpc.ServiceException: Error processing WSDL document:
java.io.IOException: Type {http://schemas.xmlsoap.org/soap/encoding/} 
Struct is referenced but not defined.
	at org.apache.axis.client.Service.initService(Service.java:278)
	at org.apache.axis.client.Service.<init>(Service.java:193)
	at org.apache.axis.client.ServiceFactory.createService 
(ServiceFactory.java:232)
	at com.webobjects.webservices.client.WOWebService.axisService 
(WOWebService.java:185)
	at  
com.webobjects.webservices.client.WOWebService.createCallForOperation 
(WOWebService.java:235)
	at com.webobjects.webservices.client.WOWebServiceClient.invoke 
(WOWebServiceClient.java:482)
	at Session.<init>(Session.java:32)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native  
Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance 
(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance 
(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
	at java.lang.Class.newInstance0(Class.java:350)
	at java.lang.Class.newInstance(Class.java:303)
	at com.webobjects.foundation._NSUtilities.instantiateObject 
(_NSUtilities.java:577)
	at com.webobjects.appserver.WOApplication.createSessionForRequest 
(WOApplication.java:1611)
	at com.webobjects.appserver.WOApplication._initializeSessionInContext 
(WOApplication.java:1752)
	at  
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit 
hPreparedApplication(WOComponentRequestHandler.java:309)
	at  
com.webobjects.appserver._private.WOComponentRequestHandler._handleReque 
st(WOComponentRequestHandler.java:358)
	at  
com.webobjects.appserver._private.WOComponentRequestHandler.handleReques 
t(WOComponentRequestHandler.java:432)
	at com.webobjects.appserver.WOApplication.dispatchRequest 
(WOApplication.java:1306)
	at com.webobjects.appserver._private.WOWorkerThread.runOnce 
(WOWorkerThread.java:173)
	at com.webobjects.appserver._private.WOWorkerThread.run 
(WOWorkerThread.java:254)
	at java.lang.Thread.run(Thread.java:613)



======================================================================== 
==============================
Another example where webobjects messes up:
type in a terminal to generate stubs for a service:

# java org.apache.axis.wsdl.WSDL2Java "http://localhost:8838/cgi-bin/ 
WebObjects/HService.woa/ws/Service?wsdl"


java.io.IOException: Type {http://schemas.xmlsoap.org/soap/encoding/} 
Struct is referenced but not defined.
         at  
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined 
(SymbolTable.java:522)
         at org.apache.axis.wsdl.symbolTable.SymbolTable.add 
(SymbolTable.java:422)
         at org.apache.axis.wsdl.symbolTable.SymbolTable.populate 
(SymbolTable.java:408)
         at org.apache.axis.wsdl.symbolTable.SymbolTable.populate 
(SymbolTable.java:393)
         at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run 
(Parser.java:245)
         at java.lang.Thread.run(Thread.java:613)



This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information and/or information protected by intellectual property rights. 
If you are not the intended recipient, please note that any review, dissemination, disclosure, alteration, printing, copying or transmission of this e-mail and/or any file transmitted with it, is strictly prohibited and may be unlawful. 
If you have received this e-mail by mistake, please immediately notify the sender and permanently delete the original as well as any copy of any e-mail and any printout thereof. 
We may monitor e-mail to and from our network. 

NSS nv
Tieltstraat 167
8740 Pittem
Belgium

_______________________________________________
WebObjects-dev mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.