コード例 #1
0
  public void test2Soap12TestRpcPortEchoStruct() throws Exception {
    test.wsdl.soap12.assertion.Soap12TestRpcBindingStub binding;
    try {
      binding =
          (test.wsdl.soap12.assertion.Soap12TestRpcBindingStub)
              new test.wsdl.soap12.assertion.WhiteMesaSoap12TestSvcLocator().getSoap12TestRpcPort();
    } catch (javax.xml.rpc.ServiceException jre) {
      if (jre.getLinkedCause() != null) jre.getLinkedCause().printStackTrace();
      throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
    }
    assertNotNull("binding is null", binding);

    // Time out after a minute
    binding.setTimeout(60000);

    test.wsdl.soap12.assertion.xsd.SOAPStruct input =
        new test.wsdl.soap12.assertion.xsd.SOAPStruct();
    input.setVarFloat(-5);
    input.setVarInt(10);
    input.setVarString("EchoStruct");

    // Test operation
    test.wsdl.soap12.assertion.xsd.SOAPStruct output = null;
    output = binding.echoStruct(input);
    // TBD - validate results
    assertEquals(input, output);
  }
コード例 #2
0
  public void test4Soap12TestRpcPortEchoStructAsSimpleTypes() throws Exception {
    test.wsdl.soap12.assertion.Soap12TestRpcBindingStub binding;
    try {
      binding =
          (test.wsdl.soap12.assertion.Soap12TestRpcBindingStub)
              new test.wsdl.soap12.assertion.WhiteMesaSoap12TestSvcLocator().getSoap12TestRpcPort();
    } catch (javax.xml.rpc.ServiceException jre) {
      if (jre.getLinkedCause() != null) jre.getLinkedCause().printStackTrace();
      throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
    }
    assertNotNull("binding is null", binding);

    // Time out after a minute
    binding.setTimeout(60000);

    test.wsdl.soap12.assertion.xsd.SOAPStruct input =
        new test.wsdl.soap12.assertion.xsd.SOAPStruct();
    input.setVarFloat(-5);
    input.setVarInt(10);
    input.setVarString("EchoStructAsSimpleTypes");

    javax.xml.rpc.holders.StringHolder out1 = new javax.xml.rpc.holders.StringHolder();
    javax.xml.rpc.holders.IntHolder out2 = new javax.xml.rpc.holders.IntHolder();
    javax.xml.rpc.holders.FloatHolder out3 = new javax.xml.rpc.holders.FloatHolder();

    // Test operation
    binding.echoStructAsSimpleTypes(input, out1, out2, out3);
    // TBD - validate results
    assertEquals(out1.value, input.getVarString());
    assertEquals(out2.value, input.getVarInt());
    assertTrue(out3.value == input.getVarFloat());
  }