[eluser]Gewa[/eluser]
Hi, Endly I have managed to install nusoap
I need to make a SOAP call
Code:
POST /1.0/commerce.asmx HTTP/1.1
Host: api.acme.lt
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://schemas.acme.eu/GetProductSpecification"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<LicenseHeader >
<LicenseKey>498ec72c-e8e7-48f2-b300-d95666aeb141</LicenseKey>
</LicenseHeader>
</soap:Header>
<soap:Body>
<GetProductSpecification >
<GetProductSpecificationRequest>
<Filters>
<Filter>
<Name>Language</Name>
<Value>en-us</Value>
</Filter>
<Filter>
<Name>SupplierCode</Name>
Acme API Specification v 1.0
24
<Value>018704</Value>
</Filter>
</Filters>
</GetProductSpecificationRequest>
</GetProductSpecification>
</soap:Body>
</soap:Envelope>
Which will give me
Code:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetProductSpecificationResponse >
<GetProductSpecificationResult>
<ProductSpecification>
<SupplierCode>018704</SupplierCode>
<ProductProperty>
<PropertyCode>95</PropertyCode>
<PropertyName>Video</PropertyName>
<PropertyValue>nVidia Ge Force 8400M G 256MB</PropertyValue>
</ProductProperty>
<ProductProperty>
<PropertyCode>13</PropertyCode>
<PropertyName>Type</PropertyName>
<PropertyValue>13.3 WXGA glare wide</PropertyValue>
</ProductProperty>
<ProductProperty>
<PropertyCode>110</PropertyCode>
<PropertyName>Keyboard</PropertyName>
<PropertyValue>US</PropertyValue>
</ProductProperty>
<ProductProperty>
<PropertyCode>64</PropertyCode>
<PropertyName>Optical storage</PropertyName>
<PropertyValue>Super Multi DL DVD+/-RW (CBB standard)</PropertyValue>
</ProductProperty>
<ProductProperty>
<PropertyCode>101</PropertyCode>
<PropertyName>AC adapter</PropertyName>
<PropertyValue>Output : 19V DC 3.42A 90W; Input : 100~240V AC 50/60Hz universal (CBB
standard)</PropertyValue>
</ProductProperty>
<ProductProperty>
<PropertyCode>96</PropertyCode>
<PropertyName>HDD</PropertyName>
<PropertyValue>SATA 120GB / 5400rpm (CBB standard)</PropertyValue>
</ProductProperty>
</ProductSpecification>
Acme API Specification v 1.0
25
</GetProductSpecificationResult>
</GetProductSpecificationResponse>
</soap:Body>
</soap:Envelope>
in my controller i have made usual code from forum I have got example
Code:
$this->load->library("nusoap");
$data['mod_content']='';
$this->soapclient = new nusoap_client('https://api.acme.lt/1.0/commerce.asmx?WSDL');
$this->soapclient->setHeaders('
<LicenseHeader >
<LicenseKey>498ec72c-e8e7-48f2-b300-d95666aeb141</LicenseKey>
</LicenseHeader>
');
$params=array('Language'=>'en-us','UpdateSince'=>'');
if(!$this->soapclient->fault)
{
if(!$this->soapclient->getError())
{
$member = $this->soapclient->call(
'getVendorList', // <- just when we get here the function becomes visible and can be called
array('parameters' => $param), '', '', false, true
);
print_r($member); // see what is coming out of the WS
}
}
else{
$data['mod_content'].="<h1>Error</h1>";
}
but i get
Code:
Array
(
[faultcode] => soap:Client
[faultstring] => Server did not recognize the value of HTTP Header SOAPAction: .
[detail] =>
)
How to fix this error and how to parse the response.
Please help!!!!