コード例 #1
0
  public void _testGenericSOAPBindingOperation() {
    // REVIEW: Currently generic operations are not supported for SOAP Bindings

    ServiceDescription serviceDesc =
        DescriptionFactory.createServiceDescription(SOAPBindingProviderImpl.class);
    assertNotNull(serviceDesc);
    EndpointDescription endpointDesc =
        serviceDesc.getEndpointDescriptions_AsCollection().iterator().next();
    assertNotNull(endpointDesc);
    AxisService axisSvc = endpointDesc.getAxisService();
    assertNotNull(axisSvc);

    // Since there's no WSDL, there will be no operations and no EndpointInterfaceDescription
    // because this is a SOAPBinding.
    EndpointInterfaceDescription interfaceDesc = endpointDesc.getEndpointInterfaceDescription();
    assertNull(interfaceDesc);
  }
コード例 #2
0
  public void testSEIBasedEndpoint() {
    ServiceDescription serviceDesc =
        DescriptionFactory.createServiceDescription(SEIBasedEndpoint.class);
    assertNotNull(serviceDesc);
    EndpointDescription endpointDesc =
        serviceDesc.getEndpointDescriptions_AsCollection().iterator().next();
    assertNotNull(endpointDesc);
    AxisService axisSvc = endpointDesc.getAxisService();
    assertNotNull(axisSvc);

    EndpointInterfaceDescription interfaceDesc = endpointDesc.getEndpointInterfaceDescription();
    assertNotNull(interfaceDesc);

    // There should be a single OpDesc with a single AxisOperation based on the SEI below
    // But it should not be the special named operation and the special dispatcher should not
    // return null for operation dispatch
    OperationDescription opDescs[] = interfaceDesc.getOperations();
    assertNotNull(opDescs);
    assertEquals(1, opDescs.length);
    AxisOperation axisOperation = opDescs[0].getAxisOperation();
    assertNotNull(axisOperation);
    if (EndpointInterfaceDescription.JAXWS_NOWSDL_PROVIDER_OPERATION_NAME.equals(
        axisOperation.getName().getLocalPart())) {
      fail("Operation has the generic provider name");
    }

    // Now verify that the special dispather doesn't find the special operation
    GenericProviderDispatcher dispatcher = new GenericProviderDispatcher();
    MessageContext messageContext = new MessageContext();
    messageContext.setAxisService(axisSvc);

    try {
      // The dispatcher will not try to resolve an AxisService
      assertNull(dispatcher.findService(messageContext));

      // The dispatcher should find the special AxisOperation
      assertNull(dispatcher.findOperation(axisSvc, messageContext));
    } catch (AxisFault e) {
      fail("Unexpected exception" + e);
    }
  }
コード例 #3
0
  public void testGenericHTTPBindingOperation() {
    // The HTTP binding supports a generic operation for WSDL-less endpoints.
    ServiceDescription serviceDesc =
        DescriptionFactory.createServiceDescription(HTTPBindingProviderImpl.class);
    assertNotNull(serviceDesc);
    EndpointDescription endpointDesc =
        serviceDesc.getEndpointDescriptions_AsCollection().iterator().next();
    assertNotNull(endpointDesc);
    AxisService axisSvc = endpointDesc.getAxisService();
    assertNotNull(axisSvc);

    EndpointInterfaceDescription interfaceDesc = endpointDesc.getEndpointInterfaceDescription();
    assertNotNull(interfaceDesc);

    // There should be a single OpDesc with a single AxisOperation with a specific name
    OperationDescription opDescs[] = interfaceDesc.getOperations();
    assertNotNull(opDescs);
    assertEquals(1, opDescs.length);
    AxisOperation axisOperation = opDescs[0].getAxisOperation();
    assertNotNull(axisOperation);
    assertEquals(
        EndpointInterfaceDescription.JAXWS_NOWSDL_PROVIDER_OPERATION_NAME,
        axisOperation.getName().getLocalPart());

    // Now verify that the special dispather can find this operation
    GenericProviderDispatcher dispatcher = new GenericProviderDispatcher();
    MessageContext messageContext = new MessageContext();
    messageContext.setAxisService(axisSvc);

    try {
      // The dispatcher will not try to resolve an AxisService
      assertNull(dispatcher.findService(messageContext));

      // The dispatcher should find the special AxisOperation
      assertEquals(axisOperation, dispatcher.findOperation(axisSvc, messageContext));
    } catch (AxisFault e) {
      fail("Unexpected exception" + e);
    }
  }