You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Anumodh Sreedharan <An...@infosys.com> on 2007/09/20 13:48:34 UTC

Axis 1.4 -handling simpleContent and other issues




Hi,
This mail is regarding certain issues while implementing a web service using Apache Axis 1.4. The wsdl provided to us has a particular complex type which is of the below format:

<xs:complexType name="SampleItem">
            <xs:simpleContent>
                  <xs:extension base="xs:string">
                        <xs:attribute name="sampleId" type="xs:string"/>
                        <xs:attribute name="sampleValue" type="xs:string"/>
                  </xs:extension>
            </xs:simpleContent>
      </xs:complexType>
But post implementation, the wsdl that we get after deployment has the same part in the following manner:

<complexType name=" SampleItem ">
    <simpleContent>
     <extension>
      <attribute name="_value" type="xsd:string"/>
      <attribute name=" sampleId" type="xsd:string"/>
      <attribute name=" sampleValue" type="xsd:string"/>
     </extension>
    </simpleContent>
   </complexType>
The generated one has no extension base. Also it has an extra attribute with the name "_value".

Another issue we find is that in the wsdl provided to us, we have a complex Type called SampleReference which has an object of type SampleItemList. The type SampleItemList, in turn, has an array of SampleItem objects.
But when we run the wsdl2java for generating the Transfer objects to be used, we don't get the Complex type SampleItemList generated at all. Instead, we have a complex Type (auto-generated) called ArrayOf_tns2_SampleItem.

For your reference, the procedure that we follow for the web service implementation is as follows:

 1.  The wsdl2java is run on the ws_provided.wsdl to get the data transfer objects. The ant build file used for this has the following code for wsdl2java. Note that this is a one time activity.
<target name="wsdl2java">
     <java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" failonerror="true">
                              <arg value="-o" />
                              <arg value="${gensrc}" />
                              <arg value="-a" />
                              <arg value="-s" />
                              <arg value="-S" />
                              <arg value="no" />
                              <arg value="${wsdlname}" /><!-- This is the argument where the wsdl needs to be specified-->
                              <arg value="-d${scope}" />
                              <classpath>
                                          <path refid="classpath" />
                                          <pathelement location="${build}" />
                              </classpath>
      </java>
</target>


 1.  The data transfer objects are then copied into our project, followed by the implementation of the web service.
 2.  The project build is then carried out where the wsdl2java is used just to generate the deploy.wsdd and undeploy.wsdd
     <java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" failonerror="true">
                              <arg value="-o" />
                              <arg value="${gensrc}" />
                              <arg value="-s" />
                              <arg value="-S" />
                              <arg value="no" />
                              <arg value="-c${implclass}" />
                              <arg value="${wsdlname}" />
                              <arg value="-d${scope}" />
                              <classpath>
                                          <path refid="classpath" />
                                          <pathelement location="${build}" />
                              </classpath>

      </java>
 Please do let me know about a possible solution for this at the earliest.

Thanks in advance,
Regards,
Anumodh K.S.


**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Re: Axis 1.4 -handling simpleContent and other issues

Posted by Anne Thomas Manes <at...@gmail.com>.
Edit the generated WSDD file and add a <wsdlFile> element referencing your
original WSDL file.

Anne

On 9/20/07, Anumodh Sreedharan <An...@infosys.com> wrote:
>
>
>
>
>
>
>
> *Hi,*
>
> *This mail is regarding certain issues while implementing a web service
> using Apache Axis 1.4. The wsdl provided to us has a particular complex
> type which is of the below format:*
>
> * *
>
> *<xs:complexType name="SampleItem">*
>
> *            <xs:simpleContent>*
>
> *                  <xs:extension base="xs:string">*
>
> *                        <xs:attribute name="sampleId" type="xs:string"/>*
>
> *                        <xs:attribute name="sampleValue"
> type="xs:string"/>*
>
> *                  </xs:extension>*
>
> *            </xs:simpleContent>*
>
> *      </xs:complexType>*
>
> *But post implementation, the wsdl that we get after deployment has the
> same part in the following manner:*
>
> * *
>
> *<complexType name=" SampleItem ">*
>
> *    <simpleContent>*
>
> *     <extension>*
>
> *      <attribute name="_value" type="xsd:string"/>*
>
> *      <attribute name=" sampleId" type="xsd:string"/>*
>
> *      <attribute name=" sampleValue" type="xsd:string"/>*
>
> *     </extension>*
>
> *    </simpleContent>*
>
> *   </complexType> *
>
> *The generated one has no extension base. Also it has an extra attribute
> with the name "_value".*
>
> * *
>
> *Another issue we find is that in the wsdl provided to us, we have a
> complex Type called SampleReference which has an object of type
> SampleItemList. The type SampleItemList, in turn, has an array of SampleItem
> objects.*
>
> *But when we run the wsdl2java for generating the Transfer objects to be
> used, we don't get the Complex type SampleItemList generated at all.
> Instead, we have a complex Type (auto-generated) called
> ArrayOf_tns2_SampleItem.*
>
> * *
>
> *For your reference, the procedure that we follow for the web service
> implementation is as follows:*
>
>    1. *The wsdl2java is run on the ws_provided.wsdl to get the data
>    transfer objects. The ant build file used for this has the following
>    code for wsdl2java. Note that this is a one time activity.*
>
> *<target name="wsdl2java">*
>
> *     <java classname="org.apache.axis.wsdl.WSDL2Java" fork="true"
> failonerror="true">*
>
> *                              <arg value="-o" />*
>
> *                              <arg value="${gensrc}" />*
>
> *                              <arg value="-a" />*
>
> *                              <arg value="-s" />*
>
> *                              <arg value="-S" />*
>
> *                              <arg value="no" />*
>
> *                              <arg value="${wsdlname}" /><!-- This is the
> argument where the wsdl needs to be specified-->*
>
> *                              <arg value="-d${scope}" />*
>
> *                              <classpath>*
>
> *                                          <path refid="classpath" />*
>
> *                                          <pathelement
> location="${build}" />*
>
> *                              </classpath>*
>
> *      </java>*
>
> *</target>*
>
> *
> * **
>
>    1. *The data transfer objects are then copied into our project,
>    followed by the implementation of the web service.* **
>    2. *The project build is then carried out where the wsdl2java is
>    used just to generate the deploy.wsdd and undeploy.wsdd*
>
> *     <java classname="org.apache.axis.wsdl.WSDL2Java" fork="true"
> failonerror="true">*
>
> *                              <arg value="-o" />*
>
> *                              <arg value="${gensrc}" />*
>
> *                              <arg value="-s" />*
>
> *                              <arg value="-S" />*
>
> *                              <arg value="no" />*
>
> *                              <arg value="-c${implclass}" />*
>
> *                              <arg value="${wsdlname}" />*
>
> *                              <arg value="-d${scope}" />*
>
> *                              <classpath>*
>
> *                                          <path refid="classpath" />*
>
> *                                          <pathelement
> location="${build}" />*
>
> *                              </classpath>*
>
> * *
>
> *      </java>***
>
> * Please do let me know about a possible solution for this at the
> earliest.*
>
> * *
>
> *Thanks in advance,*
>
> *Regards,*
>
> *Anumodh K.S.*
>  **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely for the use of the addressee(s). If you are not the intended
> recipient, please notify the sender by e-mail and delete the original
> message. Further, you are not to copy, disclose, or distribute this e-mail
> or its contents to any other person and any such actions are unlawful. This
> e-mail may contain viruses. Infosys has taken every reasonable precaution to
> minimize this risk, but is not liable for any damage you may sustain as a
> result of any virus in this e-mail. You should carry out your own virus
> checks before opening the e-mail or attachment. Infosys reserves the right
> to monitor and review the content of all messages sent to or from this
> e-mail address. Messages sent to or from this e-mail address may be stored
> on the Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>