title: What's the class used by Mule to send JMS Message (Endpoint)
body: <p>I'm trying to send a message with the existing Mule code. Already made some code but for some reason and as far as i've read there's kinda an axis "bug". </p>
  
  <p>Used JMSEndpoint to then call the "call" method to send the message and wait for a response. This is my code:</p>
  
  <pre><code>        String payload = eventContext.getMessage().getPayloadAsString();
          JmsConnector amqConnector = (JmsConnector) eventContext.getMuleContext().getRegistry().lookupConnector("Active_MQ");
          JMSVendorAdapter adapter = JMSVendorAdapterFactory.getJMSVendorAdapter();
          QueueConnector connector = new QueueConnector(amqConnector.getConnectionFactory(), 1, 1, 2000, 2000, 60000, true, null, null, null, adapter, null);
  
          Connection connection = connector.getConnectionFactory().createConnection();
          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
          Queue queue = session.createQueue("ExampleQueue");
          JMSEndpoint endpoint = connector.createEndpoint(queue);
          connector.start();
  
  //      Byte byteMessage = new Byte(payload);
  //      BytesMessage mess = session.createBytesMessage();
  //      mess.writeByte(byteMessage);
  
          byte[] response = endpoint.call(payload.getBytes("UTF-8"), 10000);
  
          return response.toString();
  </code></pre>
  
  <p>The method itself is asking for a byte[] so i'm giving it a byte[] with UTF-8 charset.
  But its throwing this error: </p>
  
  <pre><code>org.apache.axis.transport.jms.InvokeException: Error: unexpected message type received - expected BytesMessage
  </code></pre>
  
  <p>In the JMSConnector class, it's failing in this block:</p>
  
  <pre><code>BytesMessage response = null;
                  try {
                      response = (BytesMessage)subscriber.receive(timeout);
                  } catch (ClassCastException cce) {
                      throw new InvokeException
                              ("Error: unexpected message type received - expected BytesMessage");
                  }
  </code></pre>
  
  <p>There was an opened ticket regarding this issue, which they called to be a "bug"??? So its kinda a ClassCastException being thrown! can't believe this has been made! Is there a way to solve this??? How does Mule do it then??</p>
  
  <p>How can I achieve sending JMS Messages to a Queue like Mule does in its component?</p>
  
  <p>Thanks.</p>