#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    PHP SOAP api integration


    HI all, I am trying to post an soap http request to an api. but inturn getting an error " Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] No WS-Security header found in /var/www/test/soapxmlsuccess.php:10 Stack trace: #0 /var/www/test/soapxmlsuccess.php(10): SoapClient->__call('SearchItemTypes', Array) #1 /var/www/test/soapxmlsuccess.php(10): SoapClient->SearchItemTypes() #2 {main} thrown in /var/www/test/soapxmlsuccess.php on line 10".

    There are two links :
    wsdl path:
    endpoint:

    Can any one suggest any help please?? Its quite urgent. Thanks in advance.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    I am also attaching the xml and php codes below


    SearchItemTypeReq.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:ser="" xmlns:soapenv="">
    <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="" xmlns:wsu="">
    <wsse:UsernameToken wsu:Id="UsernameToken-2">
    <wsse:Username>karun@unicommerce.com</wsse:Username>
    <wsse:Password Type="">unicom</wsse:Password>
    <wsse:Nonce EncodingType="">OClLRqHeqJ9IrcWbrRDaFQ==</wsse:Nonce>
    <wsu:Created>2013-01-28T06:24:19.643Z</wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    <soapenv:Body>
    <ser:SearchItemTypesRequest>

    <!--Optional:-->
    <ser:ProductCode></ser:ProductCode>
    <!--Optional:-->
    <ser:CategoryCode>JWL</ser:CategoryCode>
    <ser:SearchOptions>
    <serisplayStart>0</serisplayStart>
    </ser:SearchOptions>
    </ser:SearchItemTypesRequest>
    </soapenv:Body>
    </soapenv:Envelope>


    <SOAP-ENV:Envelope xmlns:SOAP-ENV="">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
    <SearchItemTypesResponse xmlns="">
    <Successful>true</Successful>
    <TotalRecords>1464</TotalRecords>
    <ItemTypes>
    <ItemType>
    <SKUCode>1217419</SKUCode>
    <Name>Bulk upload - 3</Name>
    <Description>&lt;p>
    Electronic and Camera&lt;/p></Description>
    <Length>20</Length>
    <Width>10</Width>
    <Height>15</Height>
    <Weight>400</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>391524</SKUCode>
    <Name>estbatchupdate1967</Name>
    <Description>desc1963</Description>
    <Length>100</Length>
    <Width>100</Width>
    <Height>100</Height>
    <Weight>495</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>941235</SKUCode>
    <Name>estbatchupdate880</Name>
    <Description>desc876</Description>
    <Length>100</Length>
    <Width>100</Width>
    <Height>100</Height>
    <Weight>400</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>SKU1352445172823</SKUCode>
    <Name>Testing BS</Name>
    <Length>0</Length>
    <Width>0</Width>
    <Height>0</Height>
    <Weight>0</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>SKU1352374146060</SKUCode>
    <Name>Testing BS</Name>
    <Length>0</Length>
    <Width>0</Width>
    <Height>0</Height>
    <Weight>0</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>SKU1352373942515</SKUCode>
    <Name>Testing BS</Name>
    <Length>0</Length>
    <Width>0</Width>
    <Height>0</Height>
    <Weight>0</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>SKU1352373845388</SKUCode>
    <Name>Testing BS</Name>
    <Length>0</Length>
    <Width>0</Width>
    <Height>0</Height>
    <Weight>0</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>SKU1352372930210</SKUCode>
    <Name>Testing BS</Name>
    <Length>0</Length>
    <Width>0</Width>
    <Height>0</Height>
    <Weight>0</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>SKU1352371788917</SKUCode>
    <Name>Testing BS</Name>
    <Length>0</Length>
    <Width>0</Width>
    <Height>0</Height>
    <Weight>0</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>SKU1352371107188</SKUCode>
    <Name>Testing BS</Name>
    <Length>0</Length>
    <Width>0</Width>
    <Height>0</Height>
    <Weight>0</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>
    <SKUCode>SKU1352370429404</SKUCode>
    <Name>Testing BS</Name>
    <Length>0</Length>
    <Width>0</Width>
    <Height>0</Height>
    <Weight>0</Weight>
    <CategoryName>Jewelry</CategoryName>
    <CategoryCode>JWL</CategoryCode>
    <CustomFields>
    <CustomField>
    <Name>color</Name>
    <Value>red</Value>
    </CustomField>
    </CustomFields>
    </ItemType>
    <ItemType>




    My php code is as below :
    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', '1');
    ini_set("soap.wsdl_cache_enabled", "0");
    $client = new SoapClient("=01",array('Username' => "karun@unicommerce.com",
    'Password' => "unicom",
    ));

    //$result = $client->__getFunctions();
    $result = $client->SearchItemTypes();
    print_r($result);
    ?>

IMN logo majestic logo threadwatch logo seochat tools logo