‎2009 Feb 05 8:26 PM
Hi Experts,
I have a local WSDL file , i create a Proxy object in ABAP, using a Local WSDL file. When i call the method SendEmailResponse from an ABAP Report i get the error
SOAP:14 Unexpected element -el=SendEmailResponse ns=
i guess there is ERROR in my Logical Port Connection, since i am using a Locally Downloaded WSDL file... only setting i have done is with CALL PARAMETERS as
Runtime - Web Service Infra
URL - http://www.abysal.com/soap/soapmail.wdtp
The WSDL file read like...............
<service name="SendEmailService">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">
Abysal Systems Web Service demonstration example
</documentation>
<port binding="tns:SendEmailBinding" name="SendEmailPort">
<soap:address location="http://www.abysal.com/soap/soapmail.wdtp"/>
</port>
</service>
i dont understand whats going wrong. WSDL is correct & webservice call works when using Java WebDynpro. Any pointers would be help full
Regards
Prashant
‎2009 Feb 06 11:09 AM
Try to create a connection in SM59 Type H. After this you need to put the RFC in HTTP Destination. See the example below ( the source code):
TRY.
CREATE OBJECT my_proxy
EXPORTING
logical_port_name = 'LP01'.
CATCH cx_ai_system_fault.
ENDTRY.
TRY.
input-airline_id = p_carrid.
input-connection_id = p_connid.
input-flight_date = p_fldate.
CALL METHOD my_proxy->flight_get_detail
EXPORTING
input = input
IMPORTING
output = output.
CATCH cx_ai_system_fault.
CATCH cx_ai_application_fault.
ENTRY.
Regards,
‎2009 Feb 06 1:04 PM
Hi Marcelo Almeida ,
i Created a RFC destination in SM59 of type H as RFC_DEST_1 & used your coding now the error i recoeve is SOAP:14 Unexpected element -el=root ns=
while creating the Logical port, i specified HTTP destination as my RFC_DEST_1
Path Prefix is empty.
Entire WSDL that i use is downloadable from http://www.abysal.com/soap/AbysalEmail.wsdl.
any idea why error??
Greetings
Prashant
‎2009 Feb 06 4:30 PM
‎2009 Feb 06 4:38 PM
If the connection is OK, Try to get the WSDl again and use this code below:
DATA: my_proxy TYPE REF TO zproxyco_send_email_port_type .
TRY.
CREATE OBJECT my_proxy
EXPORTING
logical_port_name = 'MY_PROXY'
.
CATCH cx_ai_system_fault .
ENDTRY.
DATA: output TYPE zproxysend_email_response .
DATA: input TYPE zproxysend_email_input .
TRY.
CALL METHOD my_proxy->send_email
EXPORTING
input = input
IMPORTING
output = output.
CATCH cx_ai_system_fault .
CATCH cx_ai_application_fault .
ENDTRY.
‎2009 Feb 09 10:44 AM
Sorry it still does not work
i still get error SOAP:14 Unexpected element -el=root ns=
data: sys_exception type ref to cx_ai_system_fault,
sys_exception2 type ref to cx_ai_application_fault,
client_proxy type ref to zco_myesa,
lv_ret_code type int4,
lv_input type zsend_email_input,
lv_response type zsend_email_response.
data: lv_from type string,
lv_from_address type string,
lv_to type string,
lv_to_address type string,
lv_subject type string,
lv_msg type string.
lv_input-from = 'MYSAPTEST'.
lv_input-from_address = 'DUMMYMAILADDRESS HERE'.
lv_input-to = 'Prashant'.
lv_input-to_address = 'MAILADDRESS APPEARS HERE'.
lv_input-subject = ' TEST'.
lv_input-msg_body = ' Hi this is wonderfull to see it work'.
try.
create object client_proxy
exporting
logical_port_name = 'BASIC'.
call method client_proxy->send_email
exporting
input = lv_input
importing
output = lv_response .
catch cx_ai_system_fault into sys_exception .
data lv_err type string.
lv_err = sys_exception->if_message~get_text( ).
write: / lv_err.
catch cx_ai_application_fault into sys_exception2 .
lv_err = sys_exception->if_message~get_text( ).
write: / lv_err.
endtry.
if lv_response is initial.
write: /'Not Executed'.
else.
write: /'Did Execute'.
endif.
‎2009 Feb 06 11:39 AM
Hi,
Check if you are following the below steps to consume the webservice in Proxy generation.
1) Create a Proxy Object in SE80 using the WSDL path...This will create the Proxy class and the methods based on the WSDL..
2) Save and Activate the Proxy.
3) Go to LPCONFIG transaction and the create a default port for the proxy object...(You might not be having access then in debugging change the access and create a default port)..
Then you call the proxy in the program..Hope this solves your problem
Regards
Shiva
‎2009 Feb 06 12:29 PM
‎2009 Apr 17 12:33 PM