1

I've coded a WS SOAP server using NuSOAP library, and it's working pretty fine, but as the client should be a SAP implementation, there are some issues when trying to reach it from SAP.

My WSDL is automatically generated by nusoap contains following definitions

<definitions targetNamespace="https://example.com/ws/" 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:tns="https://example.com/ws/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
    <types>
        <xsd:schema elementFormDefault="qualified" targetNamespace="https://example.com/ws/">
        <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
        <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>

This WSDL is validated by soap-ui 5.5 and it works fine with php clients, but not with SAP.

At first time I must switch from rpc/encoding style to document/literal and I can achieve it changing some configurations values in nusoap server class.

Anyway there is a remaining issue according to SAP diagnostics and it is fired by <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>.

The error in SAP is

Incorrect value: Unknown namespace http://schemas.xmlsoap.org/soap/encoding/

I've tested that URL and is correct.

Also I'm trying to strip out that line from soap server class without success, because I found it and commented at line 1106 in class.soap_server.php:

$this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/soap/encoding/'][0] = array('location' => '', 'loaded' => true);

But it doesn't have any effect in generated WSDL.

Any idea will be really appreciated. Thank you in advance.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Farid
  • 542
  • 5
  • 16
  • You don't say how you use the WSDL at SAP side, so I assume you are creating a client proxy via the transaction code SE80 or SPROXY. You may easily download the WSDL to your laptop, edit it locally, and create the client proxy with this locally-edited WSDL file. – Sandra Rossi Aug 23 '19 at 14:38
  • Ey Sandra, thank you for your input. I don't know how SAP team are managing their connection because it is not my area, but they just let me know that error code. So you told me that SAP can manage the connection with a local edit wsdl file, it's ok? Thank you again. – Farid Aug 23 '19 at 15:52
  • I confirm. Creating a SAP client proxy is a classic problem because the SAP WSDL parser doesn't handle all possibilities, and the messages are not enough explicit. There's the SAP note/KBA 944029 (XML schema supported by ABAP proxy generation) which explains a few restrictions (but not all). The only solution is that SAP people adapt the WSDL to what SAP allows, not that the WSDL is changed by the Web Service providers! Remember that my answer is valid only if the SAP team generates an ABAP client proxy. – Sandra Rossi Aug 23 '19 at 16:00
  • Thank you so much Sandra, I will share your thoughts with SAP team, in the meanwhile I will keep trying to modify server class. – Farid Aug 23 '19 at 16:19

1 Answers1

0

I must switch from rpc/encoding style to document/literal

SAP doesn't support RPC-style in Web-services, hence the error.

Here the SAP note which explains how to adapt it

https://launchpad.support.sap.com/#/notes/856597 / Offline version

I attach samples which explaining WSDL format which are contained in the note in case you do not have S-login to access the note.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • Thank you @Suncatcher for your reply. I'm not an expert in this theme, but I have chosen `document/literal` on any complexType definitions, where NuSOAP have a placeholder for `use` and `style`, but I think that it is not enough. Anyway apparently offending lines for SAP are both importing namespaces. ``` ``` because are considered "unknown namespace" – Farid Aug 28 '19 at 15:13