array(
  array('name'=>'email', 'value'=>'[email protected]'),
  array('name'=>'firstname', 'value'=>'Arjan'),
  array('name'=>'lastname', 'value'=>'Haverkamp')
)
调用一个webservice方法时遇到的我试着转换成了,数组(hashmap,hashmap,hashmap)这种方式,报参数类型不匹配异常。 不会PHP啊,高手帮忙解决一下吧。

解决方案 »

  1.   

    不要在传递webservice的时候 放一些数组之类的信息。。
    可以使用xml的形式进行传递.
    <array>
        <array>
              <name></name>
        </array>
     .....
    </array>现在的ws 不同的语言之间 基本都是传递简单的字符串
      

  2.   

    那这种XML格式的参数我这么写对么?
    格式是:<xsd:complexType name="NewRecipientType">
    <xsd:sequence>
    <xsd:complexType name="RecipientNameValuePairType">
    <xsd:sequence>
    <xsd:element name="name" minOccurs="1" maxOccurs="1">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string"><xsd:minLength value="1" /><xsd:maxLength value="255" /></xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="value" minOccurs="1" maxOccurs="1">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string"><xsd:minLength value="1" /><xsd:maxLength value="65536"/></xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:sequence>
    </xsd:complexType>
    我写的:<NewRecipientType>
    <RecipientNameValuePairType>
    <name>email</name>
    <value>[email protected]</value>
    </RecipientNameValuePairType>
    <RecipientNameValuePairType>
    <name>firstname</name>
    <value>Arjan</value>
    </RecipientNameValuePairType>
    <RecipientNameValuePairType>
    <name>lastname</name>
    <value>Haverkamp</value>
    </RecipientNameValuePairType>
    </NewRecipientType>