2010-07-19 2 views
0
나는 다음과 같은 방법 요청하지만 비누 메시지가 UsernameToken이 요소를 포함하는 표시되지 않습니다 무엇입니까

:누락 UsernameToken이 요소

$policy = new WSPolicy(
    array(
     'useUsernameToken'=>true 
    ) 
); 
$security = new WSSecurityToken(
    array(
     'user'=>$username, 
     'passwordType'=>'PlainText', 
     'password'=>$password 
    ) 
); 
// create client in WSDL mode 
$client = new WSClient(
    array (
     'wsdl'=>$service_wsdl, 
     'to'=>$service_url, 
     'policy'=>$policy, 
     'securityToken'=>$security, 
     'trace'=>1 
    ) 
); 
$proxy = $client->getProxy(); 
$proxy->Ping(); 
제작 요청은 다음과 같습니다

:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soapenv:Header> 
     <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1"> 
     </wsse:Security> 
    </soapenv:Header> 
    <soapenv:Body> 
     <ns1:Ping xmlns:ns1="http://streamlinedsalestax.org/efile"/> 
    </soapenv:Body> 
</soapenv:Envelope> 

UsernameToken 요소가 완전히 없어졌습니다.

답변

0

어떻게 .. 추가 WSPolicy 당신이 다음 명시된 바와 같이 I 설정이 WSPolicy 객체 요청이 생성되지 없구요 경우

<?php 
$policy = new WSPolicy(
    array('security' => array(
     'useUsernameToken'=>true 
    )) 
); 
$security = new WSSecurityToken(
    array(
     'user'=>$username, 
     'passwordType'=>'PlainText', 
     'password'=>$password 
    ) 
); 
// create client in WSDL mode 
$client = new WSClient(
    array (
     'wsdl'=>$service_wsdl, 
     'to'=>$service_url, 
     'policy'=>$policy, 
     'securityToken'=>$security, 
     'trace'=>1 
    ) 
); 
$proxy = $client->getProxy(); 
$proxy->Ping(); 
+0

에 '보안'... 약 $ 클라이언트 -> getLastRequest()가 반환하는 빈 문자열. 나는 또한보고있다 : Notice : 정의되지 않은 변수 : payload_node in /home/enterprise/includes/wso2/dynamic_invocation/wsf_wsdl_serialization.php on line 157 – dorgan