cancel
Showing results for 
Search instead for 
Did you mean: 

Changing SOAP Namespace for Web Service

Former Member
0 Kudos

Hi Experts,

Got a requirement to modify the SOAP namespace for a BAPI program exposed as a web service on SAP.

The fieldd denoting the SOAP namespace is accessible via transaction SE80 and navigating under: Package Name>Enterprise Services>Service Definitions> and double clicking on the exposed web service and selecting "Properties".

The SAP SOAP namespace provided by default is: urn:sap-com:document:sap:rfc:functions

Is anyone aware of a means to modify this namespace on the web service? Any help would be greatly appreciated. Thanks!

Regards,

Lionel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi tan,

Although the SOAP Runtime is generally designed for RFC-type calls, it can also be used to access Web Services that are not implemented in a Web AS. For example, the Google search engine offers some services using SOAP, which can be accessed from the SAP Web AS.

Naming Conventions

The SOAP Runtime offers three methods of representing the original ABAP names (everything in upper case and separated by underscores) as data types in XML. Each method is associated with a different XML namespace:

urn:sap-com:document:sap:rfc:functions – this is the canonical representation, which means that all names in the XML document are represented as they are in ABAP on a 1:1 basis. For repeating groups (such as the rows of a table), an XML element with the tag name item is generated (in writing) and expected (in parsing).

urn:sap-com:document:sap:soap:functions:uc-style – this naming convention is similar to the first one, with the difference that instead of item, the name of the structure of the table row is generated or expected.

urn:sap-com:document:sap:soap:functions:mc-style – this third convention also involves conversion of the upper case ABAP names to mixed case (both upper and lower case), according to the following algorithm: All characters except the first one are implicitly in lower case, and the underscore acts as a Shift key to effect an upper case character. RFC_SYSTEM_INFO thus becomes RfcSystemInfo. The addition of an initial underscore makes the first character lower case: RFCSYSTEM_INFO thus becomes rfcSystemInfo. An underscore character is transferred by adding an additional underscore: RFC__SYSTEM_INFO thus becomes Rfc_systemInfo.

When using the SOAP Runtime caller side, note the following points regarding the naming convention:

If the called Web Service is implemented in the Web AS 6.20, always use the namespace convention urn:sap-com:document:sap:rfc:functions. The namespace for the SOAP method must also be set according to this convention. To do this, specify the importing parameter nsvalue of the method set_method in the class CSoapDocument.

Setting the namespace of the naming convention for the SOAP method does NOT automatically mean that the SOAP Runtime also sets the naming convention for serialized SOAP messages. As a developer, you must ensure that the naming conventions are followed. To do this, you can use the methodsset_tag_name_format and set_item_name_format:

The method set_tag_name_format of the class CSoapDokument can be used to control the upper case or mixed case naming convention for tags that correspond to ABAP data types. To activate the normal ABAP format (upper case), use the value CSoapConstants=>ic_tagfmt_default for the importing parameter format. To switch to the mixed format, use the value CSoapConstants=>ic_tagfmt_mixcase.

The method set_item_name_format of the class CSoapDokument is used to control the use of the tag name for repeating groups in ABAP data types (table rows). To implement the structure name of the table row, set the value CSoapConstants=>ic_itemfmt_default for the importing parameter format. To use item as a tag, set the value CSoapConstants=>ic_itemfmt_useitem.

All names passed to the API must be in a format that is expected by the server side. This affects the importing parameter name of both the methods set_method and add_parameter of the class CSoapDocument. The SOAP Runtime caller side does not perform any conversion of these names. The document class on the calling side does NOT take into account the namespace you have selected here.

You should only implement the mixed case naming convention where it is necessary. This particularly applies when calling external Web Services, over the structure of which you have no control.

Sending the SOAP Header in the Call

The SOAP Framework does not provide general support for the handling of SOAP Header elements.

However, for calling external Web services, it is sometimes sufficient to be able to send simple Header entries as part of the request. In this special case, you can use the class CSoapDocumentHeader.

An instance of the class can be filled using the methods set_header_as_string or set_header_as_dataref. Using the method add_header, it can then be added to an instance of the class CSoapDocument, and is then serialized as a part of the document instance when the call is made.

regards

karthik

dont forgrt to reward me points if it helps u

Former Member
0 Kudos

Hi experts ,

I need some help from u

I m using the soapdocument class - methods to acess a webservice from abap

the problem im facing is that ma webservice is in java .. (EJB)

the tags are in small caps (first letter is always in small case )

abap provides us with method of tag_format in which only uppercase n mixcase are possible

is there ne possible way through which i can change the format of the tags to lowercase .... atleast the first letter to lower case .....

thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

Pls see Note 853824 - Known limitations for Web Services in the Business Connector

Regards

Shaji