简体   繁体   English

想要在WSDL中将true设置为boolean

[英]Want to set true to boolean in WSDL

We are Creating a WSDL for soap request , where we have a boolean variable. 我们正在为soap request创建一个WSDL,其中有一个布尔变量。 As we know boolean is by default "false". 众所周知,默认情况下,布尔值是“ false”。 But we need to have it as true. 但是我们需要将其视为真实。

I wanted to know where to set this value to true. 我想知道在哪里将此值设置为true。 So even if the variable is not set, it will take as True. 因此,即使未设置变量,它也将作为True。 Please advice. 请指教。

thanks in advance. 提前致谢。

** More info: ** ** 更多信息: **

<complexType name="User">
<sequence>
 <element name="IMAddress" nillable="true" type="soapenc:string"/>
 <element name="**active**" type="xsd:boolean"/>
 <element name="address" nillable="true" type="soapenc:string"/>

so, i want my wsdl to have a variable active to be default true. 因此,我希望我的wsdl具有一个活动变量,默认为true。 My WSDL is a "WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)" 我的WSDL是“由Apache Axis版本创建的WSDL:1.4构建于2006年4月22日(太平洋夏令时间06:55:48)”

    <!-- Create wsdl file -->
    <java classname="org.apache.axis.wsdl.Java2WSDL" fork="true" failonerror="true">
        <classpath refid="axis-classpath" />
  <jvmarg value="-Dlog4j.configuration=file:${env.log4j.configuration}"/>
        <arg value="--output" /> <arg value="${service}.wsdl" />
 </java>

i tried setting the active variable to be true in my User bean, but that did not help. 我试图在我的用户bean中将活动变量设置为true,但这没有帮助。

<xsd:element name="isCaseSensitive" type="xsd:boolean" default="false"/>

Or set Annotation to the field in a class : 或将Annotation设置为类中的字段:

@XmlElement(defaultValue = "false")
private boolean isCaseSensitive;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM