그래서 제 3 자 서비스에 연결하고 PHP에서 몇 가지 문제를 겪고 있습니다. 내가 WebService에 스튜디오의 서비스 요청을하려고하면 잘 작동하고 전송 요청은 다음과 같습니다다른 SOAP SOAP 요청을 생성하는 PHP SoapClient
<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<createUser xmlns="http://ws.example.com">
<arg0 xmlns="">[email protected]</arg0>
<arg1 xmlns="">123</arg1>
<arg2 xmlns="">1234</arg2>
<arg3 xmlns="">1234567890abcdef</arg3>
<arg4 xmlns="">test</arg4>
<arg5 xmlns="">user</arg5>
<arg6 xmlns="">02472</arg6>
<arg7 xmlns="">[email protected]</arg7>
<arg8 xmlns="">A</arg8>
<arg9 xmlns="">0</arg9>
<arg10 xmlns="">true</arg10>
</createUser>
</soap:Body>
</soap:Envelope>
를 이제 다음 명령을 사용하여 PHP에서 서비스를 호출 할 때 :
$this->web_service->createAccount('[email protected]', 123, 1234, '1234567890abcdef', 'test', 'user', '12345', '[email protected]', 'A', 0, true)
및 요청을 디버깅하면 다음과 같이 나타납니다.
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws.example.com">
<SOAP-ENV:Body>
<ns1:createUser/>
<param1>123</param1>
<param2>1234</param2>
<param3>1234567890abdcef</param3>
<param4>test</param4>
<param5>user</param5>
<param6>12345</param6>
<param7>[email protected]</param7>
<param8>A</param8>
<param9>0</param9>
<param10>true</param10>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP에서 SoapClient에 의해 생성 된 요청으로 인해 즉시 몇 가지 문제가 발생합니다. 첫 번째 것은 첫 번째 매개 변수 (처음 [email protected]을 전달)가 param1에 전달되지 않고 두 번째 매개 변수가 전달된다는 것입니다. 다음으로 createUser에 대한 요청은 전달되는 매개 변수를 포함하지 않는 자체 닫기 태그입니다. 그러면 분명히 전체 구조가 사용되는 태그와 조금 다릅니다.
__call()을 사용하여 SoapParam의 매개 변수를 래핑하고 __soapCall()을 사용하지만 이러한 문제를 수정하지 않는 배열을 사용해 보았습니다. 요청을 처리하는 데까지 이르지 않았습니다.
PHP의 SoapClient가 생성 한 요청과 WebService Studio가 생성 한 요청이 수동으로 수동으로 생성되지 않도록이 문제를 해결할 수있는 사람은 누구입니까?
WSDL을 사용하여 서비스에 연결하고 있습니까? createAccount 메소드의 정의는 무엇입니까? – Cfreak
WSDL을 사용하고 있지만 해당 정보를 공개 할 수 없습니다. – ryanzec