views:

60

answers:

2

I've been trying to use a Web Service which has the WSDL file below. The bit I'm not sure about is what I am supposed to pass or do with the first part of it. It asks for a personaldetails object with a tns type to be passed to it but I don't understand what that means? The actual method I am trying to use is called PersonalDetails_Update and I am passing all of the relevant values to it but it keeps failing and I suspect it's to do with this personadetails object it asks for before it?

<s:element name="PersonalDetails_Update">
−
<s:complexType>
−
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="personaldetails" type="tns:PersonalDetails"/>
</s:sequence>
</s:complexType>
</s:element>
−
<s:complexType name="PersonalDetails">
−
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ContactId" nillable="true" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="GenderId" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="EthnicityId" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="Title" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Initials" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Honours" 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="Salutation" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Position" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Department" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Organisation" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="AccessRequirements" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="DietaryNeeds" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="BirthDate" nillable="true" type="s:dateTime"/>
<s:element minOccurs="1" maxOccurs="1" name="IsNewContact" type="s:boolean"/>
<s:element minOccurs="1" maxOccurs="1" name="HoldingId" nillable="true" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="WebId" nillable="true" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="RecruitedId" type="s:int"/>
</s:sequence>
</s:complexType>
−
<s:element name="PersonalDetails_UpdateResponse">
−
<s:complexType>
−
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="PersonalDetails_UpdateResult" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>
A: 

Have a look at Zend_Soap and the native Soap extension. Both have information about how to write a Soap Client.

Gordon
$client = new SoapClient(null, array('location' => "http://localhost/soap.php", 'uri' => "http://test-uri/", 'style' => SOAP_DOCUMENT, 'use' => SOAP_LITERAL));Do you know what these parameters are referring to and where I might find them - in particular URI and Location. The example isn't well documented.
baswoni
@baswoni these parameters are options, which you usually pass in when working in non-wsdl mode, e.g. when the first argument to the constructor is null. The options are explained in detail at http://de2.php.net/manual/en/soapclient.soapclient.php
Gordon
I will be using WSDL to interface with this Web Service, so I am still at a dead-end and I am trying to get an answer for my original question - why is there a PersonalDetails object and a PersonalDetails_Update object? I don't see how the links you have provided help to answer this question?
baswoni
A: 

The structure of the information to send is something like this:

<Envelope>
  <Header/>
  <Body>
    <PersonalDetails_Update>
      <personaldetails>
        <ContactId>[some value]</ContactId>
        <GenderId>[some value]</GenderId>
        <EthnicityId>[some value]</EthnicityId>
        <Title>[some value]</Title>
        <Initials>[some value]</Initials>
        <Honours>[some value]</Honours>
        <FirstName>[some value]</FirstName>
        <Surname>[some value]</Surname>
        <Salutation>[some value]</Salutation>
        <Position>[some value]</Position>
        <Department>[some value]</Department>
        <Organisation>[some value]</Organisation>
        <AccessRequirements>[some value]</AccessRequirements>
        <DietaryNeeds>[some value]</DietaryNeeds>
        <BirthDate>[some value]</BirthDate>
        <IsNewContact>[some value]</IsNewContact>
        <HoldingId>[some value]</HoldingId>
        <WebId>[some value]</WebId>
        <RecruitedId>[some value]</RecruitedId>
      </personaldetails>
    </PersonalDetails_Update>
  </Body>
</Envelope>

PersonalDetails_Update is the service you'll be using personaldetails is the object that will hold the details PersonalDetails defines the details

seloh77