AXIS2如何才能返回以下这样数据?注意返回有多个值。<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NS1:SAS_GetRecordsResponse xmlns:NS1="http://www.borland.com/namespaces/Types">
<return xsi:type="xsd:base64Binary">BR0UIAAQAAAAAAAAAAAAIc</return>
<RecsOut xsi:type="xsd:int">2</RecsOut>
<NS1:Params xsi:NULL="true"/>
<NS1:OwnerData xsi:NULL="true"/>
</NS1:SAS_GetRecordsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>这个返回值对应调用的xml是,请注意Params和OwnerData和上边是人返回是同一个名字。
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NS1:SAS_GetRecords xmlns:NS1="http://www.borland.com/namespaces/Types">
<ProviderName xsi:type="xsd:string">prvTestSoap</ProviderName>
<Count xsi:type="xsd:int">100</Count>
<Options xsi:type="xsd:int">1</Options>
<CommandText xsi:type="xsd:string">SELECT * FROM T_TEST_SOAP</CommandText>
<NS1:Params xsi:NULL="true"/>
<OwnerData xsi:type="xsd:string"/>
</NS1:SAS_GetRecords>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

解决方案 »

  1.   

    你可以把这多个值整合到一个object中
      

  2.   

    试过了,返回的数据式不是我想要的。如果是一个Object会在SAS_GetRecordsResponse里多了一个return标记,这个标记把其它属性包括在内,比如:<?xml version="1.0"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <NS1:SAS_GetRecordsResponse xmlns:NS1="http://www.borland.com/namespaces/Types">
    <return xmlns:p0="http://tempuri.org/">
    <return xsi:type="xsd:base64Binary">BR0UIAAQAAAAAAAAAAAAIc </return>
    <RecsOut xsi:type="xsd:int">2 </RecsOut>
    <NS1:Params xsi:NULL="true"/>
    <NS1:OwnerData xsi:NULL="true"/>
    </return>
    </NS1:SAS_GetRecordsResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope> 
      

  3.   

    补充一下,我使用的环境实际上不是axis2,而是tuscany 1.4,不清楚这个是否有影响。