非WSDL php调用

非WSDL php调用,php,wsdl,Php,Wsdl,我是php新手,希望将网站与一些租赁软件集成在一起。他们使用非WSDL模式的服务,并提供了这段代码,但我对“这是操作uri”有点困惑。我想这是我需要调用的方法 $client = new SoapClient(NULL, array( 'location' => '21.ip2.ip3.ip4/r2ws_v5/servlet/messagerouter', 'uri' => 'urn:this-is-the-action-uri', 'exceptio

我是php新手,希望将网站与一些租赁软件集成在一起。他们使用非WSDL模式的服务,并提供了这段代码,但我对“这是操作uri”有点困惑。我想这是我需要调用的方法

    $client = new SoapClient(NULL, array(
    'location' => '21.ip2.ip3.ip4/r2ws_v5/servlet/messagerouter',
    'uri' => 'urn:this-is-the-action-uri',
    'exceptions' => 1,
    );
我可以打电话给你,得到回应

http://21.ip2.ip3.ip4:8080/r2ws_v5/jsp/UBS_GetAvailability.jsp
休息是这样开始的

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getAvailabilityByItemResponse xmlns:ns1="UBS/R2" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<response>
<product>
<productID xsi:type="xsd:string">TESTUB</productID>
<level xsi:type="xsd:int">1</level>
<description xsi:type="xsd:string">
<![CDATA[ testub ]]>
</description>
</level>

TESTUB
1.

你能告诉我在这种情况下“uri”参数应该是什么,或者它应该如何格式化吗?

嗨,创建一个PHP文件,并将下面的代码放入你的PHP文件中

$xmlRequest = "<SOAP:Envelope xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" .
    "<SOAP:Body>" .
    "<getAvailabilityByItem xmlns=\"UBS/R2WebServices/AvailabilityService\">" .
        "<request>" .
            "<detail xsi:type=\"xsd:string\">0</detail>" .
            "<products>".
                "<product>" .
                    "<type xsi:type=\"xsd:int\">0</type>" .
                    "<productID xsi:type=\"xsd:string\"><![CDATA[DE014SML]]></productID>" .
                    "<startDate xsi:type=\"xsd:date\">12/07/2014</startDate>" .
                    "<startTime xsi:type=\"xsd:timeInstant\">8:00 AM</startTime>" .
                    "<endDate xsi:type=\"xsd:date\">12/08/2014</endDate>" .
                    "<endTime xsi:type=\"xsd:timeInstant\">12:00 PM</endTime>" .
                "</product>".
            "</products>" .
        "</request>" .
    "</getAvailabilityByItem>" .
    "</SOAP:Body>" .
    "</SOAP:Envelope>" ;

$location_URL = 'http://21.ip2.ip3.ip4/r2ws_v5/servlet/messagerouter';

$client = new SoapClient(null, array(
'location' => $location_URL,
'uri' => "",
'trace' => 1,
    ));
$order_return = $client->__doRequest($xmlRequest, $location_URL, '' , 1);
$xmlRequest=”“。
"" .
"" .
"" .
"0" .
"".
"" .
"0" .
"" .
"12/07/2014" .
“上午8点”。
"12/08/2014" .
“下午12点”。
"".
"" .
"" .
"" .
"" .
"" ;
$location\u URL='1http://21.ip2.ip3.ip4/r2ws_v5/servlet/messagerouter';
$client=新的SoapClient(空,数组(
'location'=>$location\u URL,
“uri”=>“”,
“跟踪”=>1,
));
$order\u return=$client->\u doRequest($xmlRequest,$location\u URL',,1);

希望您找到了解决方案;)

这对我来说非常有效。我已经好几天试着用soapCall打电话了,但这更容易!