Skip to Content
0
Former Member
Mar 14, 2014 at 10:52 AM

Consuming WebServices FEDEX

487 Views

Hi all,

I'm consuming the FEDEX's webservices and in my program, when call the webservice, i have the following error in class CX_AI_SYSTEM_FAULT

SoapFaultCode:5 Schema validation failed for request.

I followed these steps:

  1. Upload FEDEX's certificates in with transaction STRUST;
  2. Setting logical port ZFEDEX2, for proxy class ZSAPCO_SHIP_PORT_TYPE
    - I have configured the logical port through the transaction LPCONFIG because I have read in another tread that there could be problems with the soamanager creation

with this RFC Connection TEST FEDEX

and from the connection test i received this result

with this response test

HTTP/1.1 500 Internal Server Error

Set-Cookie: siteDC=edc; expires=Sat, 15-Mar-2014 10:08:21 GMT; path=/; domain=.fedex.com

Content-Type: text/xml; charset=utf-8

date: Fri, 14 Mar 2014 10:08:21 GMT

server: Apache/2.2

Content-Length: 537

x-wily-servlet: Encrypt1 GaMcoOotgOSMyoYj73M4djxB/BFdu6Bd7dK9l2vKcsLoBxuCEbM12kwUffT0WqzWwhNfXxOuv1xkOK5NUzCbP46u7vtBQL8InqrXYgHsCoR6RU11Zne5eRfVnPz2s4QoAfUE5yxilT7zScFtfZK+sxj5Zjkq07EaX/nPYBoBDkMKtoQWupT2pv319V0zUzb33tE3OiegMzcUyiDQsyexGQ==

x-powered-by: Servlet/2.5 JSP/2.1

x-wily-info: Clear guid=C0105A7ECC87128E0CB43EA877E4A475

connection: close

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>9999: Empty web-service request, unable to determine service.</faultstring><detail><con:fault xmlns:con="http://www.bea.com/wli/sb/context"><con:errorCode>9999</con:errorCode><con:reason>Empty web-service request, unable to determine service.</con:reason></con:fault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

My consuming webservices program is:

REPORT zfedex_test.
DATA proxy TYPE REF TO zsapco_ship_port_type.

DATA input TYPE zsapprocess_shipment_request1.
DATA output TYPE zsapprocess_shipment_reply1.

DATA: lo_sys_exception TYPE REF TO cx_ai_system_fault ,
err_string TYPE string.

TRY.
CREATE OBJECT proxy
EXPORTING
logical_port_name = 'ZFEDEX2'.
CATCH cx_ai_system_fault.
ENDTRY.

input-process_shipment_request-web_authentication_detail-user_credential-key = '*************************'.
input-process_shipment_request-web_authentication_detail-user_credential-password = ‘******************************'.


input-process_shipment_request-client_detail-account_number = '************'.
input-process_shipment_request-client_detail-meter_number = '*************'.

input-process_shipment_request-transaction_detail-customer_transaction_id = 'TEST'.


input-process_shipment_request-version-service_id = 'ship'.
input-process_shipment_request-version-major = '13'.
input-process_shipment_request-version-intermediate = '0'.
input-process_shipment_request-version-minor = '0'.

*input-process_shipment_request-REQUESTED_SHIPMENT-Ship_Timestamp = '2014-02-10T06:28:50'.
input-process_shipment_request-requested_shipment-dropoff_type = 'REGULAR_PICKUP'.
input-process_shipment_request-requested_shipment-service_type = 'SMART_POST'.
input-process_shipment_request-requested_shipment-packaging_type = 'YOUR_PACKAGING'.

input-process_shipment_request-requested_shipment-shipper-contact-person_name = 'Sender Name'.
input-process_shipment_request-requested_shipment-shipper-contact-company_name = 'Sender Company Name'.
input-process_shipment_request-requested_shipment-shipper-contact-phone_number = '1234567890'.

APPEND 'Address line 1' TO input-process_shipment_request-requested_shipment-shipper-address-street_lines.
input-process_shipment_request-requested_shipment-shipper-address-city = 'Austin'.
input-process_shipment_request-requested_shipment-shipper-address-state_or_province_code = 'TX'.
input-process_shipment_request-requested_shipment-shipper-address-postal_code = '73301'.
input-process_shipment_request-requested_shipment-shipper-address-country_code = 'US'.

input-process_shipment_request-requested_shipment-recipient-contact-person_name = 'Recipient Name'.
input-process_shipment_request-requested_shipment-recipient-contact-company_name = 'Recipient Company Name'.
input-process_shipment_request-requested_shipment-recipient-contact-phone_number = '1234567890'.

APPEND 'Address Line 1' TO input-process_shipment_request-requested_shipment-recipient-address-street_lines.
input-process_shipment_request-requested_shipment-recipient-address-city = 'Herndon'.
input-process_shipment_request-requested_shipment-recipient-address-state_or_province_code = 'VA'.
input-process_shipment_request-requested_shipment-recipient-address-postal_code = '20171'.
input-process_shipment_request-requested_shipment-recipient-address-country_code = 'US'.

input-process_shipment_request-requested_shipment-shipping_charges_payment-payment_type = 'SENDER'.
input-process_shipment_request-requested_shipment-shipping_charges_payment-payor-responsible_party-account_number = '510087941'.

input-process_shipment_request-requested_shipment-smart_post_detail-indicia = 'PARCEL_SELECT'.
input-process_shipment_request-requested_shipment-smart_post_detail-ancillary_endorsement = 'CARRIER_LEAVE_IF_NO_RESPONSE'.
input-process_shipment_request-requested_shipment-smart_post_detail-hub_id = '5531'.

input-process_shipment_request-requested_shipment-label_specification-label_format_type = 'COMMON2D'.
input-process_shipment_request-requested_shipment-label_specification-image_type = 'PDF'.
input-process_shipment_request-requested_shipment-label_specification-label_stock_type = 'PAPER_7X4.75'.


APPEND 'account' TO input-process_shipment_request-requested_shipment-rate_request_types.
input-process_shipment_request-requested_shipment-package_count = '1'.

DATA linea TYPE LINE OF zsaprequested_package_line_tab.
linea-sequence_number = '1'.
linea-group_package_count = '1'.
linea-weight-units = 'LB'.
linea-weight-value = '5'.
linea-dimensions-length = '6'.
linea-dimensions-width = '4'.
linea-dimensions-height = '1'.
linea-dimensions-units = 'IN'.

DATA cref TYPE LINE OF zsapcustomer_reference_tab.
cref-customer_reference_type = 'CUSTOMER_REFERENCE'.
cref-value = 'GR4567892'.
APPEND cref TO linea-customer_references.
cref-customer_reference_type = 'INVOICE_NUMBER'.
cref-value = 'INV4567892'.
APPEND cref TO linea-customer_references.
cref-customer_reference_type = 'P_O_NUMBER'.
cref-value = 'PO4567892'.
APPEND cref TO linea-customer_references.

APPEND linea TO input-process_shipment_request-requested_shipment-requested_package_line_items.



*PROCESS_SHIPMENT_REQUEST
*
*WEB_AUTHENTICATION_DETAIL
*CLIENT_DETAIL
*TRANSACTION_DETAIL
*VERSION
*REQUESTED_SHIPMENT
*
*USER_CREDENTIAL
*
*KEY
*PASSWORD

TRY.
CALL METHOD proxy->process_shipment
EXPORTING
input = input
IMPORTING
output = output.

CATCH cx_ai_system_fault INTO lo_sys_exception.
err_string = lo_sys_exception->get_text( ).

CATCH cx_ai_application_fault .
ENDTR

Attachments

pastedImage_7.png (37.1 kB)
pastedImage_8.png (43.1 kB)
pastedImage_10.png (104.2 kB)
pastedImage_12.png (11.0 kB)