0

How I can do below soap request in php,

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:v="http://incometaxindiaefiling.gov.in/ditws/TaxCredMismatch/v_1_0">
    <soapenv:Header/>
        <soapenv:Body>
        <v:getTaxCredMismatchRequest>
        <LoginInfo>
            <userName>XXXXXXXXXX</userName>
            <password>XXXXXXXXXX</password>
        </LoginInfo>
        <UserInput>
            <panNo>XXXXXXXXXX</panNo>
            <asseessmentyear>XXXX-XX</asseessmentyear>
        </UserInput>
    </v:getTaxCredMismatchRequest>
</soapenv:Body>
</soapenv:Envelope>

I tried below code,

<?php
    $url = "https://incometaxindiaefiling.gov.in/e-FilingWS/ditws/getTaxCredMismatchRequest.wsdl";
    try {        
        $options = array( 
                'soap_version'=>SOAP_1_1, 
                'exceptions'=>true, 
                'trace'=>1, 
                'cache_wsdl'=>WSDL_CACHE_NONE 
            );         
        $client = new SoapClient($url,$options);
        $requestParams = array(
            'userName' => 'AJAPA5855E',
            'password' => 'pass123',
            'panNo' =>  'AJAPA5855E',
            'asseessmentyear' => '2014-15'
        );        
        $response = $client->__soapCall("getTaxCredMisMatch", array($requestParams));
        var_dump($response);
    } catch (Exception $e) { 
        echo $e->getMessage(); 
    }
?>

but getting the response as

SOAP-ERROR: Encoding: object has no 'LoginInfo' property

I know, I'm sending the parameter in correct way, may I know how to correct it.

2 Answers 2

1

I never used that soap client, but I would expect this:

<?php
    $url = "https://incometaxindiaefiling.gov.in/e-FilingWS/ditws/getTaxCredMismatchRequest.wsdl";
    try {        
        $options = array( 
                'soap_version'=>SOAP_1_1, 
                'exceptions'=>true, 
                'trace'=>1, 
                'cache_wsdl'=>WSDL_CACHE_NONE 
            );         
        $client = new SoapClient($url,$options);
        $requestParams = array(
            'LoginInfo' => array (
                'userName' => 'AJAPA5855E',
                'password' => 'pass123',
            ),
            'UserInput' => array (
                'panNo' =>  'AJAPA5855E',
                'asseessmentyear' => '2014-15'
            )
        );        
        $response = $client->__soapCall("getTaxCredMisMatch", array($requestParams));
        var_dump($response);
    } catch (Exception $e) { 
        echo $e->getMessage(); 
    }
?>

However as said above, this is just a wild guess. It certainly would make sense to take a look at the documentation of that extension: http://php.net/manual/en/class.soapclient.php. Such things should be explained in there...

Sign up to request clarification or add additional context in comments.

Comments

0

Using the WSDL from https://incometaxindiaefiling.gov.in/e-FilingWS/ditws/getTaxCredMismatchRequest.wsdl, you could generate the corresponding package from wsdltophp.com in order to be sure on how to structure your request in PHP as every element will be a PHP object with setters/getters. It uses the native PHP SoapClient class so you'll understand easily and quickly who to send these requests if you're familiar with PHP

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.