Php performs soapheader authentication and calls the interface $ client = new SoapClient ('http: // xxx. xxxx. xxx: 8099/mlf_webservice/publicRequest? Wsdl ', array ('encoding' => 'utf-8 '));
// $ Client-> soap_defencoding = 'utf-8 ';
$ Authvalues = new SoapVar (array ('username' => 'username', 'password' => 'password'), SOAP_ENC_OBJECT );
$ Header = new SoapHeader ('http: // xxx. xxx. xxx: 8099/mlf_webservice/publicRequest? Wsdl ', 'authrity', $ authvalues, false );
$ Client->__ setSoapHeaders ($ header );
$ Post_data = '{\ "version \": \ "10 \", \ "messageType \": \ "queryStoreList \", \ "signValue \": \ "4 \"} '; // The interface parameter must be in json format
$ Suc = $ client-> publicRequest ($ post_data );
Always report errors.
Reply to discussion (solution)
Please provide a real test account
Please provide a real test account
This is the account used for testing.
But how do you explain this prompt?
Fatal error: Uncaught SoapFault exception: [soap: Server] Incorrect username format ......
But how do you explain this prompt?
Fatal error: Uncaught SoapFault exception: [soap: Server] Incorrect username format ......
Is this caused by incorrect code writing, or is the error reported only when the user name and password are incorrect?
[Soap: Server] indicates that the exception is from the Server.
Apparently, the user name and password are incorrect.
[Soap: Server] indicates that the exception is from the Server.
Apparently, the user name and password are incorrect.
I changed the authentication, and now I am reporting
Fatal error: Uncaught SoapFault exception: [soap: Server] Fault occurred while processing.
[Soap: Server] indicates that the exception is from the Server.
Apparently, the user name and password are incorrect.
Server error:
Soap. SoapFault: Error Reading XMLStreamReader: Unepected EOF in prolog
[Row, col {unknown-source}]: [1, 0];
[Soap: Server] indicates that the exception is from the Server.
Apparently, the user name and password are incorrect.
The xml format is incorrect during soap header authentication.