2017-11-20 9 views
0

だから、私はPELVG02.wsdlという名前のWSDLファイルで定義されている<soap:address location="http://212.205.47.226:9003"/>phpでsoapを使用しようとすると、「ホストに接続できませんでした」というエラーが返されます。 SoapUiを使用して同じwsdlファイルが正常に動作します。私は何が欠けていますか?

からの特定の応答を取得するには、PHPで使用するWSDLファイルを持っています。内容は次のとおりです。

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 
<definitions name="PELVG02" targetNamespace="/PELVG02" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="/PELVG02" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
    <!-- Micro Focus NetExpress generated WSDL document--> 
    <types> 
     <schema elementFormDefault="qualified" targetNamespace="/PELVG02" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="/PELVG02"> 
     <element name="READ"> 
      <complexType> 
      <sequence> 
       <element name="pel_user_code" type="string"/> 
       <element name="pel_user_pass" type="string"/> 
       <element name="pel_apost_code" type="string"/> 
       <element name="pel_paral_name" type="string"/> 
       <element name="pel_paral_address" type="string"/> 
       <element name="pel_paral_area" type="string"/> 
       <element name="pel_paral_tk" type="string"/> 
       <element name="pel_paral_thl_1" type="string"/> 
       <element name="pel_paral_thl_2" type="string"/> 
       <element name="pel_service" type="string"/> 
       <element name="pel_baros" type="string"/> 
       <element name="pel_temaxia" type="string"/> 
       <element name="pel_paral_sxolia" type="string"/> 
       <element name="pel_sur_1" type="string"/> 
       <element name="pel_sur_2" type="string"/> 
       <element name="pel_sur_3" type="string"/> 
       <element name="pel_ant_poso" type="string"/> 
       <element name="pel_ant_poso1" type="string"/> 
       <element name="pel_ant_poso2" type="string"/> 
       <element name="pel_ant_poso3" type="string"/> 
       <element name="pel_ant_poso4" type="string"/> 
       <element name="pel_ant_date1" type="string"/> 
       <element name="pel_ant_date2" type="string"/> 
       <element name="pel_ant_date3" type="string"/> 
       <element name="pel_ant_date4" type="string"/> 
       <element name="pel_asf_poso" type="string"/> 
       <element name="pel_ref_no" type="string"/> 
      </sequence> 
      </complexType> 
     </element> 
     <element name="READResponse"> 
      <complexType> 
      <sequence> 
       <element name="st_flag" type="integer"/> 
       <element name="st_title" type="string"/> 
       <element name="vg_code" type="string"/> 
       <element name="return_vg" type="string"/> 
       <element name="epitagh_vg" type="string"/> 
      </sequence> 
      </complexType> 
     </element> 
     </schema> 
    </types> 
    <message name="READInput"> 
     <part element="tns:READ" name="parameters"/> 
    </message> 
    <message name="READOutput"> 
     <part element="tns:READResponse" name="parameters"/> 
    </message> 
    <portType name="PELVG02"> 
     <operation name="READ"> 
     <input message="tns:READInput"/> 
     <output message="tns:READOutput"/> 
     </operation> 
    </portType> 
    <binding name="PELVG02" type="tns:PELVG02"> 
     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
     <operation name="READ"> 
     <soap:operation soapAction=""/> 
     <input> 
      <soap:body use="literal"/> 
     </input> 
     <output> 
      <soap:body use="literal"/> 
     </output> 
     </operation> 
    </binding> 
    <service name="PELVG02"> 
     <port binding="tns:PELVG02" name="PELVG02"> 
     <documentation> 
      <wsi:Claim conformsTo="http://ws-i.org/profiles/basic/1.0"/> 
     </documentation> 
     <soap:address location="http://212.205.47.226:9003"/> 
     </port> 
    </service> 
    </definitions> 

SoapUIに入力されたファイルはうまく動作します。私はデータを送受信できます。私がPHPを使って同じことをしようとすると、 "ホストに接続できませんでした"というエラーが表示されます。ここで

は、そのエラーが発生したサンプルのPHPです:

<?php 
//Create the client object 
try 
{ 
    $soapclient = new SoapClient('./PELVG02.wsdl'); 

    //Use the functions of the client, the params of the function are in 
    //the associative array 
    $pel = array('pel_user_code' => '9999999', 'pel_user_pass' => '9999999', 'pel_apost_code' => '999999999', 'pel_paral_name' => 'DOKIMI', 'pel_paral_address' => 'DOKIMI 13', 'pel_paral_area' => 'THESSALONIKI', 'pel_paral_tk' => '54646', 'pel_paral_thl_1' => '6973262626', 'pel_paral_thl_2' => '', 'pel_service' => '', 'pel_baros' => '12.50', 'pel_temaxia' => '', 'pel_paral_sxolia' => 'DOKIMI SXOLIA', 'pel_sur_1' => '', 'pel_sur_2' => '', 'pel_sur_3' => '', 'pel_ant_poso' => '', 'pel_ant_poso1' => '', 'pel_ant_poso2' => '', 'pel_ant_poso3' => '', 'pel_ant_poso4' => '', 'pel_ant_date1' => '', 'pel_ant_date2' => '', 'pel_ant_date3' => '', 'pel_ant_date4' => '', 'pel_asf_poso' => '', 'pel_ref_no' => ''); 

    $response = $soapclient->READ($pel); 

    var_dump($response); 
} 
catch(SoapFault $e) 
{ 
    var_dump($e); 
} 
?> 

私は数字と文字が混在している$応答変数に簡単な応答を受け取る必要があります。ここで

は、私がサンプルを持っているXMLであるsoapUIプログラムで取得応答である:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <SOAP-ENV:Body> 
     <ns0:READResponse xmlns:ns0="/PELVG02"> 
     <ns0:st_flag>0</ns0:st_flag> 
     <ns0:st_title/> 
     <ns0:vg_code>NZ000034401GR</ns0:vg_code> 
     <ns0:return_vg/> 
     <ns0:epitagh_vg/> 
     </ns0:READResponse> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

は、私はPHPを動作させることはできませんなぜ私が把握助けてくださいもらえますか?何が私はそこに行方不明ですか?

Thanx事前に。

編集:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pel="/PELVG02"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <pel:READ> 
     <pel:pel_user_code>9999999</pel:pel_user_code> 
     <pel:pel_user_pass>9999999</pel:pel_user_pass> 
     <pel:pel_apost_code>999999999</pel:pel_apost_code> 
     <pel:pel_paral_name>DOKIMI</pel:pel_paral_name> 
     <pel:pel_paral_address>DOKIMI 13</pel:pel_paral_address> 
     <pel:pel_paral_area>THESSALONIKI</pel:pel_paral_area> 
     <pel:pel_paral_tk>54646</pel:pel_paral_tk> 
     <pel:pel_paral_thl_1>6973206899</pel:pel_paral_thl_1> 
     <pel:pel_paral_thl_2></pel:pel_paral_thl_2> 
     <pel:pel_service></pel:pel_service> 
     <pel:pel_baros>12.50</pel:pel_baros> 
     <pel:pel_temaxia>1</pel:pel_temaxia> 
     <pel:pel_paral_sxolia>DOKIMI SXOLIA</pel:pel_paral_sxolia> 
     <pel:pel_sur_1></pel:pel_sur_1> 
     <pel:pel_sur_2></pel:pel_sur_2> 
     <pel:pel_sur_3></pel:pel_sur_3> 
     <pel:pel_ant_poso></pel:pel_ant_poso> 
     <pel:pel_ant_poso1></pel:pel_ant_poso1> 
     <pel:pel_ant_poso2></pel:pel_ant_poso2> 
     <pel:pel_ant_poso3></pel:pel_ant_poso3> 
     <pel:pel_ant_poso4></pel:pel_ant_poso4> 
     <pel:pel_ant_date1></pel:pel_ant_date1> 
     <pel:pel_ant_date2></pel:pel_ant_date2> 
     <pel:pel_ant_date3></pel:pel_ant_date3> 
     <pel:pel_ant_date4></pel:pel_ant_date4> 
     <pel:pel_asf_poso></pel:pel_asf_poso> 
     <pel:pel_ref_no></pel:pel_ref_no> 
     </pel:READ> 
    </soapenv:Body> 
</soapenv:Envelope> 

編集:私は私のPCにMAMPをインストールし、それがいるようですが、あなたが結果を取得し、ファイルPELVG02.wsdlは、私は作品の上に貼り付けられていることを確認するために、sourceuiに次のデータを送ることができますPHPコードはMAMPまたはXAMPPを介して動作します。

それから私はヒットしました!ファイアウォール...私は発信接続を許可しましたtcp|out|d=9003|d=212.205.47.226

csf.allowからsoap関数が働いていました。 D

答えて

0

私のPCにMAMPがインストールされていて、PHPコードがMAMPまたはXAMPPで動作しているようです。

それから私はヒットしました!ファイアウォール...私はtcpにアウトバウンド接続を許可しました| out | d = 9003 | d = 212.205.47.226

csf.allowからsoap関数が機能しました。私たちはその問題を解決したと呼ぶことができると思います:D

関連する問題