2013-06-13 2 views
0

안녕하세요, 저는 SOAP에 익숙하지 않고 GetPersons.The라는 메소드가 포함 된 asp.net으로 웹 서비스를 만들 수 있습니다.이 서비스는 테스트되었으며 작동합니다. 내 문제가 php.this 그것을 소비하는PHP로 SOAP 서비스 호출하기

는 지금까지 해일 것입니다 :

$client = new SoapClient("http://localhost:55400/Convert.asmx?WSDL"); 
$client->__soapCall("GetPersons"); 

이것은 __soapCall 두 번째 인수 매개 변수 만 뮤 GetPersons 방법은 인수가없는 기대하는 말해 오류가 발생합니다.

Array ([0] => GetPersonsResponse GetPersons(GetPersons $parameters) [1] => GetPersonsResponse GetPersons(GetPersons $parameters)) 

그래서 어떻게 전화를 할 수 있습니다

print_r($client->__getFunctions()); 

이것은 내가 돌아올 무엇인가 :

또한 PHP이 같은 링크에서 어떤 방법을 얻을 수 있는지 확인하기 위해 테스트 한 내 GetPersons 방법?

답변

1
$url = 'http://localhost:55400/Convert.asmx?WSDL'; 
$client = new SoapClient($url); 

$xmlr = new SimpleXMLElement("<Get></Get>"); 
$xmlr->addChild('searchtxt', $_GET['searchtxt']); 

$params = new stdClass(); 
$params->xml = $xmlr->asXML(); 

$result = $client->GetPersons($params); 

전달할 매개 변수에 대한 설명서를 읽어야합니다.

관련 :