cancel
Showing results for 
Search instead for 
Did you mean: 

Another webservice authentication issue (SOAP Header)

russell_turner5
Explorer
0 Kudos

Hi experts,

I am trying to call a webservice in a CE7.3 system from an ABAP function module. I build up my SOAP Header like described here:

'<SOAP-ENV:Header>'
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"'

' xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"'

' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'

'    <wsse:UsernameToken>'
'      <wsse:Username>XXXXXXXX</wsse:Username>'
'      <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXXXXX</wsse:Password>'
'    </wsse:UsernameToken>'
</wsse:Security>'
'</SOAP-ENV:Header>'

Now, if the service is set to un-autheticated in NWA (no http/message username/password/logon ticket) then the service gets called as the Guest user and runs OK. If I enable Username/Password authentication at HTTP or Message level then I get an unauthorised error in the log. Can anyone give me a guide/pointers? I thought I understood this but I clearly don't.

Cheers,

Russ.

Accepted Solutions (0)

Answers (2)

Answers (2)

attila_mikulan
Employee
Employee
0 Kudos

Hi Russell

To enable usernametoken in ABAP you don't need to manually write the code in the program. In SOAMANAGER you can configure a logical port which is set to usernametoken authentication, you only need to enter the logon data there.

It's only possible to create such logical port using a WSDL file which has correct policy. You can also add manually the necessary policy, an example is described in note 1710478. To get the usernametoken policy, generate a binding for a service definition in SAP ABAP and copy-paste from the WSDL to your WSDL.

Cheers,

Attila

Harish
Active Contributor
0 Kudos

Hi Russ,

Please check the below blog

regards,

Harish