|
Проблема с SOAP, срочно нужна помощь!
#37031158
Ссылка:
Ссылка на сообщение:
Ссылка с названием темы:
|
|
|
|
Здравствуйте форумчане!
Мне необходимо общаться с DHL сервером, отправить ему запрос и получить ответ, что у меня есть?
XML документ следующей структуры
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132.
<?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>intrashipper</cis:user>
<cis:signature>dhl123</cis:signature>
<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>BPI</ProductCode>
<ShipmentDate> 2010 - 12 - 20 </ShipmentDate>
<DeclaredValueOfGoods> 10 . 2 </DeclaredValueOfGoods>
<DeclaredValueOfGoodsCurrency>EUR</DeclaredValueOfGoodsCurrency>
<cis:EKP> 5000000000 </cis:EKP>
<Attendance>
<cis:partnerID> 01 </cis:partnerID>
</Attendance>
<CustomerReference>DHL Weltpaket Schweiz</CustomerReference>
<ShipmentItem>
<WeightInKG> 12 </WeightInKG>
<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>laejen@googlemail.com</cis:email>
<cis:contactPerson>IT Systeme Marketing Vertrieb</cis:contactPerson>
</Communication>
</Shipper>
<Receiver>
<Company>
<cis:Company>
<cis:name1>DHL Schweiz</cis:name1>
</cis:Company>
</Company>
<Address>
<cis:streetName>Schanzenstrasse</cis:streetName>
<cis:streetNumber> 4 </cis:streetNumber>
<cis:Zip>
<cis:other> 3008 </cis:other>
</cis:Zip>
<cis:city>Bern</cis:city>
<cis:Origin>
<cis:countryISOCode>CH</cis:countryISOCode>
</cis:Origin>
</Address>
<Communication>
<cis:phone> 3935655 </cis:phone>
<cis:email>laejen@googlemail.com</cis:email>
<cis:contactPerson>Filiale</cis:contactPerson>
</Communication>
</Receiver>
<ExportDocument>
<InvoiceType>proforma</InvoiceType>
<InvoiceDate> 2010 - 12 - 20 </InvoiceDate>
<InvoiceNumber> 444444 </InvoiceNumber>
<ExportType> 1 </ExportType>
<ExportTypeDescription>für Sonstiges</ExportTypeDescription>
<CommodityCode> 8888888 </CommodityCode>
<TermsOfTrade>DDU</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>
пример моего запроса (я пробовал много вариантов), вот 1 из них:
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102.
$zip= array ('germany'=>'10117');
$zip2= array ('other'=>'3000');
$origin= array ('countryISOCode'=>'DE');
$origin2= array ('countryISOCode'=>'CH');
$company= array ('name1'=>'Muster Company');
$version= array ('majorRelease'=>'1','minorRelease'=>'0');
$person= array ('firstname'=>'Urs','lastname'=>'Hammer');
$shipParam= array ('Authentification'=> array (
'user'=> 'intrashipper',
'signature'=>'dhl123',
'type' => '0'),
'CreateShipmentDDRequest'=> array ('Version'=>$version,
'ShipmentOrder'=> array ('SequenceNumber'=>'1',
'Shipment'=> array ('ShipmentDetails'=> array ('ProductCode'=>'BPI',
'ShipmentDate'=>'2010-12-23',
'DeclaredValueOfGoods'=>'10.2',
'DeclaredValueOfGoodsCurrency'=>'EUR',
'EKP'=>'5000000000',
'Attendance'=> array ('partnerID'=>'01'),
'CustomerReference'=>'DHL Weltpaket Schweiz',
'ShipmentItem'=> array (
'WeightInKG'=>'4',
'PackageType'=>'PK')),
'Service'=> array (
'ShipmentServiceGroupIdent'=> array ('ReturnReceipt'=> false ),),
'Service'=> array ('ShipmentServiceGroupIdent'=> array ('Personally'=> false )),
'Service'=> array ('ServiceGroupDHLPaket'=> array ('Multipack'=> false )),
'BankData'=> array (
'accountOwner'=>'DHL.de',
'accountNumber'=>'1234567891',
'bankCode'=>'87050000',
'bankName'=>'Sparkasse Chemnitz',
'iban'=>'DE34870500001234567891',
'note'=>'Notiz Bank',
'bic'=>'CHEKDE81XXX'
),
'Shipper'=> array ('Company'=>$company,
'Address'=> array ('streetName'=>'Leipziger Strasse',
'streetNumber'=>'47',
'Zip'=>$zip,
'city'=>'Berlin',
'Origin'=>$origin),
'Communication'=> array ('phone'=>'+4930-33215-0',
'email'=>'info@muster.de',
'contactPerson'=>'Max Muster')),
'Receiver'=> array ('Company'=> array ('Person'=>$person),
'Address'=> array ('streetName'=>'Thunstrasse',
'streetNumber'=>'1',
'Zip'=>$zip2,
'city'=>'Bern',
'Origin'=>$origin2),
'Communication'=> array ('phone'=>'+4930-33215-0',
'email'=>'info@muster.de')
),
'ExportDocument'=> array (
'InvoiceType'=>'proforma',
'InvoiceDate'=>'2010-12-23',
'InvoiceNumber'=>'444444',
'ExportType'=>'1',
'ExportTypeDescription'=>'für Sonstiges',
'CommodityCode'=>'8888888',
'TermsOfTrade'=>'DDU',
'Amount'=>'2000',
'Description'=>'777777',
'CountryCodeOrigin'=>'DE',
'AdditionalFee'=>'3.12',
'CustomsValue'=>'2.23',
'CustomsCurrency'=>'EUR',
'PermitNumber'=>'666666',
'AttestationNumber'=>'?',
'ExportDocPosition'=> array (
'Description'=>'Harddisk',
'CountryCodeOrigin'=>'DE',
'CommodityCode'=>'123456',
'Amount'=>'200',
'NetWeightInKG'=>'1',
'GrossWeightInKG'=>'1.2',
'CustomsValue'=>'200',
'CustomsCurrency'=>'EUR')
)
),
'LabelResponseType'=>'URL'
))
);
$soapClient = new SoapClient('http://www.intraship.de/ws/1_0/ISService/DE.wsdl', array ('trace' => 1 , 'soap_version' => SOAP_1_2));
$error = 0 ;
try {
$info = $soapClient->__call("CreateShipmentDD",$shipParam);
print_r ($info);
} catch (SoapFault $fault) {
$error = 1 ;
print ("
alert('ERROR: ".$fault->faultcode."-".$fault->faultstring.".');
;
");
}
в рзультате я получаю ошибку
alert('ERROR: Sender-SOAP-ERROR: Encoding: object hasn't 'Version' property.'); ;
Хотя я указал Version, если я убераю CreateShipmentDDRequest тогда ошибка проподает, но появляется ошибка
alert('ERROR: soapenv:Server-org.apache.axis2.databinding.ADBException: Unexpected subelement CreateShipmentDDRequest.'); ;
что делать, подскажите..., в поиске искал ничего подобного и с таким сервисовм никто неработал, обыскал все
|
|
|