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 McCaslin Orion <mc...@bah.com> on 2003/01/08 02:49:48 UTC
passing HashMap from Java to .Net (C#)
I have a simple service with one function that returns a java.util.Map
When I try to Create the Web Reference in .Net, it fails saying:
Reference.map(1): Custom tool error: Unable to important WebService/Schema.
Unable to import binding 'ElementServiceSoapBinding' from namespace
'http://mapService.service.com'. Unable to import operation 'getMap'. Object
reference not set to an instance of an object.
MapService Class function:
public java.util.Map getMap() {
System.out.println("IN Map Service: getMap()");
java.util.Map testMap = new java.util.HashMap();
return testMap;
}
AXIS v1.0
WSDL:
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://mapService.service"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://mapService.service"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema targetNamespace="http://xml.apache.org/xml-soap">
<s:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<s:complexType name="Map">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="item">
<s:complexType>
<s:all>
<s:element name="key" type="s:anyType" />
<s:element name="value" type="s:anyType" />
</s:all>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
<s:element name="Map" nillable="true" type="s0:Map" />
</s:schema>
</types>
<message name="getMapRequest" />
<message name="getMapResponse">
<part name="getMapReturn" type="s0:Map" />
</message>
<portType name="MapService">
<operation name="getMap">
<input name="getMapRequest" message="tns:getMapRequest" />
<output name="getMapResponse" message="tns:getMapResponse" />
</operation>
</portType>
<binding name="MapServiceSoapBinding" type="tns:mapService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
<operation name="getMap">
<soap:operation soapAction="" />
<input name="getMapRequest">
<soap:body use="encoded" namespace="http://mapService.service"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output name="getMapResponse">
<soap:body use="encoded" namespace="http://mapService.service"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
</binding>
<service name="MapServiceService">
<port name="MapService" binding="tns:mapServiceSoapBinding">
<soap:address location="http://honda/tia/services/mapService" />
</port>
</service>
</definitions>