0 Replies Latest reply on Jun 3, 2015 5:24 AM by Ankit Patwa

    How to append header in soap Request using JAX-RS

    Ankit Patwa Newbie

      Web Service

       

      @WebService(targetNamespace = "http://Airspan.Netspan.WebServices", name = "InventorySoap")

      @XmlSeeAlso({ObjectFactory.class})

      public interface InventorySoap {

          /**

           * Returns list of Discovery Tasks. Requires NBIF Extensions Licence.

           */

          @WebResult(name = "DiscoveryTaskListResult", targetNamespace = "http://Airspan.Netspan.WebServices")

          @RequestWrapper(localName = "DiscoveryTaskList", targetNamespace = "http://Airspan.Netspan.WebServices", className = "com.netspan.inventory.DiscoveryTaskList")

          @WebMethod(operationName = "DiscoveryTaskList", action = "http://Airspan.Netspan.WebServices/DiscoveryTaskList")

          @ResponseWrapper(localName = "DiscoveryTaskListResponse", targetNamespace = "http://Airspan.Netspan.WebServices", className = "com.netspan.inventory.DiscoveryTaskListResponse")

          public com.netspan.inventory.NameResult discoveryTaskList();

      }

       

      I also have the objectFactory class

       

      @XmlRegistry

      public class ObjectFactory

      {

       

          @XmlElementDecl(namespace = "http://Airspan.Netspan.WebServices", name = "Credentials")

          public JAXBElement<Credentials> createCredentials(Credentials value) {

              return new JAXBElement<Credentials>(_Credentials_QNAME, Credentials.class, null, value);

      }

       

       

      and also Credential Class

      @XmlAccessorType(XmlAccessType.FIELD)

      @XmlType(name = "Credentials", propOrder = {

          "username",

          "password"

      })

      public class Credentials {

       

          public String setUsername() {

          System.out.println("In get username=>>>>>>>>>>>>>>>>>>>>>>>>>>>>");

              return username;

          }

       

      public String setPassword() {

          System.out.println("In get password=>>>>>>>>>>>>>>>>>>>>>>>>>>>>");

              return password;

          }

      }