Stop googling SAP errors. Use our Free Essentials plan instead - no credit card needed. Start Now

Close

How To Fix WSS039 - Wrong token type received. Endpoint expects &1 token.


SAP Error Message - Details

  • Message type: E = Error

  • Message class: WSS - Web Services Security

  • Message number: 039

  • Message text: Wrong token type received. Endpoint expects &1 token.

  • Show details Hide details


  • Self-Explanatory Message

    Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of messages in the SAP system have a message text, however this is frequently insufficient to comprehend or resolve the problem.

    To make things easier, more detailed information is frequently added to describe the issue, how to fix it, and the necessary steps or configuration modifications.

    Unfortunately, there isn't any extra information in this error notice.



    What else can you do?

    First, use our AnswerBot below to get a possible cause and solution (requires a premium subscription).

    Also, review the in-depth Common Questions & Answers listed below; you could discover a solution there or be able to connect with others who have faced similar challenges.

    You can also try searching the SAP support portal (support.sap.com) but you need a special user ID to access it. It is possible that an SAP support note exists that provides additional details about the mistake or even steps for fixing it.


Smart SAP Assistant

  • What is the cause and solution for SAP error message WSS039 - Wrong token type received. Endpoint expects &1 token. ?

    SAP Error Message:
    WSS039 Wrong token type received. Endpoint expects &1 token.


    Cause:

    This error occurs in the context of SAP Web Services Security (WS-Security) processing. It indicates that the security token received in the SOAP message does not match the type of token expected by the receiving endpoint.

    • The endpoint (SAP Web Service) expects a specific type of security token (e.g., UsernameToken, BinarySecurityToken, SAML token, X.509 certificate token, etc.).
    • However, the incoming SOAP message contains a different token type.
    • This mismatch can happen due to incorrect WS-Security configuration on the client or server side, or due to a misalignment in the security policy expectations.

    Typical Scenarios:

    • The client sends a UsernameToken, but the server expects an X.509 certificate token.
    • The client sends a SAML token, but the server expects a UsernameToken.
    • The security policy on the server is configured to require a specific token type, but the client does not comply.
    • Misconfiguration in the WS-Security policy or in the SAP Web Service runtime settings.

    Solution:

    1. Check the WS-Security Policy Configuration:

      • Verify the security policy attached to the SAP Web Service endpoint.
      • Confirm which token type is expected (e.g., UsernameToken, X.509 certificate, SAML).
      • This can be checked in the SOAMANAGER transaction under the Web Service configuration.
    2. Check the Client Configuration:

      • Ensure the client sends the correct token type as per the server's WS-Security policy.
      • If you are using SAP PI/PO, SOAP UI, or any other client, verify the WS-Security settings.
      • Adjust the client to send the expected token type.
    3. Align Security Policies:

      • If possible, adjust the server's WS-Security policy to accept the token type sent by the client.
      • Or, update the client to comply with the server's expected token type.
    4. Check the SOAP Message:

      • Analyze the SOAP message headers to see the actual token type sent.
      • Use tools like SOAP UI, Wireshark, or SAP's trace tools (e.g., ST22, SMICM trace) to inspect the message.
    5. SAP Notes and Documentation:

      • Check SAP Notes related to WS-Security token issues.
      • For example, SAP Note 1689270 and others related to WS-Security token handling.

    Related Information:

    • Transaction SOAMANAGER: Used to configure Web Service endpoints and their security policies.
    • WS-Security Token Types:
      • UsernameToken
      • X.509 Certificate Token (BinarySecurityToken)
      • SAML Token
      • Kerberos Token
    • SAP Web Service Security: SAP supports WS-Security standards and requires correct token types as per policy.
    • SAP Help Portal: Documentation on WS-Security and Web Service configuration.
    • Common SAP Notes:
      • 1689270 - WS-Security: How to configure UsernameToken and X.509 certificates
      • 1789270 - Troubleshooting WS-Security issues in SAP Web Services

    Summary:

    The error WSS039 Wrong token type received. Endpoint expects &1 token. means the security token type in the incoming SOAP message does not match the expected token type configured on the SAP Web Service endpoint. To resolve, verify and align the WS-Security policies and client configurations to ensure the correct token type is sent and accepted.


    If you provide details about your environment (e.g., client type, SAP system version, WS-Security policy), I can help with more specific guidance.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Sign up for our Free Essentials Plan.


Related SAP Error Messages

Click the links below to see the following related messages:

Click on this link to search all SAP messages.


Rating
ERPlingo's SAP support assistant is amazing. Saves me countless hours trying to solve complex SAP issues myself. It's a real game changer!
Rate 1
Thomas Michael
SAP Consultant, Author & Speaker