I need to consume a soap service having ws-security username token. Below is my code and error.
<?xml version="1.0" encoding="UTF-8"?>
<api context="/Service" name="ServiceA-Service" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST">
<inSequence>
<header name="To" scope="default" value="https://Service/Service.svc"/>
<property name="Username" scope="axis2" type="STRING" value="MYUSER"/>
<property name="Password" scope="axis2" type="STRING" value="MYPASSWORD"/>
<send>
<endpoint>
<wsdl port="CustomBinding_Service" service="Service" uri="workingSFD.xml">
<enableSec policy="conf:myresources/NewResource.xml"/>
</wsdl>
</endpoint>
</send>
</inSequence>
<outSequence>
<respond/>
</outSequence>
<faultSequence/>
</resource>
</api>
But while sending the below request from Postman:
<soapenv:Envelope>
<soapenv:Header/>
<soapenv:Body>
<arg1>asdsa</arg1>
</soapenv:Body>
</soapenv:Envelope>
It showed me the below error:
Missing wsse:Security header in request {org.apache.axis2.engine.AxisEngine}
I am using the default policy of WSO2 Username token.