I'm a bit confused with what you are trying to do.
The MessagePartInfo.getTypeClass() call should be returning the Class objects
that you need. When you call opInfo = opInfo.getUnwrappedOperation();, you
are getting the operation in the unwrapped form so the parameters in the
operation are already the types that you need for when you call the
client.invoke.
However, you could NOT call getUnwrappedOperation and work with the wrapped
operation directly. The getMessageParts call should just return a single
part representing the full wrapper type. The getTypeClass() call on that
would return a class for the full wrapper that you could "new instance" and
use real reflection and such on it.
Dan
On Thursday 04 November 2010 6:38:11 am Martin Loeffelholz wrote:
> Hello Folks,
>
> I'm working on a way to describe webservices for usage within an
> agent-platform. To make it possible that softwareagents on this platform
> can use it I need to read out informations about the classes needed to
> invoke the service. Eventually I need the name of the parameterclass and
> a classobject of that class.
>
> At the moment I try to get these informations from the dynamicClient
> created with the DynamicClientFactory. Which seems to work fine for
> RPC/literal services.
>
> As using document/literal the only messagepart encapsulates the true
> parameters of the invoke call. And that's where the trouble starts.
>
> I managed to get the name of the classes involved (listing included
> below), but I need to get classobjects for these classes at runtime
> without knowing anything about them at coding time.
>
> Does somebody know how to get a classobject from the parameters and
> perhaps some informations about the minOccur and maxOccur properties of
> these parameters?
>
>
> Collection<BindingOperationInfo> binOpInfos =
> dynamicClient.getEndpoint().getBinding().getBindingInfo().getOperations();
>
> for (BindingOperationInfo opInfo : binOpInfos){
>
> ArrayList<Class<?>> inputs = new ArrayList<Class<?>>();
> ArrayList<String> inputTypeNames = new ArrayList<String>();
>
> if (!opInfo.isUnwrapped() && opInfo.isUnwrappedCapable()){
> opInfo = opInfo.getUnwrappedOperation();
> }
> BindingMessageInfo mesInputInfo = opInfo.getInput();
> BindingMessageInfo mesOutputInfo = opInfo.getOutput();
>
> // processing input
> for ( MessagePartInfo part : mesInputInfo.getMessageParts()){
>
> if (part.isElement()){
> // document/literal wrapped
>
> for (Field f: part.getTypeClass().getDeclaredFields()){
> ParameterizedTypeImpl parmTI =
> (ParameterizedTypeImpl)
> f.getGenericType();
> for (Type t : parmTI.getActualTypeArguments()){
> //adding typename of arguments to the
> list:
>
> inputTypeNames.add(t.toString().substring(6));
> }
> }
> } else {
> }
> }
> }
>
> hopeful greetings
> Martin
--
Daniel Kulp
[email protected]
http://dankulp.com/blog