我在调用WSDL函数时遇到了重大问题。我相信该函数创建了一个对象,但我不确定如何调用WSDL函数。我试图调用PutData函数,但我需要ImportPlannedVisit complexType。我不知道如何创建complexType,以便我可以使用PutData函数。我一直收到500错误。
这就是我调用WSDL的方式:
(ID 2)
以下是WSDL的一部分:
$this->client = new soapClient("somewsdl.asmx?wsdl",array(
"location"=>"somewsdl.asmx"
));
以下是我的尝试:
<s:element name="PutData">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Pwd" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Token" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="BatchData" nillable="true" type="tns:ImportBatch" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ImportBatch">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AgenciesBatch" type="tns:ArrayOfImportAgency" />
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfImportAgency">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="AgencyBatch" nillable="true" type="tns:ImportAgency" />
</s:sequence>
</s:complexType>
<s:complexType name="ImportAgency">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="PlannedVisits" type="tns:ArrayOfImportPlannedVisit" />
</s:sequence>
</s:complexType>
<s:complexType name="ImportPlannedVisit">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="UniquePlannedVisitID" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="Date1" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="StartTime" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EndTime" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AlarmTime" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="UniqueClientID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="UniqueCarerID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="StaffAlarmTime" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ChargeCode" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="VisitNotes" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ContactTypeID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="IsInvoiceFlag" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="IsRaiseAlerts" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ContractReference" type="s:string" />
</s:sequence>
</s:complexType>
<s:complexType name="ImportPlannedVisit">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="UniquePlannedVisitID" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="Date1" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="StartTime" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EndTime" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AlarmTime" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="UniqueClientID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="UniqueCarerID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="StaffAlarmTime" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ChargeCode" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="VisitNotes" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ContactTypeID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="IsInvoiceFlag" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="IsRaiseAlerts" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ContractReference" type="s:string" />
</s:sequence>
</s:complexType>
和
$return = $this->client->ImportPlannedVisit(
$id, // UniquePlannedVisitID
$datedos, // Date1
$timein, // StartTime
$timeout, // EndTime
$alarm_time, // AlarmTime
$ptid, // UniqueClientID
$agent1, // UniqueCarerID
"", // StaffAlarmTime
"$hcpcs|$mod1-$mod2-$mod3-$mod4|$pricegroup|$pricecode|$dadscontract", // ChargeCode
"", // VisitNotes
"", // ContactTypeID
"", // IsInvoiceFlag
"", // IsRaiseAlerts
$contractreference // ContractReference
);