ASP.NET - asp.net web service error Microsoft.Web.Services3.Security.SecurityFault: Header http://sc

Asked By rafay ansar on 12-Oct-14 04:22 PM
I am getting the following error 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 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">
   <soap:Header>
      <wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
      <wsa:MessageID>urn:uuid:13dee3e0-d36f-4b94-b769-d981fe391ed8</wsa:MessageID>
      <wsa:RelatesTo>urn:uuid:a506294f-dea5-4ada-b1b2-a3677e00dcce</wsa:RelatesTo>
      <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
      <wsse:Security>
         <wsu:Timestamp wsu:Id="Timestamp-0b0b00f2-2c73-47cb-b951-0f2f8f555dd8">
            <wsu:Created>2014-10-12T20:04:40Z</wsu:Created>
            <wsu:Expires>2014-10-12T20:09:40Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <soap:Fault>
         <faultcode xmlns:q0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">q0:Security</faultcode>
         <faultstring>Microsoft.Web.Services3.Security.SecurityFault: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.
   at Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion.RequireSoapHeaderFilter.ProcessMessage(SoapEnvelope envelope)
   at Microsoft.Web.Services3.Pipeline.ProcessInputMessage(SoapEnvelope envelope)
   at Microsoft.Web.Services3.WseProtocol.FilterRequest(SoapEnvelope requestEnvelope)
   at Microsoft.Web.Services3.WseProtocol.RouteRequest(SoapServerMessage message)
   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)</faultstring>
         <faultactor>http://localhost:4190/AeslPSWebService.asmx</faultactor>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>


and my request is as follows

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
  <soapenv:Header> 
    <_0:Security soap:actor="www.toromont.com" soap:mustUnderstand="true" xmlns:_0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:_0_1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> 
      <_0_1:Timestamp _0_1:Id="Timestamp-135"> 
        <_0_1:Created>2014-10-10T13:48:35.832Z</_0_1:Created> 
        <_0_1:Expires>2014-10-19T13:53:35.832Z</_0_1:Expires> 
      </_0_1:Timestamp> 
      <_0:UsernameToken _0_1:Id="UsernameToken-136"> 
        <_0:Username>sa</_0:Username> 
        <_0:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Allied@CAT</_0:Password> 
      </_0:UsernameToken> 
    </_0:Security> 
  <par:UserCredentials xmlns:par="http://www.cat.com/MT/2008/11/15/PartStoreRequiredService"/></soapenv:Header> 
  <soapenv:Body> 
    <se:getCustomerInformation xmlns:se="http://www.cat.com/MT/2008/11/15/PartStoreRequiredService" xmlns:xsd="http://customerlookup.partstore.domain.webservice.midtier.websolutions.dcs.cat/xsd"> 
      <se:custLookUpInput> 
        <xsd:custNo>99008</xsd:custNo> 
        <xsd:custType xsi:nil="true"/> 
        <xsd:dealerCode>X130</xsd:dealerCode> 
      </se:custLookUpInput> 
    </se:getCustomerInformation> 
  </soapenv:Body> 
</soapenv:Envelope>

I have developed this web service for our vendor based on the wsdl they provided. Please help as i am unable to find any solution of it.