我用JAVA写了一个WEBSERVICES里面定义了一个返回二维数组的方法,然后我在.NET里面调用这个WEBSERVICES,问题出来了.NET里面默认为一维数组。做了多次测试还是一样!

解决方案 »

  1.   

    你在.net里写个dataset返回到java, java也认吗???
      

  2.   

    这是JAVA写的WEBSERVICES内容
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <wsdl:definitions targetNamespace="http://192.168.11.248:8080/frk/CalcService.jws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://192.168.11.248:8080/frk/CalcService.jws" xmlns:intf="http://192.168.11.248:8080/frk/CalcService.jws" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <wsdl:types>
    - <schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> 
    - <complexType name="mapItem">
    - <sequence>
      <element name="key" nillable="true" type="xsd:string" /> 
      <element name="value" nillable="true" type="xsd:string" /> 
      </sequence>
      </complexType>
    - <complexType name="Map">
    - <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="item" type="apachesoap:mapItem" /> 
      </sequence>
      </complexType>
      </schema>
    - <schema targetNamespace="http://192.168.11.248:8080/frk/CalcService.jws" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> 
    - <complexType name="ArrayOf_xsd_string">
    - <complexContent>
    - <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" /> 
      </restriction>
      </complexContent>
      </complexType>
    - <complexType name="ArrayOfArrayOf_xsd_string">
    - <complexContent>
    - <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[][]" /> 
      </restriction>
      </complexContent>
      </complexType>
      </schema>
      </wsdl:types>
    - <wsdl:message name="addRequest">
      <wsdl:part name="p1" type="xsd:int" /> 
      </wsdl:message>
    - <wsdl:message name="addResponse">
      <wsdl:part name="addReturn" type="apachesoap:Map" /> 
      </wsdl:message>
    - <wsdl:message name="getStringResponse">
      <wsdl:part name="getStringReturn" type="impl:ArrayOf_xsd_string" /> 
      </wsdl:message>
      <wsdl:message name="getString2Request" /> 
    - <wsdl:message name="subtractResponse">
      <wsdl:part name="subtractReturn" type="xsd:int" /> 
      </wsdl:message>
    - <wsdl:message name="subtractRequest">
      <wsdl:part name="p1" type="xsd:int" /> 
      <wsdl:part name="p2" type="xsd:int" /> 
      </wsdl:message>
    - <wsdl:message name="getString2Response">
      <wsdl:part name="getString2Return" type="impl:ArrayOfArrayOf_xsd_string" /> 
      </wsdl:message>
    - <wsdl:message name="getHashMapResponse">
      <wsdl:part name="getHashMapReturn" type="apachesoap:Map" /> 
      </wsdl:message>
      <wsdl:message name="getStringRequest" /> 
      <wsdl:message name="getHashMapRequest" /> 
    - <wsdl:portType name="CalcService">
    - <wsdl:operation name="add" parameterOrder="p1">
      <wsdl:input message="impl:addRequest" name="addRequest" /> 
      <wsdl:output message="impl:addResponse" name="addResponse" /> 
      </wsdl:operation>
    - <wsdl:operation name="getString">
      <wsdl:input message="impl:getStringRequest" name="getStringRequest" /> 
      <wsdl:output message="impl:getStringResponse" name="getStringResponse" /> 
      </wsdl:operation>
    - <wsdl:operation name="subtract" parameterOrder="p1 p2">
      <wsdl:input message="impl:subtractRequest" name="subtractRequest" /> 
      <wsdl:output message="impl:subtractResponse" name="subtractResponse" /> 
      </wsdl:operation>
    - <wsdl:operation name="getHashMap">
      <wsdl:input message="impl:getHashMapRequest" name="getHashMapRequest" /> 
      <wsdl:output message="impl:getHashMapResponse" name="getHashMapResponse" /> 
      </wsdl:operation>
    - <wsdl:operation name="getString2">
      <wsdl:input message="impl:getString2Request" name="getString2Request" /> 
      <wsdl:output message="impl:getString2Response" name="getString2Response" /> 
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="CalcServiceSoapBinding" type="impl:CalcService">
      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 
    - <wsdl:operation name="add">
      <wsdlsoap:operation soapAction="" /> 
    - <wsdl:input name="addRequest">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" /> 
      </wsdl:input>
    - <wsdl:output name="addResponse">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.11.248:8080/frk/CalcService.jws" use="encoded" /> 
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="getString">
      <wsdlsoap:operation soapAction="" /> 
    - <wsdl:input name="getStringRequest">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" /> 
      </wsdl:input>
    - <wsdl:output name="getStringResponse">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.11.248:8080/frk/CalcService.jws" use="encoded" /> 
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="subtract">
      <wsdlsoap:operation soapAction="" /> 
    - <wsdl:input name="subtractRequest">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" /> 
      </wsdl:input>
    - <wsdl:output name="subtractResponse">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.11.248:8080/frk/CalcService.jws" use="encoded" /> 
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="getHashMap">
      <wsdlsoap:operation soapAction="" /> 
    - <wsdl:input name="getHashMapRequest">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" /> 
      </wsdl:input>
    - <wsdl:output name="getHashMapResponse">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.11.248:8080/frk/CalcService.jws" use="encoded" /> 
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="getString2">
      <wsdlsoap:operation soapAction="" /> 
    - <wsdl:input name="getString2Request">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" /> 
      </wsdl:input>
    - <wsdl:output name="getString2Response">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.11.248:8080/frk/CalcService.jws" use="encoded" /> 
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="CalcServiceService">
    - <wsdl:port binding="impl:CalcServiceSoapBinding" name="CalcService">
      <wsdlsoap:address location="http://192.168.11.248:8080/frk/CalcService.jws" /> 
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>