Quantcast
Channel: SCN : Discussion List - Service-Oriented Architecture (SOA) and SAP
Viewing all articles
Browse latest Browse all 143

Unexpected element when using external web service

$
0
0

Hello,

 

I'm new in webservice and i have trouble to implement my first webservice.

 

1- I have created the service consumer from the wsdl file. The wsdl file looks like this :


<wsdl:definitionsxmlns:http="http://schemas.xmlsoap.org/wsdl/http/"xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:tns="http://pojos.ws.siveco.com"xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"xmlns:xformat="http://cxf.apache.org/bindings/xformat"name="purchaseinvoicecreate"targetNamespace="http://pojos.ws.siveco.com">

 

<wsdl:types>

 

 

<xs:schemaxmlns:http="http://schemas.xmlsoap.org/wsdl/http/"xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:tns="http://pojos.ws.siveco.com"xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"xmlns:xformat="http://cxf.apache.org/bindings/xformat"xmlns:xs="http://www.w3.org/2001/XMLSchema"attributeFormDefault="unqualified"elementFormDefault="unqualified"targetNamespace="http://pojos.ws.siveco.com">

 

 

<xs:elementname="securityHeaderType">

 

 

<xs:complexType>

 

 

<xs:sequence>

 

 

<xs:elementname="DataSource"type="xs:string"/>

 

<xs:elementname="UserName"type="xs:string"/>

<xs:elementname="password"type="xs:string"/>

<xs:elementminOccurs="0"name="cwUser"type="xs:string"/>

<xs:elementminOccurs="0"name="language"type="xs:string"/>

</xs:sequence>

</xs:complexType>

</xs:element>

 

<xs:elementname="createPIPI">

 

 

<xs:complexType>

 

 

<xs:sequence>

 

 

<xs:elementminOccurs="0"name="PipiCode">

 

 

<xs:simpleType>

 

 

<xs:restrictionbase="xs:string">

 

 

<xs:maxLengthvalue="10"/>

 

</xs:restriction>

</xs:simpleType>

</xs:element>

...


2- I configured SOAMANAGER with a default port. I used the URL /services/purchaseinvoice/create?WSDL. I manage to do the ping.

 

Capture.JPG

 

 

3 - I have created my abap program.

 

   DATA lo_proxy  TYPE REF TO zgm_co_purchaseinvoicecreate_1.

   DATA ls_output TYPE zgm_create_output1.

   DATA lo_exc    TYPE REF TO cx_root.

   DATA lv_msg    TYPE string.

   DATA ls_cr     TYPE ty_s_cr.

 

   TRY.

*     instantiate the object reference

       IF lo_proxy IS NOT BOUND.

         CREATE OBJECT lo_proxy TYPE zgm_co_purchaseinvoicecreate_1.

       ENDIF.

 

       TRY.

           CALL METHOD lo_proxy->create

             EXPORTING

               input  = ps_input

             IMPORTING

               output = ls_output.

 

         CATCH cx_ai_system_fault INTO lo_exc .

           lv_msg = lo_exc->get_text( ).

 

           ls_cr-icon = icon_red_light.

           ls_cr-belnr = ps_factures-belnr.

           ls_cr-gjahr = ps_factures-gjahr.

           ls_cr-message = lv_msg.

           APPEND ls_cr TO pt_cr.

           pv_subrc = 4.

 

         CATCH ZGM_CX_COSWIN_EXCEPTION1 INTO lo_exc .

           lv_msg = lo_exc->get_text( ).

 

           ls_cr-icon    = icon_red_light.

           ls_cr-belnr   = ps_factures-belnr.

           ls_cr-gjahr   = ps_factures-gjahr.

           ls_cr-message = lv_msg.

           APPEND ls_cr TO pt_cr.

           pv_subrc = 4.

       ENDTRY.



Now when i run it i get the error message : SOAP:14 Unexpected element -el=definitions ns=http://schemas.xmlsoap.org/wsdl/


I saw that there are already other topic dealing with kind of issue but i didn't manage to solve the issue.


Any help will be usefull.


Thanks a lot.


laurent.


Viewing all articles
Browse latest Browse all 143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>