WEBServiceClient (PHP)-& gt; Server (JAVA) is currently developing WEBService. on my side, it is a request client that requests the WEBService made by JAVA. The question is as follows,
$ ViewProjectNumber ['project'] =' 1 ';
$ Encodded = new SoapVar ($ ViewProjectNumber, SOAP_ENC_OBJECT );
$ Result = $ client-> oaProjectRequest ($ encodded );
What values does the Server receive from $ encodded ?? <Number> 1 </number>? Escaped. how can this problem be solved?
?
Reply to discussion (solution)
print_r($encodded);
SoapVar Object
(
[Enc_type] => 301
[Enc_value] => Array
(
[Project] => 1
)
)
Apparently it is not escaped on the client.
However, if it is used as the xml node data, it is correct to be escaped, otherwise it will be treated as a node.
You may want to use CDATA
print_r($encodded);
SoapVar Object
(
[Enc_type] => 301
[Enc_value] => Array
(
[Project] => 1
)
)
Apparently it is not escaped on the client.
However, if it is used as the xml node data, it is correct to be escaped, otherwise it will be treated as a node.
You may want to use CDATA
On the basis of this method, how can we prevent escaping? Can you explain it?
Write it like this
$ ViewProjectNumber ['project'] ='<number>1</number>';
Write it like this
$ ViewProjectNumber ['project'] ='<number>1</number>';
The received information is as follows:
<! [CDATA [<number> 1 </number>]>
@ Xuzuning I will send you something that gettypes gets.
Array
(
[0] => struct UnitReserve {
Reserve;
}
[1] => struct Revenue {
ContractUnitNumber;
ElevatorModel;
CostQuantity;
ContractValueNetOfTax_EQ;
FreeMaintenanceRevenue_EQ;
CTURevenue_IN;
ContractValueNetOfTax_IN;
Currency;
RevenueReserve;
}
[2] => string ContractUnitNumber
[3] => string ElevatorModel
[4] => decimal CostQuantity
[5] => decimal ContractValueNetOfTax_EQ
[6] => decimal FreeMaintenanceRevenue_EQ
[7] => decimal CTURevenue_IN
[8] => decimal ContractValueNetOfTax_IN
[9] => string Currency
[10] => struct RevenueReserve {
Reserve;
}
[11] => struct Project {
ViewProjectNumber;
Boolean NewInstallation;
Boolean Modification;
Boolean CrossRegionSales;
PersonResponsible;
EquipmentContractNumber;
FrameworkAgreementNumber;
InstallationContractNumber;
ProjectName_CN;
ProjectName_EN;
String PlannedStartDate;
String PlannedFinishDate;
EquipmentSignOffCustomer;
BillToParty;
InstallationContractSignOffCustomer;
BillToParty2 BillToParty2;
EquipmentContract;
InstallationCommissioningContract;
ProjectReserve;
Unit;
}
[12] => string ViewProjectNumber
[13] => string PersonResponsible
[14] => string EquipmentContractNumber
[15] => string FrameworkAgreementNumber
[16] => string InstallationContractNumber
[17] => string ProjectName_CN
[18] => string ProjectName_EN
[19] => string EquipmentSignOffCustomer
[20] => string BillToParty
[21] => string InstallationContractSignOffCustomer
[22] => string BillToParty2
[23] => string EquipmentContract
[24] => string InstallationCommissioningContract
[25] => struct Cost {
ContractUnitNumber;
CostItem;
CostIndicator;
CostCode;
CostQuantity;
ProcurementPrice;
Currency;
CostReserve;
}
[26] => string ContractUnitNumber
[27] => string CostItem
[28] => string CostIndicator
[29] => string CostCode
[30] => decimal CostQuantity
[31] => decimal ProcurementPrice
[32] => string Currency
[33] => struct ProjectRequest {
Project;
}
[34] => struct Unit {
ContractUnitNumber;
MFG_WBS;
GADNumber;
TP2QuotationNumber TP2QuotationNumber;
DAUnitNumber;
UnitInterestsAttributeBranch;
SupplierFactory;
UnitQuantity;
ElevatorModel;
RatedLoad;
RatedSpeed;
Floors;
Stops;
TravellingHeight;
MainDoorSideLandingDoors;
OppositeDoorSideLandingDoors;
LandingDoors;
Length;
InstallContractSigningBranch;
InstallContractExecutionBranch;
ElevatorType;
NonStopFloors;
OpenThroughDoor;
FloorsBothSideOpenThroughDoor;
ShaftHeight;
StepWidth;
InclinationAngle;
Rise;
EscalatorWhereUsed;
Segment;
IntervalSupport;
UnitReserve;
Revenue;
Cost;
}
[35] => string ContractUnitNumber
[36] => string MFG_WBS
[37] => string GADNumber
[38] => string TP2QuotationNumber
[39] => string DAUnitNumber
[40] => string UnitInterestsAttributeBranch
[41] => string SupplierFactory
[42] => decimal UnitQuantity
[43] => string ElevatorModel
[44] => decimal RatedLoad
[45] => decimal RatedSpeed
[46] => decimal Floors
[47] => decimal Stops
[48] => decimal TravellingHeight
[49] => decimal MainDoorSideLandingDoors
[50] => decimal OppositeDoorSideLandingDoors
[51] => decimal LandingDoors
[52] => decimal Length
[53] => string InstallContractSigningBranch
[54] => string InstallContractExecutionBranch
[55] => string ElevatorType
[56] => decimal NonStopFloors
[57] => string OpenThroughDoor
[58] => decimal FloorsBothSideOpenThroughDoor
[59] => decimal ShaftHeight
[60] => decimal StepWidth
[61] => decimal InclinationAngle
[62] => decimal Rise
[63] => string EscalatorWhereUsed
[64] => decimal Segment
[65] => string IntervalSupport
[66] => struct CostReserve {
Reserve;
}
[67] => struct ProjectReserve {
Reserve;
}
[68] => struct Reserve {
Key;
Value;
}
[69] => string Key
[70] => string Value
)
-----------------------------------------
How can I call it now?
$ Client = new Zend_Soap_Client ('http: // localhost: 8080/mockoaProjectRequestBinding? WSDL ');
$ Xml = simplexml_load_file ("a. xml ");
$ Client-> oaProjectRequest ($ xml );
But when the Server receives the message, If the XML file contains such two unit nodes, only one unit node can be received.