/*
  * This method must invoke the correct method on the servant based on the opcode.
  */
 protected void processingHook(StreamingHandlerState state) throws Exception {
   switch (state.getRequest().getOperationCode()) {
     case approveObjects_OPCODE:
       invoke_approveObjects(state);
       break;
     case removeObjects_OPCODE:
       invoke_removeObjects(state);
       break;
     case updateObjects_OPCODE:
       invoke_updateObjects(state);
       break;
     case submitObjects_OPCODE:
       invoke_submitObjects(state);
       break;
     case undeprecateObjects_OPCODE:
       invoke_undeprecateObjects(state);
       break;
     case deprecateObjects_OPCODE:
       invoke_deprecateObjects(state);
       break;
     default:
       throw new SOAPProtocolViolationException(
           "soap.operation.unrecognized", Integer.toString(state.getRequest().getOperationCode()));
   }
 }
 /*
  * This method must invoke the correct method on the servant based on the opcode.
  */
 protected void processingHook(StreamingHandlerState state) throws Exception {
   switch (state.getRequest().getOperationCode()) {
     case runGMT_Script_OPCODE:
       invoke_runGMT_Script(state);
       break;
     default:
       throw new SOAPProtocolViolationException(
           "soap.operation.unrecognized", Integer.toString(state.getRequest().getOperationCode()));
   }
 }
  /*
   * This method does the actual method invocation for operation: removeObjects
   */
  private void invoke_removeObjects(StreamingHandlerState state) throws Exception {

    javax.xml.soap.SOAPElement mySOAPElement = null;
    Object mySOAPElementObj = state.getRequest().getBody().getValue();

    if (mySOAPElementObj instanceof SOAPDeserializationState) {
      mySOAPElement =
          (javax.xml.soap.SOAPElement) ((SOAPDeserializationState) mySOAPElementObj).getInstance();
    } else {
      mySOAPElement = (javax.xml.soap.SOAPElement) mySOAPElementObj;
    }

    try {
      javax.xml.soap.SOAPElement partRegistryResponse =
          ((org.freebxml.omar.common.jaxrpc.registry.server.LifeCycleManagerPortType) getTarget())
              .removeObjects(mySOAPElement);

      SOAPHeaderBlockInfo headerInfo;

      javax.xml.soap.SOAPElement _response = partRegistryResponse;
      SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns2_removeObjects_RegistryResponse_QNAME);
      bodyBlock.setValue(_response);
      bodyBlock.setSerializer(ns2_ns2_RegistryResponseType_TYPE_QNAME_Serializer);
      state.getResponse().setBody(bodyBlock);
    } catch (javax.xml.rpc.soap.SOAPFaultException e) {
      SOAPFaultInfo fault =
          new SOAPFaultInfo(e.getFaultCode(), e.getFaultString(), e.getFaultActor(), e.getDetail());
      SOAPBlockInfo faultBlock =
          new SOAPBlockInfo(com.sun.xml.rpc.encoding.soap.SOAPConstants.QNAME_SOAP_FAULT);
      faultBlock.setValue(fault);
      faultBlock.setSerializer(new SOAPFaultInfoSerializer(false, e.getDetail() == null));
      state.getResponse().setBody(faultBlock);
      state.getResponse().setFailure(true);
    }
  }
 /*
  *  this method deserializes the request/response structure in the body
  */
 protected void readFirstBodyElement(
     XMLReader bodyReader,
     SOAPDeserializationContext deserializationContext,
     StreamingHandlerState state)
     throws Exception {
   int opcode = state.getRequest().getOperationCode();
   switch (opcode) {
     case approveObjects_OPCODE:
       deserialize_approveObjects(bodyReader, deserializationContext, state);
       break;
     case removeObjects_OPCODE:
       deserialize_removeObjects(bodyReader, deserializationContext, state);
       break;
     case updateObjects_OPCODE:
       deserialize_updateObjects(bodyReader, deserializationContext, state);
       break;
     case submitObjects_OPCODE:
       deserialize_submitObjects(bodyReader, deserializationContext, state);
       break;
     case undeprecateObjects_OPCODE:
       deserialize_undeprecateObjects(bodyReader, deserializationContext, state);
       break;
     case deprecateObjects_OPCODE:
       deserialize_deprecateObjects(bodyReader, deserializationContext, state);
       break;
     default:
       throw new SOAPProtocolViolationException(
           "soap.operation.unrecognized", Integer.toString(opcode));
   }
 }
 protected void postEnvelopeReadingHook(StreamingHandlerState state) throws Exception {
   super.postEnvelopeReadingHook(state);
   switch (state.getRequest().getOperationCode()) {
     case updateObjects_OPCODE:
       getNonExplicitAttachment(state);
       break;
     case submitObjects_OPCODE:
       getNonExplicitAttachment(state);
       break;
   }
 }
 /*
  * This method must determine the opcode of the operation that has been invoked.
  */
 protected void peekFirstBodyElement(
     XMLReader bodyReader,
     SOAPDeserializationContext deserializationContext,
     StreamingHandlerState state)
     throws Exception {
   if (bodyReader.getName().equals(ns1_runGMT_Script_runGMT_Script_QNAME)) {
     state.getRequest().setOperationCode(runGMT_Script_OPCODE);
   } else {
     throw new SOAPProtocolViolationException(
         "soap.operation.unrecognized", bodyReader.getName().toString());
   }
 }
 private void getNonExplicitAttachment(StreamingHandlerState state) throws Exception {
   javax.xml.rpc.handler.soap.SOAPMessageContext smc = state.getMessageContext();
   javax.xml.soap.SOAPMessage message = state.getRequest().getMessage();
   java.util.ArrayList attachments = null;
   for (java.util.Iterator iter = message.getAttachments(); iter.hasNext(); ) {
     if (attachments == null) {
       attachments = new java.util.ArrayList();
     }
     attachments.add(iter.next());
   }
   smc.setProperty(
       com.sun.xml.rpc.server.ServerPropertyConstants.GET_ATTACHMENT_PROPERTY, attachments);
 }
  /*
   * This method deserializes the body of the deprecateObjects operation.
   */
  private void deserialize_deprecateObjects(
      XMLReader bodyReader,
      SOAPDeserializationContext deserializationContext,
      StreamingHandlerState state)
      throws Exception {
    Object mySOAPElementObj =
        ns1_ns1_AdhocQueryRequest_TYPE_QNAME_Serializer.deserialize(
            ns3_deprecateObjects_DeprecateObjectsRequest_QNAME, bodyReader, deserializationContext);

    SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns3_deprecateObjects_DeprecateObjectsRequest_QNAME);
    bodyBlock.setValue(mySOAPElementObj);
    state.getRequest().setBody(bodyBlock);
  }
  /*
   * This method deserializes the body of the runGMT_Script operation.
   */
  private void deserialize_runGMT_Script(
      XMLReader bodyReader,
      SOAPDeserializationContext deserializationContext,
      StreamingHandlerState state)
      throws Exception {
    Object myGMT_WebServiceAPI_runGMT_Script_RequestStructObj =
        ns1_myGMT_WebServiceAPI_runGMT_Script_RequestStruct_SOAPSerializer.deserialize(
            ns1_runGMT_Script_runGMT_Script_QNAME, bodyReader, deserializationContext);

    SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1_runGMT_Script_runGMT_Script_QNAME);
    bodyBlock.setValue(myGMT_WebServiceAPI_runGMT_Script_RequestStructObj);
    state.getRequest().setBody(bodyBlock);
  }
 /*
  *  this method deserializes the request/response structure in the body
  */
 protected void readFirstBodyElement(
     XMLReader bodyReader,
     SOAPDeserializationContext deserializationContext,
     StreamingHandlerState state)
     throws Exception {
   int opcode = state.getRequest().getOperationCode();
   switch (opcode) {
     case runGMT_Script_OPCODE:
       deserialize_runGMT_Script(bodyReader, deserializationContext, state);
       break;
     default:
       throw new SOAPProtocolViolationException(
           "soap.operation.unrecognized", Integer.toString(opcode));
   }
 }
  /*
   * This method does the actual method invocation for operation: runGMT_Script
   */
  private void invoke_runGMT_Script(StreamingHandlerState state) throws Exception {

    junk.webservices.GMT_WebServiceAPI_runGMT_Script_RequestStruct
        myGMT_WebServiceAPI_runGMT_Script_RequestStruct = null;
    Object myGMT_WebServiceAPI_runGMT_Script_RequestStructObj =
        state.getRequest().getBody().getValue();

    if (myGMT_WebServiceAPI_runGMT_Script_RequestStructObj instanceof SOAPDeserializationState) {
      myGMT_WebServiceAPI_runGMT_Script_RequestStruct =
          (junk.webservices.GMT_WebServiceAPI_runGMT_Script_RequestStruct)
              ((SOAPDeserializationState) myGMT_WebServiceAPI_runGMT_Script_RequestStructObj)
                  .getInstance();
    } else {
      myGMT_WebServiceAPI_runGMT_Script_RequestStruct =
          (junk.webservices.GMT_WebServiceAPI_runGMT_Script_RequestStruct)
              myGMT_WebServiceAPI_runGMT_Script_RequestStructObj;
    }

    try {
      java.lang.String result =
          ((junk.webservices.GMT_WebServiceAPI) getTarget())
              .runGMT_Script(
                  myGMT_WebServiceAPI_runGMT_Script_RequestStruct.getArrayOfString_1(),
                  myGMT_WebServiceAPI_runGMT_Script_RequestStruct.getArrayOfDataHandler_2());
      junk.webservices.GMT_WebServiceAPI_runGMT_Script_ResponseStruct
          myGMT_WebServiceAPI_runGMT_Script_ResponseStruct =
              new junk.webservices.GMT_WebServiceAPI_runGMT_Script_ResponseStruct();
      SOAPHeaderBlockInfo headerInfo;
      myGMT_WebServiceAPI_runGMT_Script_ResponseStruct.setResult(result);

      SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1_runGMT_Script_runGMT_ScriptResponse_QNAME);
      bodyBlock.setValue(myGMT_WebServiceAPI_runGMT_Script_ResponseStruct);
      bodyBlock.setSerializer(ns1_myGMT_WebServiceAPI_runGMT_Script_ResponseStruct_SOAPSerializer);
      state.getResponse().setBody(bodyBlock);
    } catch (javax.xml.rpc.soap.SOAPFaultException e) {
      SOAPFaultInfo fault =
          new SOAPFaultInfo(e.getFaultCode(), e.getFaultString(), e.getFaultActor(), e.getDetail());
      SOAPBlockInfo faultBlock =
          new SOAPBlockInfo(com.sun.xml.rpc.encoding.soap.SOAPConstants.QNAME_SOAP_FAULT);
      faultBlock.setValue(fault);
      faultBlock.setSerializer(new SOAPFaultInfoSerializer(false, e.getDetail() == null));
      state.getResponse().setBody(faultBlock);
      state.getResponse().setFailure(true);
    }
  }
 /*
  * This method must determine the opcode of the operation that has been invoked.
  */
 protected void peekFirstBodyElement(
     XMLReader bodyReader,
     SOAPDeserializationContext deserializationContext,
     StreamingHandlerState state)
     throws Exception {
   if (bodyReader.getName().equals(ns3_approveObjects_ApproveObjectsRequest_QNAME)) {
     state.getRequest().setOperationCode(approveObjects_OPCODE);
   } else if (bodyReader.getName().equals(ns3_removeObjects_RemoveObjectsRequest_QNAME)) {
     state.getRequest().setOperationCode(removeObjects_OPCODE);
   } else if (bodyReader.getName().equals(ns3_updateObjects_UpdateObjectsRequest_QNAME)) {
     state.getRequest().setOperationCode(updateObjects_OPCODE);
   } else if (bodyReader.getName().equals(ns3_submitObjects_SubmitObjectsRequest_QNAME)) {
     state.getRequest().setOperationCode(submitObjects_OPCODE);
   } else if (bodyReader
       .getName()
       .equals(ns3_undeprecateObjects_UndeprecateObjectsRequest_QNAME)) {
     state.getRequest().setOperationCode(undeprecateObjects_OPCODE);
   } else if (bodyReader.getName().equals(ns3_deprecateObjects_DeprecateObjectsRequest_QNAME)) {
     state.getRequest().setOperationCode(deprecateObjects_OPCODE);
   } else {
     throw new SOAPProtocolViolationException(
         "soap.operation.unrecognized", bodyReader.getName().toString());
   }
 }