0

バッチ ラベルを生成するには、PHP を使用して DHL Carrier Service に SOAP リクエストを送信する必要があります。どういうわけか、私はそれがどのように機能するのか理解できません。私はこのコードを書きました:

<?php 

require_once('lib/Zend/Soap/Client.php');
require_once('lib/Zend/Soap/Client/Common.php');

$client = new Zend_Soap_Client('http://test-intraship.dhl.com/ws/1_0/ISService/DE.wsdl',  
                        array(  
                                'soap_version'=>SOAP_1_1  
                                ,'encoding' => 'UTF-8'  
                                ,'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE  
                                ,'location'=>'https://test-intraship.dhl.com/intraship.57/jsp/Login_WS.jsp' 

                        )  
                );  

$location = 'https://test-intraship.dhl.com/intraship.57/jsp/Login_WS.jsp'; 

$request = '
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:cis="http://dhl.de/webservice/cisbase" xmlns:de="http://de.ws.intraship">
<soap:Header><cis:Authentification><cis:user>magento</cis:user><cis:signature>m1a2$!</cis:signature><cis:accountNumber>5000000000</cis:accountNumber><cis:type>0</cis:type></cis:Authentification>
</soap:Header>
<soap:Body><de:CreateShipmentDDRequest>
<cis:Version>
<cis:majorRelease>1</cis:majorRelease>
<cis:minorRelease>0</cis:minorRelease></cis:Version><ShipmentOrder><SequenceNumber>1</SequenceNumber><Shipment><ShipmentDetails><ProductCode>EPN</ProductCode><ShipmentDate>2012-10-03</ShipmentDate><DeclaredValueOfGoods>10.2</DeclaredValueOfGoods><DeclaredValueOfGoodsCurrency>EUR</DeclaredValueOfGoodsCurrency><cis:EKP>5000000000</cis:EKP><Attendance><cis:partnerID>01</cis:partnerID></Attendance><CustomerReference>Auftrag 12883884</CustomerReference><ShipmentItem><WeightInKG>12</WeightInKG><LengthInCM>1</LengthInCM><WidthInCM>1</WidthInCM><HeightInCM>10</HeightInCM><PackageType>PK</PackageType></ShipmentItem><Service><ShipmentServiceGroupIdent><ReturnReceipt>false</ReturnReceipt></ShipmentServiceGroupIdent></Service><Service><ShipmentServiceGroupIdent><Personally>false</Personally></ShipmentServiceGroupIdent></Service><Service><ServiceGroupDHLPaket><Multipack>False</Multipack></ServiceGroupDHLPaket></Service><BankData><cis:accountOwner>DHL.de</cis:accountOwner><cis:accountNumber>1234567891</cis:accountNumber><cis:bankCode>87050000</cis:bankCode><cis:bankName>Sparkasse Chemnitz</cis:bankName><cis:iban>DE34870500001234567891</cis:iban><cis:note>Notiz Bank</cis:note><cis:bic>CHEKDE81XXX</cis:bic></BankData></ShipmentDetails><Shipper><Company><cis:Person><cis:firstname></cis:firstname><cis:lastname>Deutsche Post IT BRIEF GmbH</cis:lastname></cis:Person></Company><Address><cis:streetName>Heinrich-Brüning-Str.</cis:streetName><cis:streetNumber>7</cis:streetNumber><cis:Zip><cis:germany>53113</cis:germany></cis:Zip><cis:city>Bonn</cis:city><cis:Origin><cis:countryISOCode>DE</cis:countryISOCode></cis:Origin></Address><Communication><cis:phone>3935644</cis:phone><cis:email>dhl@dhl.com</cis:email><cis:contactPerson>IT Systeme Marketing  Vertrieb</cis:contactPerson></Communication></Shipper><Receiver><Company><cis:Company><cis:name1>DHL Vertriebs GmbH Co. OHG</cis:name1></cis:Company></Company><Address><cis:streetName>Neue Poststr.</cis:streetName><cis:streetNumber>1</cis:streetNumber><cis:Zip><cis:other>08496</cis:other></cis:Zip><cis:city>Neumark</cis:city><cis:Origin><cis:countryISOCode>DE</cis:countryISOCode></cis:Origin></Address><Communication><cis:phone>3935655</cis:phone><cis:email>dhl@dhl.com</cis:email><cis:contactPerson>CIS 1J4</cis:contactPerson></Communication></Receiver><ExportDocument><InvoiceType>proforma</InvoiceType><InvoiceDate>2012-10-03</InvoiceDate><InvoiceNumber>444444</InvoiceNumber><ExportType>1</ExportType><ExportTypeDescription>für Sonstiges</ExportTypeDescription><CommodityCode>8888888</CommodityCode><TermsOfTrade>CIP</TermsOfTrade><Amount>2000</Amount><Description>777777</Description><CountryCodeOrigin>DE</CountryCodeOrigin><AdditionalFee>3.12</AdditionalFee><CustomsValue>2.23</CustomsValue><CustomsCurrency>EUR</CustomsCurrency><PermitNumber>666666</PermitNumber><AttestationNumber>?</AttestationNumber><ExportDocPosition><Description>Harddisk</Description><CountryCodeOrigin>DE</CountryCodeOrigin><CommodityCode>123456</CommodityCode><Amount>200</Amount><NetWeightInKG>1</NetWeightInKG><GrossWeightInKG>1.2</GrossWeightInKG><CustomsValue>200</CustomsValue><CustomsCurrency>EUR</CustomsCurrency></ExportDocPosition></ExportDocument></Shipment><LabelResponseType>URL</LabelResponseType></ShipmentOrder></de:CreateShipmentDDRequest></soap:Body></soap:Envelope>
';

$clientCommon = new Zend_Soap_Client_Common($client, 'http://test-intraship.dhl.com/ws/1_0/ISService/DE.wsdl',  
                        array(  
                                'soap_version'=>SOAP_1_1  
                                ,'encoding' => 'UTF-8'  
                                ,'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE  
                                ,'location'=>'https://test-intraship.dhl.com/intraship.57/jsp/Login_WS.jsp' 

                        ));  
    $response =  $client->_doRequest($clientCommon, trim($request), $location, 'createShipmentDD', SOAP_1_1);  

    print_r($response);

?> 

XML コードは DHL テスト ツールからコピーされます。アクセス データは標準のテスト データであり、実際には常に機能します。しかし、私はいつも「間違ったログインデータ」メッセージになります。なぜそれができるのですか?

SoapUI プログラムで何かを見つけようとしましたが、これらすべてがどのように機能するかを理解していないようです。

助けてください。

4

2 に答える 2

2

SOAP リクエストを ( https://test-intraship.dhl.com/intraship.57/jsp/Login_WS.jsp) に送信しようとしている URL は、Web サービス エンドポイントとして使用されていません。これは、顧客が DHL Intraship カスタマー ポータルにログインするためのシングル サインオン URL です (そこから手動で区画データを送信できます)。 .

Web サービスのエンドポイントはhttp://test-intraship.dhl.com/ws/1_0/de/ISService(出典: https://entwickler.dhl.de/group/ep/webservices/intraship/quick-start )

于 2012-11-03T19:01:42.993 に答える
0

DHL からの詳細情報が必要な場合があります

https://test-intraship.dhl.com/intraship.57/jsp/Login_WS.jsp

この URL にログインするには、ユーザー名とパスワードが必要です。この情報は、soap:Header ノードで渡した cis:Authentification セクションとは異なります。

この新しいユーザー名とパスワードは、新しい「Zend_Soap_Client_Common」オブジェクトに設定する必要があります。

于 2012-11-01T10:51:55.553 に答える