SOAP and WSDL output type help needed

Hello, and thanks in advance for the help!

I’m using PHP (5.5.9) to consume an internal web service (WSDL is fixed and cannot be updated) but am running into an issue. The function I need to consume the output of is returning a top level type that is inconsistent with the WSDL, and I believe this is why the variable holding the return value is NULL, even though __getLastResponse() shows all the data needed. I’m trying to see if I can tell PHP to look for a specific top-level element, or somehow make it so the variable isn’t set to NULL.

Here’s the PHP code to call the function:
[php]$params = array(“IdentityInterfaceRequest” => array(“IdentityPersonRequest” => array(“IdentityID” => $userid,“InterfaceID” => $interfaceID)));
$response = $client->__call(‘IdentityInterface’,$params); [/php]

And here’s the output of __getLastResponse():

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <ns5:IdentityResponse xmlns:ns5="http://company-url-stuff/it/contract/IdentityService/v1" xmlns:ns2="http://company-url-stuff/it/msg/v1" xmlns:ns3="http://company-url-stuff/it/data/v1" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns=""> <ns5:IdentityCompositeInformation> <ns3:IdentityPersonResponse> <ns3:IdentityPersonType> <ns3:PersonInformation> <ns3:GivenName>Joe</ns3:GivenName> <ns3:MiddleName>J.</ns3:MiddleName> <ns3:FamilyName>Jones</ns3:FamilyName> </ns3:PersonInformation> <ns3:PersonBusinessInformation> <ns3:IdentityID>000000</ns3:IdentityID> <ns3:PersonAccount> <ns3:NTID>jjones</ns3:NTID></ns3:PersonAccount> <ns3:PersonPosition> <ns3:JobCode>123456</ns3:JobCode> <ns3:JobTitle>Manager</ns3:JobTitle> <ns3:FullPartTime>F</ns3:FullPartTime> <ns3:MgrLevelDesc>Manager</ns3:MgrLevelDesc> <ns3:EmpReports>N</ns3:EmpReports> <ns3:ReportingManager> <ns3:ID>456798</ns3:ID> </ns3:ReportingManager> </ns3:PersonPosition> <ns3:PersonFinance> <ns3:DeptID>ID1234</ns3:DeptID> <ns3:DeptName>Dispatch</ns3:DeptName> <ns3:CompanyCode>US1</ns3:CompanyCode> <ns3:CostCenter>US10CC</ns3:CostCenter> <ns3:CountryCode>US</ns3:CountryCode> </ns3:PersonFinance> <ns3:PersonContact> <ns3:EmailAddress>[email protected]</ns3:EmailAddress> <ns3:PersonLocation> <ns3:Region>NAMERICA</ns3:Region> <ns3:AddressInfo> <ns3:City>New York</ns3:City> <ns3:County> </ns3:County> <ns3:Province>NY</ns3:Province> <ns3:CountryName>US</ns3:CountryName> <ns3:Description>BUSINESS_ADDRESS</ns3:Description> </ns3:AddressInfo> </ns3:PersonLocation> </ns3:PersonContact> </ns3:PersonBusinessInformation> </ns3:IdentityPersonType> <ns3:IdentityType> <ns3:IdentityType>E</ns3:IdentityType> </ns3:IdentityType> </ns3:IdentityPersonResponse> <ns3:IdentityEntitlementResponse/> </ns5:IdentityCompositeInformation> </ns5:IdentityResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

Some of the WSDL associated with the function/response:

<xsd:element name="IdentityInterfaceResponse" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:sequence xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element maxOccurs="unbounded" minOccurs="0" name="IdentityCompositeInformation" type="data:IdentityCompositeInformationType" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/> </xsd:sequence> </xsd:complexType> </xsd:element> <message name="IdentityInterfaceResponse"> <part name="IdentityInterfaceResponse" element="sch0:IdentityInterfaceResponse"/> </message> <message name="IdentityInterfaceRequest"> <part name="IdentityInterfaceRequest" element="sch0:IdentityInterfaceRequest"/> </message> <message name="IdentityResponse"> <part name="IdentityResponse" element="sch0:IdentityResponse"/> </message> <message name="IdentityImageRequest"> <part name="IdentityImageRequest" element="sch0:IdentityImageRequest"/> </message> <message name="IdentityRequest"> <part name="IdentityRequest" element="sch0:IdentityRequest"/> </message> <message name="IdentityImageResponse"> <part name="IdentityImageResponse" element="sch0:IdentityImageResponse"/> </message> <portType name="IdentityService"> <operation name="IdentityInterface"> <input name="IdentityInterfaceRequest" message="sch0:IdentityInterfaceRequest"/> <output name="IdentityInterfaceResponse" message="sch0:IdentityInterfaceResponse"/> </operation> <operation name="Identity"> <input name="IdentityRequest" message="sch0:IdentityRequest"/> <output name="IdentityResponse" message="sch0:IdentityResponse"/> </operation> <operation name="IdentityImage"> <input name="IdentityImageRequest" message="sch0:IdentityImageRequest"/> <output name="IdentityImageResponse" message="sch0:IdentityImageResponse"/> </operation> </portType> <binding name="IdentityServiceSoap11" type="sch0:IdentityService"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="IdentityInterface"> <soap:operation soapAction=""/> <input name="IdentityInterfaceRequest"> <soap:body use="literal"/> <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" URI="#IdentityInterface_input_policy"/> </input> <output name="IdentityInterfaceResponse"> <soap:body use="literal"/> </output> </operation> <operation name="Identity"> <soap:operation soapAction=""/> <input name="IdentityRequest"> <soap:body use="literal"/> <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" URI="#Identity_input_policy"/> </input> <output name="IdentityResponse"> <soap:body use="literal"/> </output> </operation> <operation name="IdentityImage"> <soap:operation soapAction=""/> <input name="IdentityImageRequest"> <soap:body use="literal"/> <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" URI="#IdentityImage_input_policy"/> </input> <output name="IdentityImageResponse"> <soap:body use="literal"/> </output> </operation> </binding>

Per the WSDL, the function should be returning an IdentityInterfaceResponse, but you can see above that the highest level element returned is IdentityResponse. Is there a way to tell PHP that this is OK?

Thank you!

If I understand, that means that somewhere in your XML client it’s evaluating the response.
That may be where the more relevant code is.

Sponsor our Newsletter | Privacy Policy | Terms of Service