call web service method within PHP help

jimbona27
jimbona27 used Ask the Experts™
on
hi EE,
I have asked this question several times now although with no help to be honest.

I am trying to call a web service within PHP.  

The definition within the WSDL file is included within the code snippet.

Can someone please provide an example of how to call the method named 'AddMember' using PHP please?

Many thanks,

<s:element name="AddMember">

<s:complexType>

<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="key" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="title" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="firstName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="surname" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="emailAddress" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="emailType" type="tns:EmailAddressType"/>
<s:element minOccurs="0" maxOccurs="1" name="telephone" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="jobTitle" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="regType" type="tns:RegistrantType"/>
<s:element minOccurs="1" maxOccurs="1" name="establishmentID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="referrerContactID" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
 

<s:simpleType name="RegistrantType">

<s:restriction base="s:string">
<s:enumeration value="Student"/>
<s:enumeration value="Consultant"/>
<s:enumeration value="Other"/>
</s:restriction>
 

<s:simpleType name="EmailAddressType">

<s:restriction base="s:string">
<s:enumeration value="Home"/>
<s:enumeration value="Work"/>
</s:restriction>
</s:simpleType>
</s:simpleType>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
By doing the following you can see that addMember is not a function exposed!

I was under the impression you wanted to do addRegistration?
$client = new SoapClient('http://dev-london2012.education.co.uk/services/useraccountmanagementservice/service.asmx?WSDL');
 
var_dump($client->__getFunctions());
 
exit;

Open in new window

Commented:
I have tried addRegistration, and I'm failing validation of the key.
What should I use in the key field?

Could you provide a value for all fields in the followinig description

<s:element minOccurs="0" maxOccurs="1" name="key" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="title" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="firstName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="surname" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="emailAddress" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="emailType" type="tns:EmailAddressType"/>
<s:element minOccurs="0" maxOccurs="1" name="telephone" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="jobTitle" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="regType" type="tns:RegistrantType"/>
<s:element minOccurs="1" maxOccurs="1" name="establishmentID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="referrerContactID" type="s:string"/>

Author

Commented:
regarding your first post, you are correct, I need to call AddRegistration.

Author

Commented:
any ideas?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial