I am tying to get a simple SOAP call to work in php, but I have no clue what is wrong. It is my first time using soap so please be gentle :)
when I make a manual call like this, it all workes
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header>
<tem:AuthenticationHeader>
<!--Optional:-->
<tem:UserName>****</tem:UserName>
<!--Optional:-->
<tem:Password>***</tem:Password>
</tem:AuthenticationHeader>
</soapenv:Header>
<soapenv:Body>
<tem:SignUp>
<!--Optional:-->
<tem:email>test@test.se</tem:email>
<!--Optional:-->
<tem:password>password</tem:password>
</tem:SignUp>
</soapenv:Body>
</soapenv:Envelope>
But when i do it in php, i get " Function ("SignUp") is not a valid method for this service"
try {
$soap_client = new SoapClient("http://url.com/Service.asmx?WSDL");
$soapHeader = array('UserName' => '*****','Password' => '***');
// Soap Header initialization
$header = new SOAPHeader('http://tempuri.org/', 'AuthenticationHeader', $soapHeader);
// add the Header to the Soap Client before request
$soap_client->__setSoapHeaders($header);
$args = array('email'=>'tetsing@pp.se','password' =>'tetsing');
$user = $soap_client->SignUp($args);
print_r($user);
} catch (Exception $e) {
print_r($e);
}
edit1: Added WSDL
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="AuthenticationHeader" type="tns:AuthenticationHeader"/>
<s:complexType name="AuthenticationHeader">...</s:complexType>
<s:element name="SignUp">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="email" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
Edit 2:
Edit 3: getFunctions gives med
array(18) {
[0]=>
string(80) "GetGameProgressDataResponse GetGameProgressData(GetGameProgressData $parameters)"
[1]=>
string(101) "GetGameParticipantPicturesResponse GetGameParticipantPictures(GetGameParticipantPictures $parameters)"
[2]=>
string(41) "SignUpResponse SignUp(SignUp $parameters)"
[3]=>
string(38) "LoginResponse Login(Login $parameters)"
[4]=>
string(53) "CreateGameResponse CreateGame(CreateGame $parameters)"
[5]=>
string(62) "GetActivitiesResponse GetActivities(GetActivities $parameters)"
[6]=>
string(62) "SetActivitiesResponse SetActivities(SetActivities $parameters)"
[7]=>
string(68) "GetParticipantsResponse GetParticipants(GetParticipants $parameters)"
[8]=>
string(68) "SetParticipantsResponse SetParticipants(SetParticipants $parameters)"
[9]=>
string(80) "GetGameProgressDataResponse GetGameProgressData(GetGameProgressData $parameters)"
[10]=>
string(101) "GetGameParticipantPicturesResponse GetGameParticipantPictures(GetGameParticipantPictures $parameters)"
[11]=>
string(41) "SignUpResponse SignUp(SignUp $parameters)"
[12]=>
string(38) "LoginResponse Login(Login $parameters)"
[13]=>
string(53) "CreateGameResponse CreateGame(CreateGame $parameters)"
[14]=>
string(62) "GetActivitiesResponse GetActivities(GetActivities $parameters)"
[15]=>
string(62) "SetActivitiesResponse SetActivities(SetActivities $parameters)"
[16]=>
string(68) "GetParticipantsResponse GetParticipants(GetParticipants $parameters)"
[17]=>
string(68) "SetParticipantsResponse SetParticipants(SetParticipants $parameters)"
}