Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi below is my soap request , but it is not showing the result on Postman,Advanced rest client and any other tool.

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <UserDetails xmlns="http://tempuri.org/">
      <userName>string</userName>
      <password>string</password>
    </UserDetails>
  </soap12:Header>
  <soap12:Body>
    <GetProductsbyId xmlns="http://tempuri.org/">
      <id>string</id>
    </GetProductsbyId>
  </soap12:Body>
</soap12:Envelope>


[WebMethod(Description = "Returns Products details")]
   [SoapHeader("User", Required = true)]

public ProductDetails[] GetProductId(string id)
   {

       if (User.userName == "testuser" && User.password == "pass123")
       {
           return _prx.Get(id);
       }
       else
       {
           return null;
       }
       return null;
   }


What I have tried:

without authentication is working fine in the browser .
what could be the reason ? please help
Posted
Comments
Richard Deeming 13-Oct-17 8:34am    
Your request has GetProductsbyId, but your method is called GetProductId. Is that a typo in your question?
ali_1 16-Oct-17 1:53am    
Thank you !! now its working :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900