3 Replies Latest reply on Nov 29, 2007 12:58 PM by César Mateus

    How could see the endpoint the SOAP headers built by a objec

    César Mateus Newbie

      Hi all, Im have a problem with SOAP headers, because i dont know how see it in endpoint. Explain:

      first im consume de webservice, and i see this and more:
      a class SEI: QMWISeSoap
      a class that provide constructors: ObjectFactory

      The server requires two soap headers, these are build by ObjectFactory, and return a object JAXBElement:
      * Create an instance of {@link JAXBElement }{@code <}{@link TrustHeader }{@code >}}
      @XmlElementDecl(namespace = "http://questionmark.com/QMWISe/", name = "Trust")
      public JAXBElement createTrust(TrustHeader value) {
      return new JAXBElement(_Trust_QNAME, TrustHeader.class, null, value);

      Now, in a class QMWISeWebService is the call to SEI:
      protected QMWISeWebService() {
      try {
      if (endPoint == null){
      endPoint = new QMWISe().getQMWISeSoap();
      } catch (Exception ex) {

      And by example i have a class that inherit from QMWISeWebService :

      public class ParticipantData extends QMWISeWebService {

      * This method processes a Participant Name and a Password and checks
      * whether there is a participant with the Participant Name, and if so
      * whether the Password is theirs.
      * @param participantID
      * @param password
      * @param status
      * @param participantName
      public void checkParticipant(String participantName, String password,
      Holder status, Holder participantID) {
      endPoint.checkParticipant(participantName, password, status,

      The problem is that i dont know how connect the JAXBElement returned by ObjectFactory with the SEI class.

      Part of SEI class is:

      @WebService(name = "QMWISeSoap", targetNamespace = "http://questionmark.com/QMWISe/")
      public interface QMWISeSoap {

      * This method provides information about the QMWISe software that is installed, including the version of the software that is installed, which build of the software is installed and a statement of Question Mark's rights under the license agreement.
      * @return
      * returns com.questionmark.qmwise.Version
      @WebMethod(operationName = "GetAbout", action = "http://questionmark.com/QMWISe/GetAbout")
      @WebResult(name = "GetAboutResult", targetNamespace = "http://questionmark.com/QMWISe/")
      @RequestWrapper(localName = "GetAbout", targetNamespace = "http://questionmark.com/QMWISe/", className = "com.questionmark.qmwise.GetAbout")
      @ResponseWrapper(localName = "GetAboutResponse", targetNamespace = "http://questionmark.com/QMWISe/", className = "com.questionmark.qmwise.GetAboutResponse")
      public Version getAbout();

      And none method of SEI have a parameter that contain data for the SOAP header.

      perhaps this is a trivial problem, but im need help. thanks.

        • 1. Re: How could see the endpoint the SOAP headers built by a o
          Alessio Soldano Master

          First of all take a look at the org.jboss.test.ws.jaxws.samples.webparam sample in the binary distribution. You'll find an example using custom soap header.

          Did you code the wsdl first? In that case you should need something like this in the operation/input element:

          <soap:header message="tns:WSTestEndpoint2_pingOggettoComposto" part="oggettoComposto" use="literal"/>

          If you're developing starting from java classes, JBossWS will do it for you.
          Usually you shouldn't need to use the JAXBElements directly, parameters going to the header are dealt the same way as common ones in your service implementation class.

          • 2. Re: How could see the endpoint the SOAP headers built by a o
            César Mateus Newbie

            Thanks alessio,
            but perhaps that step, simple and intuitive,
            I still do not understand.

            I show you my strategy, and maybe you can give me another hand:
            perhaps quite usual:

            I have
            - a SEI class: QMWISeSoap
            - a class that extend of class javax.xml.ws.Service, and provide the getter (public QMWISeSoap getQMWISeSoap()) for QMWISeSoap: QMWISe
            - a class that provide a instance of QMWISeSoap named endPoint, in its constructor call QMWISe.getQMWISeSoap() and assign it to endPoint : QMWISeWebService
            - a package that contain classes that extend of QMWISeWebService, each class of this package has a methods that call a corresponding method in the SEI class, using the attribute endPoint inherited from QMWISeWebService.

            I begin using this classes, really wrappers of SEI, and operate perfectly.

            A new requirement consist in aggregate security data in SOAP headers.

            After that consume the webservice, i see other class that i dont know how fits in what was already running. This class is named ObjectFactory.

            This class i suppose after of study it, is a factory of objects that represent the requests. Also provide two attributes (securityHeader and trustHeader) and its getters methods and setters methods. These attributes are precisely the data that would need for SOAP headers.

            in this way:
            private final static QName _Trust_QNAME = new QName("http://questionmark.com/QMWISe/", "Trust");
            private final static QName _Security_QNAME = new QName("http://questionmark.com/QMWISe/", "Security");

            * Create an instance of {@link JAXBElement }{@code <}{@link SecurityHeader }{@code >}}
            @XmlElementDecl(namespace = "http://questionmark.com/QMWISe/", name = "Security")
            public JAXBElement createSecurity(SecurityHeader value) {
            return new JAXBElement(_Security_QNAME, SecurityHeader.class, null, value);

            My confusion is that i dont understand how relate this facility of ObjectFactory with the work that had operated.

            First i do this:
            By example
            ParticipantData.createParticipant(Participant participant)
            where ParticipantData is a wrapper of part of SEI.
            then, i created a object participant without using the objectfactory facility, since the Participant class has its constructor and work.
            thinking in integrate the ObjectFactory, then now i created the instance of Participant using the ObjectFactory, in this way:
            participant = factory.createParticipant(), and i setting the securityheader with ObjectFactory. And i call the method of ParticipantData named createParticipant passing it the object Participant builded with the ObjectFactory.

            Lastly i discovered that in the objectfactory there are similar methods to the methods of my wrapper classes. Then i prove calling this methods and not the methods of wrappers.

            Any clarification is greatly appreciated, thank you.

            • 3. Re: How could see the endpoint the SOAP headers built by a o
              César Mateus Newbie

              The class objectFactory provide methods for create objects how:
              in the SEI there is this:

              * This method creates a participant from the participant information supplied and returns the Participant ID of the new participant. If the Participant Name does not already exist in the database, the new participant is created. Any group specified will have the new participant as a member if the group exists in the database. Otherwise the group will be ignored.
              * @param participant
              * @return
              * returns java.lang.String
              @WebMethod(operationName = "CreateParticipant", action = "http://questionmark.com/QMWISe/CreateParticipant")
              @WebResult(name = "Participant_ID", targetNamespace = "http://questionmark.com/QMWISe/")
              @RequestWrapper(localName = "CreateParticipant", targetNamespace = "http://questionmark.com/QMWISe/", className = "com.questionmark.qmwise.CreateParticipant")
              @ResponseWrapper(localName = "CreateParticipantResponse", targetNamespace = "http://questionmark.com/QMWISe/", className = "com.questionmark.qmwise.CreateParticipantResponse")
              public String createParticipant(
              @WebParam(name = "Participant", targetNamespace = "http://questionmark.com/QMWISe/")
              Participant participant);

              By example, What should I do for create a participant?,
              Can I should use the objectfactory? Or just call the method described in SEI. Yes so, as I recognize the headers offered by the factory in a call to SEI?

              For any aid thanks.