For JAX-WS webservices it may be a problem with the hashmap input parameter. The xsd schema generated seems to be incorrect for hashmaps. Placing the map in a wrapper object causes JAX-WS to output the correct xsd.
public class MapWrapper {
public HashMap<String, String> map;
}
// in your web service class
@WebMethod(operationName = "doSomething")
public SomeResponseObject doSomething(
@WebParam(name = "id") String id,
@WebParam(name = "page") String page,
@WebParam(name = "params") MapWrapper params {
// body of method
}
Then the php code will succeed. I found I didn't need SoapVar or SoapParam and could not get either of those methods to work without the MapWrapper.
$entry1['key'] = 'somekey';
$entry1['value'] = 1;
$params['map'] = array($entry1);
soapclient->doSomething(array('id' => 'blah', 'page' => 'blah',
'params' => $params));
Here is the correct xsd generated with the wrapper
<xs:complexType name="mapWrapper">
<xs:sequence>
<xs:element name="map">
<xs:complexType>
<xs:sequence>
<xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="key" minOccurs="0" type="xs:string"/>
<xs:element name="value" minOccurs="0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
Here is the incorrect schema generated by JAX-WS with just the hashmap
<xs:complexType name="hashMap">
<xs:complexContent>
<xs:extension base="tns:abstractMap">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="abstractMap" abstract="true">
<xs:sequence/>
</xs:complexType>
One last note. Wrapping HashMap<String, String> worked with this solution, but HashMap<String, Object> did not. The Object gets mapped to xsd:anyType which comes into the java webservice as a xsd schema object rather than just Object.