Apache CXF возвращается к HTTP, когда должен использовать HTTPS - PullRequest
1 голос
/ 22 декабря 2010

Я пытаюсь написать SOAP-клиент для подключения к веб-службе PeopleSoft, которая ожидает HTTPS с WS-безопасностью. Я использую Apache CXF для клиента. Вот что я сделал:

1) Добавлен сертификат сервера в склад доверенных сертификатов: 'jssecacerts' с использованием утилиты Java, найденной здесь: http://blogs.sun.com/andreas/entry/no_more_unable_to_find. [Примечание редактора: исходная страница упала с Интернета. Тем не менее, я нашел эту страницу , которая, я думаю, повторяет содержание этого поста.]

2) Создал клиентские классы Java из WSDL с помощью утилиты CXF 2.3.1 WSDL2JAVA, после редактирования скрипта для установки системных свойств для использования созданного мной склада доверенных сертификатов.

3) Созданный код клиента выглядит так:

    public void init(String endpoint, String peopleSoftUser, String peopleSoftPass) throws QueryException{

  this.peopleSoftUser = peopleSoftUser;
  this.peopleSoftPass = peopleSoftPass;

  loggingInterceptor = new LoggingOutInterceptor();
  loggingInInterceptor = new LoggingInInterceptor();

  //System.setProperty("javax.net.debug", "ssl");

  try {
   URL url = new URL(endpoint);
   log.debug("Using URL " + url);

   System.setProperty("javax.net.ssl.trustStore", "/Users/micksear/jssecacerts");
   System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

   service = new QASQRYSERVICE(url);//, QASQRYSERVICE.SERVICE
   //port = service.getPort(QASQRYSERVICE.QASQRYSERVICEPort, QASQRYSERVICEPortType.class);
   port = service.getQASQRYSERVICEPort();
   conduit = (HTTPConduit) ClientProxy.getClient(port).getConduit();

   WSS4JOutInterceptor wss4j = new WSS4JOutInterceptor();
   wss4j.getProperties().put("action", "UsernameToken");
   wss4j.getProperties().put("passwordType", "PasswordText");//PasswordDigest
   wss4j.getProperties().put("user", "PS");
   wss4j.getProperties().put("passwordCallbackRef", new CallbackHandler(){

    @Override
    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
     WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
     log.debug("identifier: " + pc.getIdentifier());

     if (pc.getIdentifier().equals("PS")) {
      // set the password on the callback. This will later be compared to the
      // password which was sent from the client.
      pc.setPassword("PS");
     }
    }});

   ClientProxy.getClient(port).getOutInterceptors().add(loggingInterceptor);
   ClientProxy.getClient(port).getOutInterceptors().add(wss4j);
   ClientProxy.getClient(port).getInInterceptors().add(loggingInInterceptor);


  } catch (MalformedURLException e) {
   log.error(e.getMessage(), e);
   throw new QueryException(e);
  } 
 }

    public static void main(String[] args) throws MalformedURLException, QueryException {

  PeopleSoftQueryService qryService = new PeopleSoftQueryService();
  qryService.init("https://HR91DMO/PSIGW/PeopleSoftServiceListeningConnector/QAS_QRY_SERVICE.1.wsdl", "PS", "PS");

  try {
   QueryResult result = qryService.executeQuery("ABSENCE_REASON_LOOKUP");

   for (Map<String,String> row : result.getData()){
    System.out.println("Row: ");
    for (String key : row.keySet()){
     System.out.println("   " + key + " = " + row.get(key));
    }
   }
  } catch (SOAPFaultException e) {
   logSoapFaultException(e, log);
  }


 }

    public QueryResult executeQuery(String queryName) throws QueryException {
  QASEXEQRYSYNCREQMSGType msg = new QASEXEQRYSYNCREQMSGType();
  QASEXEQRYSYNCREQTypeShape msgTypeShape = new QASEXEQRYSYNCREQTypeShape();
  msgTypeShape.setQueryName(queryName);
  msgTypeShape.setIsConnectedQuery("N");
  msgTypeShape.setOwnerType("PUBLIC");
  msgTypeShape.setBlockSizeKB(new BigInteger("0"));
  msgTypeShape.setMaxRow(new BigInteger("100"));
  msgTypeShape.setOutResultType(OutResultTypeTypeDef.XMLP);
  msgTypeShape.setOutResultFormat(OutResultFormatTypeDef.NONFILE);
  msg.setQASEXEQRYSYNCREQ(msgTypeShape);

  QASGETQUERYRESULTSRESPMSGType result = port.qasEXECUTEQRYSYNCOPER(msg);

  Map<Integer,String> columnMetadata = new HashMap<Integer,String>();
  QueryResult resultData = new QueryResult();

  Iterator<ColumnDefinition> columnIterator = result.getWebRowSet().getMetadata().getColumnDefinition().iterator();
  while (columnIterator.hasNext()){
   ColumnDefinition column = columnIterator.next();
   String columnName = column.getColumnName();
   columnMetadata.put(new Integer(column.getColumnIndex()), columnName);
  }

  Iterator<Object> rowIterator = result.getWebRowSet().getData().getCurrentRowAndInsertRowAndDeleteRow().iterator();
  while (rowIterator.hasNext()){
   CurrentRow row = (CurrentRow) rowIterator.next();
   Map<String,String> rowMap = new HashMap<String,String>();
   for (int i = 0 ; i < columnMetadata.size() ; i++){
    String value = row.getColumnValue().get(i).toString();
    rowMap.put(columnMetadata.get(i), value);
   }

   resultData.addRow(rowMap);
  }

  resultData.setNumRows(resultData.getData().size());
  return resultData;
 }

Итак, клиентские классы были созданы из URL HTTPS WSDL и не содержат ссылок HTTP. Код клиента, который я написал, не содержит ссылок HTTP. Когда я запускаю код, кажется, он правильно выполняет рукопожатия SSL, а затем выдает исключение:

2010-12-22 11:44:50,162 [main] DEBUG org.apache.ws.security.util.Loader - 

org.apache.security.juice.provider.JuiCEProviderOpenSSL
java.lang.ClassNotFoundException: org.apache.security.juice.provider.JuiCEProviderOpenSSL
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 at org.apache.ws.security.util.Loader.loadClass(Loader.java:185)
 at org.apache.ws.security.WSSConfig.loadProvider(WSSConfig.java:605)
 at org.apache.ws.security.WSSConfig.addJceProvider(WSSConfig.java:662)
 at org.apache.ws.security.WSSConfig.staticInit(WSSConfig.java:306)
 at org.apache.ws.security.WSSConfig.<init>(WSSConfig.java:324)
 at org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:333)
 at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:173)
 at org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:134)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
 at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
 at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
 at $Proxy42.qasEXECUTEQRYSYNCOPER(Unknown Source)
 at com.succeed.peoplesoft.soap.PeopleSoftQueryService.executeQuery(PeopleSoftQueryService.java:154)
 at com.succeed.peoplesoft.soap.PeopleSoftQueryService.main(PeopleSoftQueryService.java:188)
2010-12-22 11:44:50,164 [main] DEBUG org.apache.ws.security.WSSConfig - The provider JuiCE could not be added: org.apache.security.juice.provider.JuiCEProviderOpenSSL
2010-12-22 11:44:50,176 [main] DEBUG org.apache.ws.security.handler.WSHandler - Performing Action: 1
2010-12-22 11:44:50,177 [main] DEBUG com.succeed.peoplesoft.soap.PeopleSoftQueryService - identifier: PS
2010-12-22 11:44:50,179 [main] DEBUG org.apache.ws.security.message.WSSecUsernameToken - Begin add username token...
Dec 22, 2010 11:44:50 AM org.apache.cxf.interceptor.AbstractLoggingInterceptor log
INFO: Outbound Message
---------------------------
ID: 1
Address: http://192.168.1.91/PSIGW/PeopleSoftServiceListeningConnector
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=["QAS_EXECUTEQRYSYNC.VERSION_1"], Accept=[*/*]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1"><wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-1"><wsse:Username>PS</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PS</wsse:Password></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><ns86:QAS_EXEQRY_SYNC_REQ_MSG xmlns:ns10="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_RECORD_DEFN_REQ_MSG.VERISON_1" xmlns:ns11="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_RECORD_DEFN_RESP_MSG.VERSION_1" xmlns:ns12="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERYSTATUS_REQ.VERSION_1" xmlns:ns13="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERYSTATUS_REQ_MSG.VERSION_1" xmlns:ns14="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERYSTATUS_RESP.VERSION_1" xmlns:ns15="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERYSTATUS_RESP_MSG.VERSION_1" xmlns:ns16="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_HIERARCHY_RECORDS_REQ_MSG.VERSION_1" xmlns:ns17="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_HIERARCHY_RECORDS_RESP_MSG.VERSION_1" xmlns:ns18="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_CANCELQUERY_REQ.VERSION_1" xmlns:ns19="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_CANCELQUERY_REQ_MSG.VERSION_1" xmlns:ns2="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTROLE_REQ_MSG.VERSION_1" xmlns:ns20="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_CANCELQUERY_RESP.VERSION_1" xmlns:ns21="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_CANCELQUERY_RESP_MSG.VERSION_1" xmlns:ns22="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTUSERROLES_REQ.VERSION_1" xmlns:ns23="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTUSERROLES_REQ_MSG.VERSION_1" xmlns:ns24="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTUSERROLES_RESP.VERSION_1" xmlns:ns25="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTUSERROLES_RESP_MSG.VERSION_1" xmlns:ns26="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERYFIELDS_REQ.VERSION_1" xmlns:ns27="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERYFIELDS_REQ_MSG.VERSION_1" xmlns:ns28="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERYFIELDS_RESP.VERSION_1" xmlns:ns29="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERYFIELDS_RESP_MSG.VERSION_1" xmlns:ns3="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTROLE_RESP.VERSION_1" xmlns:ns30="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_RELATED_RECORDS_REQ_MSG.VERSION_1" xmlns:ns31="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_RELATED_RECORDS_RESP_MSG.VERSION_1" xmlns:ns32="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTUSER_REQ.VERSION_1" xmlns:ns33="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTUSER_REQ_MSG.VERSION_1" xmlns:ns34="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTUSER_RESP.VERSION_1" xmlns:ns35="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTUSER_RESP_MSG.VERSION_1" xmlns:ns36="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERY_DETAILS_REQ_MSG.VERSION_1" xmlns:ns37="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERY_DETAILS_RESP_MSG.VERSION_1" xmlns:ns38="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERY_REQ.VERSION_1" xmlns:ns39="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERY_REQ_MSG.VERSION_1" xmlns:ns4="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTROLE_RESP_MSG.VERSION_1" xmlns:ns40="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERY_RESP.VERSION_1" xmlns:ns41="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERY_RESP_MSG.VERSION_1" xmlns:ns42="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_TREES_REQ_MSG.VERSION_1" xmlns:ns43="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_TREES_RESP_MSG.VERSION_1" xmlns:ns44="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTROLEUSERS_REQ.VERSION_1" xmlns:ns45="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTROLEUSERS_REQ_MSG.VERSION_1" xmlns:ns46="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTROLEUSERS_RESP.VERSION_1" xmlns:ns47="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTROLEUSERS_RESP_MSG.VERSION_1" xmlns:ns48="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_EXEQRY_ASYNC_REQ.VERSION_1" xmlns:ns49="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_EXEQRY_SYNC_REQ.VERSION_1" xmlns:ns5="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTROLE_REQ.VERSION_1" xmlns:ns50="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERYRESULTS_FILE_RESP.VERSION_1" xmlns:ns51="http://java.sun.com/xml/ns/jdbc" xmlns:ns52="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERYRESULTS_XMLP_RESP.VERSION_1" xmlns:ns53="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERYRESULTS_STATUS_RESP.VERSION_1" xmlns:ns54="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LOGIN_RESP_MSG.VERSION_1" xmlns:ns55="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERY_DELETE_REQ_MSG.VERSION_1" xmlns:ns56="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERY_DELETE_RESP_MSG.VERSION_1" xmlns:ns57="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETQUERYRESULTS_REQ.VERSION_1" xmlns:ns58="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETQUERYRESULTS_REQ_MSG.VERSION_1" xmlns:ns59="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERY_SAVE_REQ_MSG.VERSION_1" xmlns:ns6="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_AUTHTOKEN_REQ_MSG.VERSION_1" xmlns:ns60="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_QUERY_SAVE_RESP_MSG.VERSION_1" xmlns:ns61="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERYPROMPTS_REQ.VERSION_1" xmlns:ns62="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERYPROMPTS_REQ_MSG.VERSION_1" xmlns:ns63="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERYPROMPTS_RESP.VERSION_1" xmlns:ns64="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LISTQUERYPROMPTS_RESP_MSG.VERSION_1" xmlns:ns65="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_RECORDS_REQ_MSG.VERSION_1" xmlns:ns66="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_RECORDS_RESP_MSG.VERSION_1" xmlns:ns67="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETXLAT_REQ.VERSION_1" xmlns:ns68="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETXLAT_REQ_MSG.VERSION_1" xmlns:ns69="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETXLAT_RESP.VERSION_1" xmlns:ns7="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_AUTHTOKEN_RESP_MSG.VERSION_1" xmlns:ns70="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETXLAT_RESP_MSG.VERSION_1" xmlns:ns71="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_EXEQRY_SYNCPOLL_REQ.VERSION_1" xmlns:ns72="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_EXEQRYSYNCPOLL_RESP.VERSION_1" xmlns:ns73="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_EXEQRYSYNCPOLL_RESP_MSG.VERSION_1" xmlns:ns74="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETPRMPTTBLVAL_REQ.VERSION_1" xmlns:ns75="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETPRMPTTBLVAL_REQ_MSG.VERSION_1" xmlns:ns76="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETPRMPTTBLVAL_RESP.VERSION_1" xmlns:ns77="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETPRMPTTBLVAL_RESP_MSG.VERSION_1" xmlns:ns78="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_TREE_DETAILS_REQ_MSG.VERSION_1" xmlns:ns79="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_TREE_DETAILS_RESP_MSG.VERSION_1" xmlns:ns8="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_FIELD_PROPS_REQ_MSG.VERSION_1" xmlns:ns80="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_FIELDS_REQ_MSG.VERSION_1" xmlns:ns81="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_FIELDS_RESP_MSG.VERSION_1" xmlns:ns82="http://schemas.xmlsoap.org/ws/2003/03/addressing" xmlns:ns83="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_EXEQRY_ASYNC_REQ_MSG.VERSION_1" xmlns:ns84="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_GETQUERYRESULTS_RESP_MSG.VERSION_1" xmlns:ns85="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_LOGIN_REQ_MSG.VERSION_1" xmlns:ns86="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_EXEQRY_SYNC_REQ_MSG.VERSION_1" xmlns:ns87="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_EXEQRY_SYNCPOLL_REQ_MSG.VERSION_1" xmlns:ns9="http://xmlns.oracle.com/Enterprise/Tools/schemas/QAS_FIELD_PROPS_RESP_MSG.VERSION_1"><ns49:QAS_EXEQRY_SYNC_REQ><QueryName>ABSENCE_REASON_LOOKUP</QueryName><isConnectedQuery>N</isConnectedQuery><OwnerType>PUBLIC</OwnerType><BlockSizeKB>0</BlockSizeKB><MaxRow>100</MaxRow><OutResultType>XMLP</OutResultType><OutResultFormat>NONFILE</OutResultFormat></ns49:QAS_EXEQRY_SYNC_REQ></ns86:QAS_EXEQRY_SYNC_REQ_MSG></soap:Body></soap:Envelope>
--------------------------------------
Dec 22, 2010 11:44:50 AM org.apache.cxf.interceptor.AbstractLoggingInterceptor log
INFO: Inbound Message
----------------------------
ID: 1
Response-Code: 500
Encoding: UTF-8
Content-Type: text/xml; charset=UTF-8
Headers: {content-type=[text/xml; charset=UTF-8], Date=[Wed, 22 Dec 2010 11:43:56 GMT], Content-Length=[672], X-Powered-By=[Servlet/2.5 JSP/2.1]}
Payload: <?xml version="1.0" ?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>null</faultstring><detail><IBResponse type="error" xmlns=""><DefaultTitle>Integration Broker Response</DefaultTitle><StatusCode>20</StatusCode><MessageID>554</MessageID><DefaultMessage><![CDATA[Encryption and Digital Signed or Https required for Service Operation QAS_EXECUTEQRYSYNC_OPER. (158,554)]]></DefaultMessage><MessageParameters><Parameter><![CDATA[QAS_EXECUTEQRYSYNC_OPER]]></Parameter></MessageParameters></IBResponse></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
--------------------------------------
2010-12-22 11:44:50,759 [main] ERROR com.succeed.peoplesoft.soap.PeopleSoftQueryService - Error: <detail><IBResponse type="error" xmlns=""><DefaultTitle>Integration Broker Response</DefaultTitle><StatusCode>20</StatusCode><MessageID>554</MessageID><DefaultMessage><![CDATA[Encryption and Digital Signed or Https required for Service Operation QAS_EXECUTEQRYSYNC_OPER. (158,554)]]></DefaultMessage><MessageParameters><Parameter><![CDATA[QAS_EXECUTEQRYSYNC_OPER]]></Parameter></MessageParameters></IBResponse></detail>
javax.xml.ws.soap.SOAPFaultException: null
 at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
 at $Proxy42.qasEXECUTEQRYSYNCOPER(Unknown Source)
 at com.succeed.peoplesoft.soap.PeopleSoftQueryService.executeQuery(PeopleSoftQueryService.java:154)
 at com.succeed.peoplesoft.soap.PeopleSoftQueryService.main(PeopleSoftQueryService.java:188)
Caused by: org.apache.cxf.binding.soap.SoapFault: null
 at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
 at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
 at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
 at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:99)
 at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
 at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
 at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
 at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
 at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
 at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
 at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
 at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188)
 at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
 at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
 at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
 at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
 at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
 ... 3 more

Я проверил, и JuiCE - это неактивный проект Apache Incubator. У меня есть полная библиотека CXF в моем classpath, поэтому я не уверен, почему он пытается загрузить этот класс. Я подозреваю, но не знаю, что именно это заставляет его возвращаться к HTTP (кстати, 192.168.1.91 - это IP-адрес, к которому HR91DMO разрешает).

Я хочу использовать конфигурацию Java, а не конфигурацию Spring для этого прямо сейчас, отчасти потому, что я хочу понять, что происходит, и упростить пример, а отчасти потому, что некоторые конфигурации могут быть во время выполнения, а я не хочу приходится перекомпилировать WAR с новым конфигурационным файлом Spring каждый раз, когда происходят изменения.

Может кто-нибудь пролить свет на то, что я делаю неправильно?

1 Ответ

1 голос
/ 22 декабря 2010

Я решил это - он все еще использовал URL-адрес конечной точки из WSDL, когда я думал, что переопределяю его. Я сделал это:

BindingProvider provider = (BindingProvider)port;
provider.getRequestContext().put( BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);

из которого я работал: http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html

Было предложено 3 различных способа переопределения адреса.

...