Hello all again,

I am encountering some strange behavior and I am not sure how to correct the 
issue.

I am attempting to perform some integration testing and the test is hanging 
within an http-soap call.  The program, however, has no problem getting the 
wsdl right before this (see the GetMethod below)

If I create a complete service-assembly and deploy it to a servicemix 
installation, the call works without a problem.

While debugging I can tell that the simpleService gets called and returns 
properly.  It appears that, later on, the servlet is not returning the 
response to the httpClient.

Am I missing some configuration for Jetty?

Any help will be greatly appreciated.

Thanks,
James


================================

the junit test is:

public class WeirdTest extends TestCase {

   private String getServiceUnitPath(String name) {
      URL url = getClass().getClassLoader().getResource(name);
      File path = new File(url.getFile());
      path = path.getParentFile();
      return path.getAbsolutePath();
   }

   public void testMe() throws Exception {
      JBIContainer container = new JBIContainer();
      container.setUseMBeanServer(false);
      container.setCreateMBeanServer(false);
      container.setNamingContext(new InitialContext());
      container.setMonitorInstallationDirectory(false);
      container.setEmbedded(true);
      container.setFlowName("st");

      container.init();
      container.start();

      Jsr181Component component = new Jsr181Component();
      HttpComponent hComponent = new HttpComponent();

      container.activateComponent(component, "JSR181Component");
      container.activateComponent(hComponent, "HttpComponent");

      component.getServiceUnitManager().deploy("engine-su",
            getServiceUnitPath("engine-su/xbean.xml"));
      component.getServiceUnitManager().init("engine-su",
            getServiceUnitPath("engine-su/xbean.xml"));
      component.getServiceUnitManager().start("engine-su");

      hComponent.getServiceUnitManager().deploy("binding-su",
            getServiceUnitPath("binding-su/xbean.xml"));
      hComponent.getServiceUnitManager().init("binding-su",
            getServiceUnitPath("binding-su/xbean.xml"));
      hComponent.getServiceUnitManager().start("binding-su");

      GetMethod get = new GetMethod("http://localhost:8193/Service/?wsdl";);

// vvvvvvvvvvvvv THIS WORKS vvvvvvvvvvvvv
      int state = new HttpClient().executeMethod(get);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      assertEquals(HttpServletResponse.SC_OK, state);
      String response = get.getResponseBodyAsString();
      System.out.println(response);

      InputStream in = getClass().getResourceAsStream("/ping-request.xml");
      InputStreamRequestEntity is = new InputStreamRequestEntity(in);
      PostMethod method = new PostMethod("http://localhost:8193/Service/";);
      method.setRequestEntity(is);
      HttpClient hc = new HttpClient();

// vvvvvvvvvvvvv HANGS HERE vvvvvvvvvvvvv
      int status = hc.executeMethod(method);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      assertEquals(200, status);
      response = method.getResponseBodyAsString();
      System.out.println(response);

      hComponent.getServiceUnitManager().stop("binding-su");
      hComponent.getServiceUnitManager().shutDown("binding-su");
      hComponent.getServiceUnitManager().undeploy("binding-su",
            getServiceUnitPath("binding-su/xbean.xml"));

      component.getServiceUnitManager().stop("engine-su");
      component.getServiceUnitManager().shutDown("engine-su");
      component.getServiceUnitManager().undeploy("engine-su",
            getServiceUnitPath("engine-su/xbean.xml"));
   }
}

=======================

The xbean.xml for the binding is

<?xml version="1.0"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0";
 xmlns:demo="urn:servicemix:soap-binding">

 <http:endpoint service="demo:simple-http-service"
  endpoint="simple-http-service-endpoint" role="consumer"
  targetService="demo:simple-JSR-service"
  targetEndpoint="simple-JSR-service-endpoint"
  locationURI="http://localhost:8193/Service/";
  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"; soap="true" />

</beans>

and the xbean.xml for the SE is

<?xml version="1.0"?>
<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0";
 xmlns:demo="urn:servicemix:soap-binding">

 <classpath>
  <location>.</location>
 </classpath>

 <jsr181:endpoint pojoClass="soap.SimpleService" annotations="none"
  typeMapping="xmlbeans" service="demo:simple-JSR-service"
  endpoint="simple-JSR-service-endpoint" />

</beans>

===========================

the ping-request xml is

<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:urn="urn:servicemix:soap-binding">
   <soapenv:Body>
      <urn:ping>
         <urn:request>MESSAGE IN</urn:request>
      </urn:ping>
   </soapenv:Body>
</soapenv:Envelope>

=======================

and the soap.SimpleService class is

package soap;

public class SimpleService {

    public String ping(String request) {
        String response = "Ping: " + request;
        System.out.println("PINGED: " + request);
        return response;
    }

}







Reply via email to