简体   繁体   English

PHP Web服务客户端调用JAVA Web服务服务器

[英]PHP web service client Call JAVA web service server

Please Help. 请帮忙。

This is document service http://ebizonline.allianzcp.com/online_insurance_test/IssuePolicySoapHttpPort?WSDL 这是文档服务http://ebizonline.allianzcp.com/online_insurance_test/IssuePolicySoapHttpPort?WSDL

I need to use PHP to call operation "OnlineMainWS" and send parameter ("METHOD" = "VERIFY"). 我需要使用PHP来调用操作“ OnlineMainWS”并发送参数(“ METHOD” =“ VERIFY”)。 It not all parameter request. 并非所有参数都要求。 But will return Error Code like this 但是会返回这样的错误代码

CODE= 001
CMI_URL_PRINT= null
VMI_URL_PRINT= null
CMI_POLICY_NO= null
VMI_POLICY_NO= null
METHOD = VERIFY

My issue is can not send parameter to web service. 我的问题是无法将参数发送到Web服务。 I need example code to call and send parameter. 我需要示例代码来调用和发送参数。 And return CODE will not null. 并且返回CODE不会为空。 Please help me -/- 请帮我 -/-

This is my code 这是我的代码

class RequestModel {
    function RequestModel($METHOD) 
    {
        $this->METHOD = $METHOD;
    }
}
$soapclient = new SoapClient(
    'http://ebizonline.allianzcp.com/online_insurance_test/IssuePolicySoapHttpPort?wsdl',
    array(
        'location' => 'http://ebizonline.allianzcp.com/online_insurance_test/IssuePolicySoapHttpPort',
        'uri' => 'http://azcp.online.ws/',
        'trace' => 1,
        'use' => SOAP_LITERAL,
        'style' => SOAP_RPC,
        "soap_version" => SOAP_1_1
    )
);
/* Fill your Contact Object */
$RequestModel = new RequestModel("VERIFY");

/* Set your parameters for the request */
$params = array(
  "requestModel" => $RequestModel
);

$result = $soapclient->__soapCall('OnlineMainWS', $params,  array('soapaction' => 'http://azcp.online.ws//OnlineMainWS') );

var_dump($result);

echo "<br><br><br> ====== REQUEST HEADERS ===== <br>";
var_dump($soapclient->__getLastRequestHeaders());
echo "<br> ====== REQUEST ===== <br>";
var_dump(htmlentities($soapclient->__getLastRequest()));
echo "<br><br><br> ====== ResponseHeaders ===== <br>";
var_dump($soapclient->__getLastResponseHeaders());
echo "<br> ====== Response ===== <br>";
var_dump(htmlentities($soapclient->__getLastResponse()));

It still return Null. 它仍然返回Null。 And parameter not send. 并且参数不发送。 How I can do that. 我该怎么做。 Thank you for help. 谢谢你的帮助。

I did it. 我做的。 Change Code 变更密码

$result = $soapclient->__soapCall('OnlineMainWS', $params,  array('soapaction' => 'http://azcp.online.ws//OnlineMainWS') );

To

$result = $soapclient->OnlineMainWS($params);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM