dongliao1860 2015-06-16 08:50
浏览 117

获取Soap错误SOAP-ERROR:解析WSDL:无法加载...无法加载外部实体

    //put those data in an array to make the xml below
    $xml = '<order>';
    $xml.=             '<details>';
    $xml.=                '<id>'.$order_number.'</id>';
    $xml.=                '<restaurant>_Generic</restaurant>';
    $xml.=                '<datePlaced>'.date('Y-m-d H:i:s').'</datePlaced>';
    $xml.=                '<deliveryDate>'.$delivery.'</deliveryDate>';    
    $xml.=                '<totalPrice>'.$total.'</totalPrice>';
    $xml.=                '<totalTax>'.$total_tax.'</totalTax>';
    $xml.=                '<totalDiscount>'.$total_discount.'</totalDiscount>';
    $xml.=                '<deliveryFee>'.$total_shipping.'</deliveryFee>';
    $xml.=                '<deliveryFeeTaxable>true</deliveryFeeTaxable>';
    $xml.=                '<tip>0.00</tip>';
    $xml.=                '<orderType>'.$shipping_method.'</orderType>';
    $xml.=                '<orderStatus>ProcessedOffline</orderStatus>';
    $xml.=                '<orderComment>'.$order_comments.'</orderComment>';
    $xml.=             '</details>';
    $xml.=             '<customer>';
    $xml.=                '<billingAddress>';
    $xml.=                   '<firstName>'.$first_name.'</firstName>';
    $xml.=                   '<lastName>'.$last_name.'</lastName>';
    $xml.=                   '<companyName>'.$company.'</companyName>';
    $xml.=                   '<phoneNumber>'.$phone.'</phoneNumber>';
    $xml.=                   '<address1>'.$address_1.'</address1>';
    $xml.=                   '<address1>'.$address_2.'</address1>';
    $xml.=                   '<city>'.$city.'</city>';
    $xml.=                   '<state>'.$state.'</state>';
    $xml.=                   '<zipCode>'.$postcode.'</zipCode>';
    $xml.=                '</billingAddress>';
    $xml.=                '<deliveryAddress>';
    $xml.=                   '<firstName>'.$meta['_shipping_first_name'][0].'</firstName>';
    $xml.=                   '<lastName>'.$meta['_shipping_last_name'][0].'</lastName>';
    $xml.=                   '<companyName>'.$meta['_shipping_company'][0].'</companyName>';
    $xml.=                   '<phoneNumber>'.$phone.'</phoneNumber>';
    $xml.=                   '<address1>'.$meta['_shipping_address_1'][0].'</address1>';
    $xml.=                   '<address2 />';
    $xml.=                   '<city>'. $meta['_shipping_city'][0].'</city>';
    $xml.=                   '<state>'. $meta['_shipping_state'][0].'</state>';
    $xml.=                   '<zipCode>'. $meta['_shipping_postcode'][0].'</zipCode>';
    $xml.=                '</deliveryAddress>';
    $xml.=                '<carInformation />';
    $xml.=                '<pickupInformation />';
    $xml.=             '</customer>';
    $xml.=             '<items>';








                 foreach( $order->get_items() as $item_id => $item ) {

                          $product = $order->get_product_from_item( $item );

                   $xml.= '<item>';
    $xml.=  '<plu></plu>';
    $xml.=       '<title>'.$item['name'].'</title>';
    $xml.=       '<itemPrice>'.$item['item_meta']['_line_total'][0].'</itemPrice>';
    $xml.=       '<qty>'.$item['qty'].'</qty>';
    $xml.=       '<recipient />';
    $xml.=       '<itemComment />';

                                             $xml.= '<options>';
                                                    $xml.=  '<option>';
                $xml.=     '<plu></plu>';
                $xml.=     '<title>'.$item['size'].'</title>';
                $xml.=     '<value>'.$item['brand'].'</value>';
                $xml.=     '<price></price>';
                $xml.=  '</option>';

                                                     $xml.= '</options>';
                     $xml.='</item>';


     }



          $xml.= '</items>';





    $xml.=             '<payment>';
    $xml.=                '<type>CreditCard</type>';
    $xml.=                '<cardInformation>';
    $xml.=                   '<nameOnCard>'.$a.'</nameOnCard>';
    $xml.=                   '<cardType />';
    //$xml.=                     '<cardNumber>'.$a.'</cardNumber>';
    $xml.=                   '<cardNumber>'.$a.'</cardNumber>';
    $xml.=                   '<expMonth>'.$a.'</expMonth>';
    $xml.=                   '<expYear>'.$a.'</expYear>';
    $xml.=                   '<gateway>OfflineProcessing</gateway>';
    $xml.=                   '<transactionType />';
    $xml.=                   '<transactionID />';
    $xml.=                '</cardInformation>';
    $xml.=             '</payment>';
    $xml.=          '</order>';
    ini_set("soap.wsdl_cache_enabled","0");
    ini_set("default_socket_timeout", 100);



            $clienturl = 'http://69.73.228.16:8008/weborder/OnlineOrderXmlProcessor.asmx?WSDL'; // live site



    $client = new SoapClient($clienturl); 


//  print_r($xml);

    $params = array();
    $params["strDocType"] = 'OrderImport';
    $params["strXml"] = $xml;
    $result = $client->ProcessXML($params);

It's not working. But same code used for dev server with different URL. In live server same configuration but showing error.

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://69.73.228.16:8008/weborder/OnlineOrderXmlProcessor.asmx?WSDL' : failed to load external entity "http://69.73.228.16:8008/weborder/OnlineOrderXmlProcessor.asmx?WSDL"

  • 写回答

1条回答 默认 最新

  • douzhi2760 2015-06-17 08:38
    关注

    Yes I got solution.

    After disabling CSF Firewall My code is working.

    You can check it via curl.

    open SSH and type :

    curl  -A ''  -4 http://google.com
    

    you'll get reply. Now check it by your WDSL URL.
    If you got error,, You should disable the firewall.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题