2012-09-14 3 views
3

나는이 SoapRequest를 얻기 위해 잠시 동안 시도했다하지만 난 실패 해요 :WSDL SoapClient 및 PHP + 자신의 네임 스페이스

내가 PHP에서 그것을 쓸 필요가
<?xml version="1.0" encoding="UTF-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > 
    <soap:Body xmlns:gog="http://www.test.nms"> 
    <gog:GenerateRequest> 
     <gog:Application>TestApp</gog:Application> 
     <gog:User>TestUser</gog:User> 
     <gog: RequestCreateOnly> 
     <gog:Count>1</gog:Count> 
     <gog:Subject>Test</gog:Subject> 
     </gog: RequestCreateOnly> 
    </gog:GenerateRequest> 
    </soap:Body> 
</soap:Envelope> 

. 질문은 다음과 같습니다.

네임 스페이스를 변경하는 방법은 무엇입니까? 비누 태그를 변경하는 방법은 무엇입니까? 도움에 대한 조언을 부탁드립니다!

+0

지금까지 어떤 시도를 했습니까? 왜 네임 스페이스를 변경하고 싶습니까? 어떤 네임 스페이스를 의미합니까, xmlns : soap 또는 xmlns : gog? –

답변

0

나는 종종 이러한 종류의 요청에 NuSOAP 라이브러리를 사용합니다. 아래 샘플 코드를 포함 시켰습니다. 도움이됩니까?

require_once('path-to-nusoap/nusoap.php'); 

$client = new nusoap_client("http://www.mywebservicehere.com", 'wsdl'); 
$client -> setDefaultRpcParams(true); 
$client -> useHTTPPersistentConnection(); 
$client -> soap_defencoding = 'UTF-8'; 
$client -> setUseCurl(true); 

$request = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
       <soap:Body xmlns:gog="http://www.test.nms"> 
        <gog:GenerateRequest> 
         <gog:Application>TestApp</gog:Application> 
         <gog:User>TestUser</gog:User> 
         <gog: RequestCreateOnly> 
          <gog:Count>1</gog:Count> 
          <gog:Subject>Test</gog:Subject> 
         </gog: RequestCreateOnly> 
        </gog:GenerateRequest> 
       </soap:Body> 
      </soap:Envelope>'; 

$results = $client->send($request,'http://www.actionurlhere.com');