Problems setting up wo app to consume webservices
Problems setting up wo app to consume webservices
- Subject: Problems setting up wo app to consume webservices
- From: jerry porter <email@hidden>
- Date: Fri, 27 Apr 2007 09:03:19 -0700 (PDT)
Hello,
I am trying to use WO to produces and consume WebServices and I am running into problems serializing and deserializing Complex Objects.
I have looked at the mailing list archives but did not see a solution.
I am running WO 5.22 on windows.
I started with the Calculator client / server examples and got that to work.
I tried to extend it by adding a method to the Calculator class like:
public String[] myStringMethod() {
String[] array = new String[3];
array[0] = "0";
array[1] = "1";
array[2] = "2";
return array;
}
In the server and client app's Application class I added this code which I call in my constuctor:
private static void registerArraySerializers() {
registerArray(java.lang.String[].class, new QName("urn:MyService", "string[]"));
}
private static void registerArray(Class bean, QName qname) {
WOWebServiceRegistrar.registerFactoriesForClassWithQName(new ArraySerializerFactory(), new ArrayDeserializerFactory(), bean, qname);
}
I then added a button to the Main page of the client to invoke this like:
public WOComponent fetchStringMethod() {
try {
Object result = fetcher_client.invoke("myStringMethod", null);
System.out.println(result.getClass().getName());
} catch (Exception e) {
e.printStackTrace();
}
return context().page();
}
This works fine.
Then I extended the pattern to try a Complex object such as a HashMap.
private static void registerHashMapSerializers() {
registerMap(java.util.HashMap.class, new QName("urn:HierarchyServices", "HashMap"));
}
private static void registerMap(Class bean, QName aName) {
WOWebServiceRegistrar.registerFactoriesForClassWithQName(new BeanSerializerFactory(bean, aName), new BeanDeserializerFactory(bean, aName), bean, aName);
}
However I get a number of errors like:
stackTrace: org.xml.sax.SAXException: Deserializing parameter 'myHashMap
MethodReturn': could not find deserializer for type {urn:HierarchyServices}HashMap
Any help or code snippets would be helpful.
Jerry Porter
IT Distribution MS 34-202
Lincoln Financial Group
One Commerce Square
2005 Market Street
Philadelphia, PA 19103
(215) 255-7031
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden