Hi !
I ran into exactly the same problem recently I think.
I was surpised how undocumented this is, but the solution was to call :
registerFactoriesForClassWithQName
on The WOWebServiceClient. It seems calling this method on the
WOWebServiceRegistrar is good for making WebServices vailable and
calling it on WOWebServiceClient is good for consuming them.
Tell me if I was wrong !
Regards
Fabrice
www.easyshadow.com
International Corporate Consulting
Palais de la Scala
1 avenue Henri Dunant
Suite 1155
MC - 98000 Monaco
Skype: fabrice.pipart
Tel. +377 97 98 21 04 (direct)
Fax. +377 97 70 88 07
Le 27 avr. 07 à 18:03, jerry porter a écrit :
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/fabrice%
40easyshadow.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]