RE: complex types

[email protected]
Newsgroups gmane.comp.apache.webservices.wsif.user
Message-ID <OF0916939A.E1D58589-ON0525707D.004A16CE-0525707D.004A16D7@assist.com.co>
Hi

It seems that you are right

Actually I have used this whit the distribution version and WebSphere
Application Server V5.1
So that will be like:
wsif.jar  --> 2.0
axis-1_0.jar
wsdl4j-20021124.jar
(All the jars all included with the distribution version of wsif)

For WAS they use the same version but they modified the code so I don’t
really know the versions.

I can not send my code because I created a kind of wrapper for WSIF so
other users just write configuration files so I’m attaching the wsif code
that matters.
---------------------------------------

private static WSIFServiceFactory factory =
WSIFServiceFactory.newInstance();
---
                 service = factory.getService(
    wsdlLoc,
    serviceNS,
    serviceName,
    portTypeNS,
    portTypeName);

  // map types
  if (namespaceURI != null && localPart != null && className != null) {
   for (int x = 0; x < namespaceURI.length; x++) {
    service.mapType(
     new QName(namespaceURI[x], localPart[x]),
     Class.forName(className[x]));
   }
  }
  // get the port
  if (portName == null) {
   port = service.getPort();
  } else {
   port = service.getPort(portName);
  }
  // create the operation
  if (operationName != null
   && operationInputName != null
   && operationOutputName != null) {
   operation =
    port.createOperation(
     operationName,
     operationInputName,
     operationOutputName);
  } else {
   operation = port.createOperation(operationName);
  }
  // create the input, output and fault messages associated with this
  operation
  input = operation.createInputMessage();
  output = operation.createOutputMessage();
  fault = operation.createFaultMessage();

----------------------

  if (serviceImpl.getOperation().executeRequestResponseOperation(
   serviceImpl.getInput(), serviceImpl.getOutput(),
   serviceImpl.getFault())) {
   logger.info("invocation succeeded......");
   // invocation succeeded, extract information from output message

   result =
   serviceImpl.getOutput().getObjectPart(serviceImpl.getOutputName()[0]);

---------------------------------------

Mauro, if you still thinks that my code will help let me know.
How are the vectors defined in the wsdl? I have used them as inputs and
outputs.

bye
___________________________________
Juan David Pérez
Assist

-----"Luca Baldi" <[email protected]> wrote: -----


To: <[email protected]>, <[email protected]>
From: "Luca Baldi" <[email protected]>
Date: 09/15/2005 04:06AM
Subject: RE: complex types

Hi there.
I had a wee look at past emails, and it seems like there is some kind of
conflict with wsif.jar, axis.jar and wsdl4j.jar.
What versions are you using of the above ??
I have the latest wsif-2.0.jar, axis-1.2.1.jar and wsdl-1.5.jar.

Here's the link

http://marc.theaimsgroup.com/?l=wsif-user&m=111514929925689&w=2

I am not sure there is a way round.

Luca

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: 15 September 2005 04:45
To: [email protected]; [email protected]
Cc: [email protected]
Subject: Re: complex types

Hi Juan,

I tried again with the following code:

public class DocWSDLComplex {

  public static void main( String[] args ) {

    Service serviceWsdl = null;
    PortType portTypeWsdl = null;
    String serviceNS = null;
    String serviceName = null;
    String portTypeNS = null;
    String portTypeName = null;

    String wsdlLoc =
    "http://localhost:8080/axis/services/AverageCalculator?wsdl";

    try {

    WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
    WSIFService service = factory.getService( wsdlLoc, serviceNS,
    serviceName,
portTypeNS, portTypeName );
    }
    catch( WSIFException e ) {

        e.printStackTrace();
    }
  }

}

Unfortunately it did not happen. In my wsdl file I have a Vector as an
input
parameter. Do you have any example code that I can test ? any idea ?

Cheers,
Mauro Monteiro.


Citando [email protected]:

>
> Hi
>
> I don’t know what your problem is; actually I’m using WSIF with
simple
> and
> complex types. There is one difference in my code I don’t get the
service
> instance this way:
>
> WSIFService service = factory.getService(def, serviceWsdl, portTypeWsdl);
>
> But passing the wsdl location like this:
>
> service = factory.getService(wsdlLoc, serviceNS, serviceName, portTypeNS,
> portTypeName);
>
> I took a look into the code and I found out that they load the wsdl this
> way if I pass the wsdl location no the definition:
>
>         try {
>             def = WSIFUtils.readWSDL(null, wsdlLoc, cl);
>             checkWSDL(def);
>         } catch (WSDLException ex) {
>             Trc.exception(ex);
>             throw new WSIFException("could not load " + wsdlLoc, ex);
>         }
>
> You may be missing the check of the wsdl. I would give a chance to try
this
> method:
>
> getService(String wsdlLoc, String serviceNS, String serviceName, String
> portTypeNS, String portTypeName)
>
> Hope this helps
>
> ___________________________________
> Juan David Pérez
> Assist
>
>
>
> [email protected] wrote: -----
>
>
> To: [email protected], Luca Baldi
> From: [email protected]
> Date: 09/14/2005 03:40PM
> cc: [email protected]
> Subject: Re: complex types
>
> Hi everyone,
>
> I am trying to do the same thing that luca tried and I've received the
same
> message error. What can we do ?
>
> Cheers,
> Mauro Monteiro.
>
> Citando Luca Baldi :
>
> > When I try to run
> >
> >
> >
> > Definition def = WSIFUtils.readWSDL(null,wsdl);
> >
> >
> >
> > ......
> >
> >
> >
> > WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
> >
> >
> >
> > WSIFService service = factory.getService(def, serviceWsdl,
> > portTypeWsdl);
> >
> >
> >
> > If the wsl file contains complex types, I get
> >
> >
> >
> > java.lang.ClassCastException
> >
> >       at
org.apache.wsif.compiler.util.Utils.addAllTypesElements(Unknown
> > Source)
> >
> >       at
org.apache.wsif.compiler.util.Utils.getAllTypesElements(Unknown
> > Source)
> >
> >       at
> > org.apache.wsif.base.WSIFServiceImpl.getDefaultTypeMappings(Unknown
> > Source)
> >
> >       at org.apache.wsif.base.WSIFServiceImpl.getAllCustomTypes(Unknown
> > Source)
> >
> >       at org.apache.wsif.base.WSIFServiceImpl.init(Unknown Source)
> >
> >       at org.apache.wsif.base.WSIFServiceImpl.(Unknown Source)
> >
> >       at org.apache.wsif.base.WSIFServiceFactoryImpl.getService(Unknown
> > Source)
> >
> >
> >
> > any idea ??
> >
> > thanks
> >
> >
> >
> > luca
> >
> >
> >
> >
>
>
>
>
>  ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.




 ----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.