0
다른 서버에 SOAP 인터페이스를 사용하는 프로젝트에서 작업 중이며 작동에 심각한 문제가 있습니다. SOAP은 내가 익숙한 것이 아니며, 어디서나 도움을 찾는 데 힘든 시간을 보냈습니다. 우선 들어 https://sdkdev.wagefiler.com/WageFilerWS/wagefiler.asmx?WSDLPHP/Laravel 5 SOAP/WSDL 문제
, 나는 계정을 만들 수 있어야합니다 - WSDL 파일을 개발해도 사람들은 나를 도와 할 수 ...
내가 WSDL 파일을 가지고이 없습니다. 아래 코드는 작동하지만 WSDL 및 다른 서버 측 개발자에 따라 정의되지 않은 "-999"오류를 반환합니다. 그들은 내가 AccountRequest 객체의 인스턴스를 전달하고 있는지 확인하라고 말했지만, 도움이되는 것은 아무것도 없다.이것은 내 SoapController.php 파일입니다. 내 경로는 "데모"를 가리 킵니다. 문자 그대로 -999 오류를 반환합니다.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use Artisaninweb\SoapWrapper\SoapWrapper;
use Sentinel;
use App\backendInformation;
use SoapClient;
use SoapHeader;
use SoapParam;
use SoapVar;
class SoapController extends Controller
{
public function demo()
{
$WSDL = 'https://sdkdev.wagefiler.com/WageFilerWS/wagefiler.asmx?WSDL';
$user = Sentinel::getUser();
$backendInfo = backendInformation::where('user_id', $user['id'])->first();
$b = new backendInformation();
$b->user_id = $user['id'];
$b->username = $user['email'];
$b->password = crypt($b['username'], '$5$rounds=5000$anexamplestringforsalt$');
$b->customername = $user['first_name'] . ' ' . $user['last_name'];
$b->useremail = $user['email'];
$b->autoemail = $user['email'];
$options = [
'trace' => true,
'cache_wsdl' => WSDL_CACHE_NONE
];
$credentials = [
'ClientID' => 'XXXX'
];
$data = array(
'sequence' => array(
'UserID' => $user->nelco_user_id,
'Password' => $user->nelco_password,
'Email' => $b->useremail,
'ClientId' => config('global.nelco_client_id'),
'FName' => $user->first_name,
'LName' => $user->last_name,
'EIN' => $user->ein,
'Addr1' => $user->addr1,
'City' => $user->city,
'State' => $user->state,
'Zip' => $user->zip,
'Phone' => $user->phone,
),
);
$client = new SoapClient($WSDL, $options); // null for non-wsdl mode
$param = new SoapParam(new SoapVar($data, SOAP_ENC_OBJECT), 'AccountRequest');
$client->__soapCall('AccountSetup',array($param));
echo "<pre>";
var_dump($client);
echo "</pre>";
}
}
반환 값은 다음과 같습니다 -
그것은 WSDL에 대한 SOAP 문서처럼 보이는object(SoapClient)#267 (12) {
["trace"]=>
int(1)
["_stream_context"]=>
resource(8) of type (stream-context)
["_soap_version"]=>
int(1)
["sdl"]=>
resource(10) of type (SOAP SDL)
["__last_request"]=>
string(972) "
[email protected]$5$rounds=5000$anexamplestringf$ADNI5REUuQNRHFXv3tId [email protected]McBobbersonEI N123123123Addr1123 Bobs PlaceCityBobvilleStateokZip73115Phone123-123-1234
"
["httpsocket"]=>
resource(11) of type (stream)
["_use_proxy"]=>
int(0)
["httpurl"]=>
resource(12) of type (SOAP URL)
["__last_request_headers"]=>
string(259) "POST /WageFilerWS/wagefiler.asmx HTTP/1.1
Host: sdkdev.wagefiler.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/7.1.8-1ubuntu1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://localhost/WageFiler/WageFiler/AccountSetup"
Content-Length: 972
"
["__last_response_headers"]=>
string(330) "HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 25 Oct 2017 20:37:54 GMT
Content-Length: 382
Set-Cookie: BIGipServerpool_sdkdev.wagefiler.com_443=3389265580.47873.0000; path=/; Httponly; Secure
"
["_cookies"]=>
array(1) {
["BIGipServerpool_sdkdev.wagefiler.com_443"]=>
array(3) {
[0]=>
string(21) "3389265580.47873.0000"
[1]=>
string(1) "/"
[2]=>
string(20) "sdkdev.wagefiler.com"
}
}
["__last_response"]=>
string(382) "-999"
}
$ client -> __ soapCall ('AccountSetup', [$ data])와 같은 함수를 호출하면 어떻게됩니까? I는 –
내가 거의 동일한 출력 – Deadlance
오브젝트 (SoapClient) # 얻을 .. WSDL을로드 할 수있다 (275) (12) { [ "트레이스"] => INT (1) [ "_stream_context"] => 자원 (8) 형태의 (스트림 컨텍스트) [ "_soap_version"] => INT (1) [ "SDL"] => 자원 (10) 타입 (SOAP의 SDL) [ "__last_request"] = > 문자열 (238) " " – Deadlance