Highlighted
Alexis_Lozano Absent Member.
Absent Member.
790 views

SM Incidents Web Service SOAP - Modify WSDL document

Hello, I am having troubles trying to filter the incidents created in SM.

 

In the wsdl document there is the RetrieveIncidentList function, in SoapUI we can see the structure of the XML:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://schemas.hp.com/SM/7">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:RetrieveIncidentListRequest attachmentInfo="" attachmentData="" ignoreEmptyElements="true" updatecounter="" handle="" count="" start="" attachmentType="">
         <ns:keys query="" updatecounter="">
            <ns:IncidentID type="String" mandatory="" readonly=""></ns:IncidentID>
         </ns:keys>
      </ns:RetrieveIncidentListRequest>
   </soapenv:Body>
</soapenv:Envelope>

I want to see some specific incident, lets say, closed incidents, in order to do that I can put the Status label inside keys like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://schemas.hp.com/SM/7">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:RetrieveIncidentListRequest attachmentInfo="" attachmentData="" ignoreEmptyElements="true" updatecounter="" handle="" count="" start="" attachmentType="">
         <ns:keys query="" updatecounter="">
            <ns:IncidentID type="String" mandatory="" readonly=""></ns:IncidentID>
            <ns:Status type="String" mandatory="" readonly="">Closed</ns:Status>
         </ns:keys>
      </ns:RetrieveIncidentListRequest>
   </soapenv:Body>
</soapenv:Envelope>

This works just fine in SoapUI. But when I try to do that in PHP it seems like retrieveIncidentList() function doesn't care about parameters that are not in the default XML Request.

 

I have the following code (PHP):

<!DOCTYPE html>
<html>
<head>
  <title></title>
</head>
<body>
  <?php
    $incidentID = "";
    $status = "Closed";

    $wsdl = "http://<server>:<port>/SM/7/IncidentManagement.wsdl";
    $credentials = array('login'    => "user",
		         'password' => "password");
    $soap = new SoapClient($wsdl, $credentials);
    $parameters = array("ignoreEmptyElements" => "true",
				     "keys" => array("IncidentID" => $incidentID,
					             "Status" => $status));
    $xml = $soap -> retrieveIncidentList($parameters);

I need to know how to tell to the web service to listen the other parameters and I think is modifying the WSDL document, but I don't know how and where to do that.

0 Likes
1 Reply
Abhijit K Acclaimed Contributor.
Acclaimed Contributor.

Re: SM Incidents Web Service SOAP - Modify WSDL document

Hi,

 

I think you need to encode username and password using base64 method before sending to WSDL

 

Regards,

Abhijit K

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.