Hi Nelson, I'm not sure but I you could be creating alot of work for yourself. http://www.nabble.com/Creating-a-Serializer-for-JiBX-altered-classes-td1 4327762.html is a similar issue. There is an overview below to get you started.
You should use the tools that muse provides to generate a proxy class for your client (http://ws.apache.org/muse/docs/2.2.0/tutorial/03-wsdl2java.html#Section 4), it will derive from SimpleResourceClient or org.apache.muse.ws.notification.remote.NotificationProducerClient if you are using notifications. In the generated code you can specify complex return types. EndpointReferences aren't automatically provided though, so you use code like: GeneratedResourceProxy resource = new GeneratedResourceProxy( targetEPR, sourceEPR ); EndpointReference epr = new EndpointReference( resource.getPropertyOrCallOperationThatReturnsAnEpr() ); getPropertyOrCallOperationThatReturnsAnEpr() in this case returns an Element from the generated proxy. To add complicated return types (here ResourcePartResponse is a custom type) to your proxy you can use serializers like this: public ResourcePartResponse retrieveResourcePart(String uri, long start, long length) throws SoapFault { Object[] params = new Object[3]; params[0] = uri; params[1] = new Long(start); params[2] = new Long(length); ProxyHandler handler = getHandler("retrieveResourcePart"); return (ResourcePartResponse) rpSer.fromXML( (Element)invoke(handler, params) ); } rpSer is a org.apache.muse.core.serializer.Serializer, that can also then be used inside of your capabilities by muse in muse.xml: <custom-serializer> <java-serializable-type>com.swisscom.sif.esb.service.resourceTransfer.Re sourcePartResponse</java-serializable-type> <java-serializer-class>com.swisscom.sif.esb.service.resourceTransfer.Res ourcePartResponseSerializer</java-serializer-class> </custom-serializer> where the ResourcePartResponse is a custom type that you can add to your generated interfaces. cheers, Chris -----Original Message----- From: Nelson Kotowski [mailto:[EMAIL PROTECTED] Sent: Thursday, January 17, 2008 2:13 AM To: [email protected] Subject: Different Return Type - SimpleResourceClient.java Hello everyone, I have a little doubt. I would like to know how to return a EndpointReference type in a method inside SimpleResourceClient.java, from the wsrf example. Something like this works fine... public String mycapability() throws SoapFault { Element body = XmlUtils.createElement(mycapability.CAPABILITY_OP_QNAME); Element response = invoke(mycapability.CAPABILITY_OP_URI, body); return XmlUtils.extractText(response); } But if I want to return a different type, like the EndpointReference, has anyone ever had a similar experience? If so, how did you manage to return "non-primitive" types? Best regards, Nelson P Kotowski Filho. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
