How to send parameter in string in wsdl soap request.
$soapClient->nameOfFunction(['nameOfParameter' => 'valueOfParameter']);
It gives me error like this
stdClass Object
(
[commBRIDGEFusionMOTORResult] => System.ArgumentNullException: Value cannot be null.
Parameter name: s
at System.IO.StringReader…ctor(String s)
at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
at System.Xml.Linq.XDocument.Parse(String text)
at WebAggWCFService.Service1.commBRIDGEFusionMOTOR(String strXdoc) in c:\WebAggAppUAT\WebAggWCFService\App_Code\Service1.cs:line 59
)
how to send this xml in to wsdl api without array
<Authentication>
<WACode>sddsfsdf</WACode>
<WAAppCode>sdfsdfsdf</WAAppCode>
<WAUserID>sdf</WAUserID>
<WAUserPwd>sdf123</WAUserPwd>
<WAType>0</WAType>
<DocumentType>Proposal</DocumentType>
<Versionid>1.1</Versionid>
<GUID />
</Authentication>
Looks like you didn’t pass a value where you should have.
i passed variable through array or string but the error is same .
<Authentication>
<WACode>zxc</WACode>
<WAAppCode>zxc</WAAppCode>
<WAUserID>zxc</WAUserID>
<WAUserPwd>zxc3</WAUserPwd>
<WAType>0</WAType>
<DocumentType>Proposal</DocumentType>
<Versionid>1.1</Versionid>
<GUID />
</Authentication>
Then show your code. My divining orb is currently out of comission.
$url = "http://14.141.41.53:800/WebAggWCFUAT/Service1.svc?wsdl";
$clinet=new SoapClient($url);
$content =
'<Authentication>
<WACode>20000058</WACode>
<WAAppCode>30000060</WAAppCode>
<WAUserID>USER01</WAUserID>
<WAUserPwd>pass@123</WAUserPwd>
<WAType>0</WAType>
<DocumentType>Proposal</DocumentType>
<Versionid>1.1</Versionid>
<GUID />
</Authentication>
<PaymentDetails>
<PaymentEntry>
<PaymentId />
<MICRCheque />
<InstrumentDate />
<DraweeBankName />
<HOUSEBANKNAME />
<AmountPaid />
<PaymentType />
<PaymentDate />
<PaymentMode />
<InstrumentNo />
<Status />
<DepositSlipNo />
<PayerType />
</PaymentEntry>
</PaymentDetails>
<Errors>
<ErrorCode />
<ErrDescription />
</Errors>';
echo (string) $content;
$result = $clinet->commBRIDGEFusionMOTOR($content);
pr($result);
have you had a look at what I posted in post #2?
yes but the error is same.
Well, since you did not pass the parameters in the required way, the error is expected.
When i run xml through SOAP UI software then api work properly , so the issue is in php code.
yes what is the exactly way to pass parameter .
This is:
Ok I will checked ,
THis is the xml code which run successfully on soapUi .
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:commBRIDGEFusionMOTOR>
<!--Optional:-->
<tem:strXdoc>
<![CDATA[
<Root>
<Authentication>
<WACode>20000058</WACode>
<WAAppCode>30000060</WAAppCode>
<WAUserID>USER01</WAUserID>
<WAUserPwd>pass@123</WAUserPwd>
<WAType>0</WAType>
<DocumentType>Proposal</DocumentType>
<Versionid>1.1</Versionid>
<GUID />
</Authentication>
<PaymentDetails>
<PaymentEntry>
<PaymentId />
<MICRCheque />
<InstrumentDate />
<DraweeBankName />
<HOUSEBANKNAME />
<AmountPaid />
<PaymentType />
<PaymentDate />
<PaymentMode />
<InstrumentNo />
<Status />
<DepositSlipNo />
<PayerType />
</PaymentEntry>
</PaymentDetails>
<Errors>
<ErrorCode />
<ErrDescription />
</Errors>
</Root>
]]>
</tem:strXdoc>
</tem:commBRIDGEFusionMOTOR>
</soapenv:Body>
</soapenv:Envelope>
$result = $clinet->commBRIDGEFusionMOTOR([‘WACode’ => ‘20000058’]);
Same error occured.
[off-topic]
When you post code in the forum, please format it as code.
You can highlight it and use the </>
button.
Or place 3 backticks on a line of their own before and after the code block.
maybe there’s more than one required parameter …
OK i will check