Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

SOAP web service error

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
Avatar of girionis
girionis
Flag of Greece image

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

Avatar of gudii9

ASKER

i tried above still says Response failed.

any end to end examples, links, resources  on this to try which works?
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is a valid answer.