获取 Soap 错误 SOAP-ERROR:解析 WSDL:无法加载..... 无法加载外部实体 [英] Getting Soap Error SOAP-ERROR: Parsing WSDL: Couldn't load..... failed to load external entity

查看:43
本文介绍了获取 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);

它不起作用.但是相同的代码用于具有不同 URL 的开发服务器.在实时服务器中,配置相同但显示错误.

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

SOAP 错误:解析 WSDL:无法从 'http://69.73 加载.228.16:8008/weborder/OnlineOrderXmlProcessor.asmx?WSDL':无法加载外部实体http://69.73.228.16:8008/weborder/OnlineOrderXmlProcessor.asmx?WSDL"

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"

推荐答案

是的,我找到了解决方案.

Yes I got solution.

禁用 CSF 防火墙后,我的代码正在运行.

After disabling CSF Firewall My code is working.

您可以通过 curl 查看.

You can check it via curl.

打开 SSH 并输入:

open SSH and type :

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

你会得到答复.现在通过您的 WDSL URL 检查它.
如果出现错误,则应禁用防火墙.

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

这篇关于获取 Soap 错误 SOAP-ERROR:解析 WSDL:无法加载..... 无法加载外部实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆