Woh, deja vue.

Hi Peter,

Its not really clear why you are doing anything to do with unwrapping
parts? WSIF should be doing all that for you under the covers for both the
stub and DII interface. Just make the WSIF call and WSIF should work out if
you're parameters match wrapped or unwrapped parts. There are a couple of
circumstances where WSIF gets this wrong, I'm in the middle of trying to
make this more robust. but for the moment sometimes you have to tell WSIF
which to use. I think this is what's going wrong with you stub calls.

You tell WSIF you want to use wrapped or unwrapped parts by setting a part
in the context method, for example this code should fix the stub problem:

   WSIFService service =
      factory.getService(
         "bin/ogsa/counter.wsdl",
         "http://samples.ogsa.globus.org/counter";,
         "CounterService",
         "http://samples.ogsa.globus.org/counter/counter_port_type";,
         "CounterPortType");

   WSIFMessage ctx = service.getContext();
   ctx.setObjectPart(
      WSIFConstants.CONTEXT_OPERATION_STYLE,
      WSIFConstants.CONTEXT_OPERATION_STYLE_WRAPPED);
   service.setContext(ctx);

   CounterPortType stub =
      (CounterPortType) service.getStub(portName, CounterPortType.class);


      ...ant

Anthony Elder
[EMAIL PROTECTED]
Web Services Development
IBM UK Laboratories,  Hursley Park
(+44) 01962 818320, x248320, MP208.


"Peter G. Lane" <[EMAIL PROTECTED]> on 04/03/2003 18:46:21

Please respond to [EMAIL PROTECTED]

To:    [EMAIL PROTECTED]
cc:
Subject:    DII code not working anymore/dynamic stub failing



I'm having trouble with one of the latest nightly build jars.  I had DII
working last month, but recent changes seemed to have prevented further
success.  One thing I noticed is that unWrapPart() is deprecated.  I'm a
little nervous now about what I should be doing in lieu of that since I
use getWrappedDocLiteralPart() which is not deprecated and implies I'd
have to then unwrap it.  It looks like this is causing problems with the
DII method:

      [java] Exception in thread "main" java.lang.ClassCastException:
org.apache.wsif.schema.ElementType
      [java]     at
org.apache.wsif.providers.ProviderUtils.getComplexType(ProviderUtils.java:389)
      [java]     at
org.apache.wsif.providers.ProviderUtils.unWrapPart(ProviderUtils.java:343)
      [java]     at
org.apache.wsif.util.WSIFUtils.unWrapPart(WSIFUtils.java:1355)


I'm also having trouble using getStub().  I get a proxy object which I
verify is of the correct interface and has the correct methods using
java.lang.reflect stuff, but I get an error saying that the method I'm
trying to call from the stub was not found in the port type:

...
      [java] 3185 [main] DEBUG
org.globus.ogsa.client.wsif.samples.BasicCounterAdder  - Method: public
final int $Proxy0.add(int) throws java.rmi.RemoteException
...
      [java] org.apache.wsif.WSIFException: Method add(int) was not
found in portType {http://ogsa.globus.org/samples/counter}CounterPortType
      [java]     at
org.apache.wsif.base.WSIFClientProxy.findMatchingOperation(WSIFClientProxy.java:595)
      [java]     at
org.apache.wsif.base.WSIFClientProxy.invoke(WSIFClientProxy.java:244)
      [java]     at $Proxy0.add(Unknown Source)
      [java]     at
org.globus.ogsa.client.wsif.samples.BasicCounterAdder.<init>(BasicCounterAdder.java:83)

      [java]     at
org.globus.ogsa.client.wsif.samples.BasicCounterAdder.main(BasicCounterAdder.java:101)



Thanks!
Peter




Reply via email to