Comparison between flex webserivce and axis 1.2rc2)

Source: Internet
Author: User
It is true that the WebService is self-contained in flex. the jar package encapsulates axis and should be changed (I have never seen any instructions on MM about the change ), recently, we plan to use the new axis 1.2rc2 to replace the flex built-in Web service, but this is the case.

Original server-config.wsdd configuration file is as follows:
<Service name = "fashionservice" provider = "Java: RPC">

<Parameter name = "methodname" value = "getcategorylist, getitemlistbycategoryid"/>

<Parameter name = "classname" value = "fashion. Items. fashionservice"/>

<Beanmapping languagespecifictype = "Java: Fashion. Items. Item" QNAME = "ns4: item" xmlns: ns4 = "http: // localhost: 8080/fashionservice"/>

<Beanmapping languagespecifictype = "Java: Fashion. Items. Category" QNAME = "ns4: Category" xmlns: ns4 = "http: // localhost: 8080/fashionservice"/>

</Service>

Getcategorylist and getitemlistbycategoryid return the arraylist of the category and item objects.

After being interpreted using the WebService. jar file that comes with Flex, the returned values of the two methods in the resulting WSDL are described as follows (briefly describe and omit most of them)
<WSDL: Message name = "getcategorylistresponse">

<WSDL: part name = "getcategorylistreturn" type = "soapenc: array"/>

</WSDL: Message>

<WSDL: Operation name = "getcategorylist">

<WSDL: input message = "impl: getcategorylistrequest" name = "getcategorylistrequest"/>

<WSDL: Output Message = "impl: getcategorylistresponse" name = "getcategorylistresponse"/>

</WSDL: Operation>

<WSDL: Output name = "getcategorylistresponse">

<Wsdlsoap: Body encodingstyle = "http://schemas.xmlsoap.org/soap/encoding/" namespace = "http: // localhost: 8080/fashionservice/services/fashionservice" use = "encoded"/>

</WSDL: output>

In addition, there are descriptions of the category and item objects from Java ing to XML (that is, the schema of WSDL: types, which only lists one structure of category)
<Complextype name = "category">

<Sequence>

<Element name = "data" nillable = "true" type = "XSD: string"/>

<Element name = "ID" nillable = "true" type = "XSD: string"/>

<Element name = "label" nillable = "true" type = "XSD: string"/>

<Element name = "status" nillable = "true" type = "XSD: string"/>

</Sequence>

</Complextype>

All of the preceding operations are normal. Flex can call these two web services and map objects from XML files to flex objects correctly. For example, fields such as category ID, data, and label can be referenced directly by name in flex.

However, after you replace WebService. jar of flex with axis. jar of axis 1.2rc2 and other jar packages, the problem arises.

First you can ensure that axis works properly and the server-config.wsdd configuration file remains unchanged

Get the same WSDL

While the schema of WSDL: types is changed to array, without the two pojo in beanmapping in the server-config.wsdd
<WSDL: types>

<Schema targetnamespace = "http: // localhost: 8080/fashionservice/services/fashionservice" xmlns = "http://www.w3.org/2001/XMLSchema">

<Import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>

<Complextype name = "arrayof_xsd_anytype">

<Complexcontent>

<Restriction base = "soapenc: array">

<Attribute ref = "soapenc: arraytype" WSDL: arraytype = "XSD: anytype []"/>

</Restriction>

</Complexcontent>

</Complextype>

</Schema>

</WSDL: types>

The related method definition also changes
<WSDL: Message name = "getcategorylistresponse">

<WSDL: part name = "getcategorylistreturn" type = "impl: arrayof_xsd_anytype"/>

</WSDL: Message>

<WSDL: Operation name = "getcategorylist">

<WSDL: input message = "impl: getcategorylistrequest" name = "getcategorylistrequest"/>

<WSDL: Output Message = "impl: getcategorylistresponse" name = "getcategorylistresponse"/>

</WSDL: Operation>

<WSDL: Operation name = "getcategorylist">

<Wsdlsoap: Operation soapaction = ""/>

<WSDL: input name = "getcategorylistrequest">

<Wsdlsoap: Body encodingstyle = "http://schemas.xmlsoap.org/soap/encoding/" namespace = "http://items.fashion" use = "encoded"/>

</WSDL: input>

<WSDL: Output name = "getcategorylistresponse">

<Wsdlsoap: Body encodingstyle = "http://schemas.xmlsoap.org/soap/encoding/" namespace = "http: // localhost: 8080/fashionservice/services/fashionservice" use = "encoded"/>

</WSDL: output>

</WSDL: Operation>

All of the preceding operations can work normally. The flex call to these two Web Services is also OK, but the XML file cannot be correctly mapped to the flex object, and the obtained object is an array, the value is correct. The problem is that schema is missing in WSDL. Flex cannot map XML files as objects and can only be interpreted as arrays.

Now I have to use the Web service implementation package that comes with Flex. I don't know if the comrade familiar with axis can give me some advice!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.