SOAP web service error

gudii9
gudii9 used Ask the Experts™
on
hi,
while working with the SOAP web service i gave below as request from wizdler.

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
   
   
    <Body>
        <GetCourseDetailsRequest xmlns="http://xyz.com/courses">
            <id>123</id>
        </GetCourseDetailsRequest>
    </Body>
</Envelope>

i am getting below response when i click go button with POST method selected from drop down

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
        <SOAP-ENV:Fault>
            <faultcode>SOAP-ENV:Client</faultcode>
            <faultstring xml:lang="en">com.sun.xml.wss.XWSSecurityException: Message does not conform to configured policy [ AuthenticationTokenPolicy(S) ]:  No Security Header found; nested exception is com.sun.xml.wss.XWSSecurityException: com.sun.xml.wss.XWSSecurityException: Message does not conform to configured policy [ AuthenticationTokenPolicy(S) ]:  No Security Header found</faultstring>
        </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


can you please advise how to resolve this
whizler1.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2018

Commented:
You need a security header in your envelope

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Header>
  <Security>
    <UsernameToken>
      <Username>username</Username>
      <Password >password</Password>
    </UsernameToken>
  </Security>
 </Header>
   
    <Body>
        <GetCourseDetailsRequest xmlns="http://xyz.com/courses">
            <id>123</id>
        </GetCourseDetailsRequest>
    </Body>
</Envelope>

Open in new window

Author

Commented:
i tried above still says Response failed.

any end to end examples, links, resources  on this to try which works?
Distinguished Expert 2018
Commented:
Distinguished Expert 2018

Commented:
This is a valid answer.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial