facebook

Problem with booleans in web service client

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #271637 Reply

    io.mismo
    Member

    Hello,

    I have a problem with a webservice generated with MyEclipse 5.1.0 GA and XFire. I tried to generate web service client, I have some methods with boolean parameters that works correctly but in two cases the boolean parameters are not boolean but objects with String id(?) and boolean value, and in one case from original boolean value only object with a String id and not boolean inside. I put manually a boolean value in generated object and it works but it is very strange. Example:

    WSDL code:
    – <xsd:element name=”buscarVersion”>
    – <xsd:complexType>
    – <xsd:sequence>
    <xsd:element maxOccurs=”1″ minOccurs=”1″ name=”codigoVersion” nillable=”true” type=”xsd:string” />
    <xsd:element maxOccurs=”1″ minOccurs=”1″ name=”idUsuario” nillable=”true” type=”xsd:string” />
    <xsd:element maxOccurs=”1″ minOccurs=”1″ name=”buscarAdjuntosVersion” type=”xsd:boolean” />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    – <xsd:element name=”buscarVersionResponse”>
    – <xsd:complexType>
    – <xsd:sequence>
    <xsd:element maxOccurs=”1″ minOccurs=”1″ name=”out” nillable=”true” type=”ns1:Version” />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>

    Generated method in client:
    @WebMethod(operationName = “buscarVersion”, action = “”)
    @WebResult(name = “out”, targetNamespace = “http://ouput.services.expedientes.archivo.com&#8221;)
    public Version buscarVersion(
    @WebParam(name = “codigoVersion”, targetNamespace = “http://ouput.services.expedientes.archivo.com&#8221;)
    String codigoVersion,
    @WebParam(name = “idUsuario”, targetNamespace = “http://ouput.services.expedientes.archivo.com&#8221;)
    String idUsuario,
    @WebParam(name = “buscarAdjuntosVersion”, targetNamespace = “http://ouput.services.expedientes.archivo.com&#8221;)
    BuscarAdjuntosVersion buscarAdjuntosVersion);

    Generated object in client:
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = “”, propOrder = {
    “codigoVersion”
    })
    @XmlRootElement(name = “buscarAdjuntosVersion”)
    public class BuscarAdjuntosVersion {

    @XmlElement(required = true, nillable = true)
    protected String codigoVersion;
    //…. Getters and setters … //
    }

    This method doesn’t works, I need a boolean value buscarAdjuntosVersion and I have a Object BuscarAdjuntosVersion with a String inside codigoVersion (that is another value of the method…). I put manually this in object BuscarAdjuntosVersion:

    Manually:
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = “”, propOrder = {
    “codigoVersion”,
    “buscarAdjuntosVersion ”
    })
    @XmlRootElement(name = “buscarAdjuntosVersion”)
    public class BuscarAdjuntosVersion {

    @XmlElement(required = true, nillable = true)
    protected String codigoVersion;
    protected boolean buscarAdjuntosVersion ;
    //… getters and setters… //
    }

    And to call the method (servicioWebExpedientesArchivoDigital is a instance of the service):
    public Version buscarVersion(String codigoVersion, String idUsuario, boolean buscarAdjuntosVersion) throws Exception{
    BuscarAdjuntosVersion objeto = new BuscarAdjuntosVersion();
    objeto.setBuscarAdjuntosVersion (buscarAdjuntosVersion);
    return servicioWebExpedientesArchivoDigital.buscarVersion(codigoVersion, idUsuario, objeto);
    }

    It works, but I can’t understand why MyEclipse generates this code with the web service client. I tried to generate the web service client with JBuilder and it runs perfectly. I tried with Boolean objects and still have the problem. Have I done something wrong?

    Thanks!!

    #271680 Reply

    Loyal Water
    Member

    Hi io.mismo,
    I have asked some one from the development team to take a look at this issue. He will get back to you with an update ASAP.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Problem with booleans in web service client

You must be logged in to post in the forum log in