0

I need help to receive SOAP request. I have following SOAP request :

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
    <soapenv:Body>
        <tem:ApplyTransactionRequest xmlns:tem="http://tempuri.org/"
xmlns:at="http://cps.huawei.com/cpsinterface/goa/at"
xmlns:goa="http://cps.huawei.com/cpsinterface/goa">
            <at:Header>
                <goa:CommandID>CheckInformation</goa:CommandID>
                <goa:Version>1.0</goa:Version>
                <goa:LoginID>NGOLoanPay</goa:LoginID>
                <goa:Password>e7L/g2/isbOu5Q6fHW3CAYtWgGYv8Av64BQet3WBQpmraV3HTzvlMBdQzGx056gY</goa:Password>
                <goa:Timestamp>20220110111810</goa:Timestamp>
                <goa:ConversationID>9DJ906XRUD</goa:ConversationID>
                <goa:HeaderExtension>
                    <goa:Parameter>
                        <goa:Key>name</goa:Key>
                        <goa:Value>cps</goa:Value>
                    </goa:Parameter>
                </goa:HeaderExtension>
            </at:Header>
            <at:Body>
                <at:Parameters>
                    <goa:Parameter>
                        <goa:Key>IDNumber</goa:Key>
                        <goa:Value>220214000126</goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>FullName</goa:Key>
                        <goa:Value>MAYA</goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>InquiryType</goa:Key>
                        <goa:Value>01</goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>InquiryMode</goa:Key>
                        <goa:Value>02</goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>FirstName</goa:Key>
                        <goa:Value></goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>InitiatorID</goa:Key>
                        <goa:Value>8801301712997</goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>ChannelCode</goa:Key>
                        <goa:Value>10</goa:Value>
                    </goa:Parameter>
                     <goa:Parameter>
                        <goa:Key>channelCode</goa:Key>
                        <goa:Value>10</goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>LastName</goa:Key>
                        <goa:Value></goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>PartnerID</goa:Key>
                        <goa:Value>MFI</goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>ChkAmount</goa:Key>
                        <goa:Value></goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>EndMonth</goa:Key>
                        <goa:Value></goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>ExtendedParmeter1</goa:Key>
                        <goa:Value></goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>SubID</goa:Key>
                        <goa:Value></goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>AccountID</goa:Key>
                        <goa:Value>201004000589</goa:Value>
                    </goa:Parameter>
                    <goa:Parameter>
                        <goa:Key>StartMonth</goa:Key>
                        <goa:Value></goa:Value>
                    </goa:Parameter>
                </at:Parameters>
            </at:Body>
        </tem:ApplyTransactionRequest>
    </soapenv:Body>
</soapenv:Envelope>

When I trying to receive that using the following code I am enable to read it:

function CheckInfoAPI()
{
        $soap_request = file_get_contents("php://input");
        $parser=xml_parser_create();
        xml_parse_into_struct($parser,$soap_request,$request_array);
        xml_parser_free($parser);
        var_dump($parser); 
    }

Is it correct?

I am trying to resolved this. But It return

resource(49) of type (Unknown)

in the result.

So how to get the requestor's Login, Password and the Creation Begin Date? I have actually build the response, we've test it and when they send me the request they got the response. I'm just sending the response without reading the request, but I have to read it and log in diffrent users and send different response. So a real example with the request I've posted above will be much much appreciated.

ADyson
  • 57,178
  • 14
  • 51
  • 63
  • 1
    If others are making SOAP requests to your sever, I would recommend looking into using PHP's native [SoapServer extension](https://www.php.net/manual/en/class.soapserver.php) instead trying to do it all manually. – M. Eriksson Aug 24 '22 at 10:38
  • Not spam. Real Question – user1643268 Aug 24 '22 at 10:57
  • @Jbadminton what makes you say that? – ADyson Aug 24 '22 at 11:02
  • @ADyson not anymore it got removed. The question was full of thank you words. Like 30 lines long – Webdeveloper_Jelle Aug 24 '22 at 11:13
  • `xml_parse_into_struct` returns an array, it doesn't overwrite the `$parser` argument. However, you almost certainly don't want that function anyway - it's more of a low-level tool for building parsers than something designed for end users. See the linked question for the more friendly tools PHP provides. – IMSoP Aug 24 '22 at 11:20
  • @Jbadminton https://stackoverflow.com/posts/73471613/revisions - there's nothing in the history about that. – ADyson Aug 24 '22 at 11:22
  • @ADyson that is weird, maybe he removed it himself. Im sure I saw it while reviewing the questions queue. – Webdeveloper_Jelle Aug 24 '22 at 11:24
  • @Jbadminton it would still show in the history even if the OP edited it, unless they changed it within the first minute or so after posting - but your comment appears to be a long time after that. Are you sure it wasn't a different question you saw it on? – ADyson Aug 24 '22 at 11:25
  • No it was this question im sure, but it doesnt matter now as its gone now. – Webdeveloper_Jelle Aug 24 '22 at 11:32

0 Answers0