0
PHP로 웹 서비스 클라이언트를 작성하고 있습니다. 웹 서비스는 ij java를 사용하여 개발되었습니다. 클라이언트 프록시는 wsdl2php 도구를 사용하여 생성됩니다. 프록시 코드는 다음 코드를wsdl2php를 사용하는 PHP 웹 서비스 클라이언트의 ArrayOf_apachesoap_Element 데이터 유형
class ValidateDetails {
public $elements; // ArrayOf_apachesoap_Element
public $pipeName; // string
}
을 포함하고 SoapRequest 객체는 요소 노드 내부의 중첩 된 XML을 포함하지 않는 그러나 다음 코드
$xml = '<elements> <some xml here /> </elements>';
$xmlElement = new DOMElement('elements', $xml, '');
$details = new ValidateDetails();
$details->elements[0] = $xmlElement;
$details->pipeName = 'mypipe';
$response = new ValidationResult();
$response = $client->validate($details);
를 사용하여 매개 변수가 설정되고 서비스가 호출됩니다. 이 모양은 다음과 같습니다.
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://build.nomos.com" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="urn:CompilationService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:validate>
<details xsi:type="ns3:ValidateDetails">
<elements SOAP-ENC:arrayType="ns2:Element[1]" xsi:type="ns3:ArrayOf_apachesoap_Element">
<item xsi:type="SOAP-ENC:Struct"/>
</elements>
<pipeName xsi:type="xsd:string">mypipe</pipeName>
</details></ns1:validate></SOAP-ENV:Body></SOAP-ENV:Envelope>
요소 필드에 올바른 xml을 채우는 방법을 이해할 수 없습니다. ArrayOf_apachesoap_Element 데이터 유형을 제안하고이 매개 변수를 채우려면 어떻게해야합니까?
예 이미 데이터 유형을 문자열 값으로 변경해야하며 가장 적합한 해결책 인 것 같습니다. –