Модераторы: LSD, AntonSaburov
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Удаленный Вызов Jax-ws, Удаленный Вызов Jax-ws 
:(
    Опции темы
lildare
  Дата 26.2.2013, 09:21 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 28
Регистрация: 11.2.2011

Репутация: нет
Всего: нет



Здравствуйте!
Не первый день бьюсь над одной проблемой. Заключается она в следующем:
Необходимо осуществить удаленный вызов веб-сервиса, код прилагается ниже:
Код

@SchemaValidation()
@WebService(name = "JournalWebService", serviceName = "JournalWebService", targetNamespace = NamespaceConstants.JOURNAL_NS)
@HandlerChain(file = "SessionHandler.xml")
public class JournalWebService extends SpringBeanAutowiringSupport {

    Log logger = LogFactory.getLog(this.getClass());

    @Autowired
    private DispatchService dispatchService;

    @WebMethod(operationName = "GetIncidentJournal", action = "GetIncidentJournalAction")
    @RequestWrapper(className = "com.icl.ios.edds.dispatch.journal.ws.IncidentJournalRequest",
            targetNamespace = NamespaceConstants.JOURNAL_NS)
    @ResponseWrapper(className = "com.icl.ios.edds.dispatch.journal.ws.IncidentJournalResponse",
            targetNamespace = NamespaceConstants.JOURNAL_NS)
    @Deprecated
    public List<IncidentJournalRow> getIncidentJournal() {
        StopWatch stopWatch = new StopWatch();
        try {
            stopWatch.start();
            List<com.icl.ios.edds.dispatch.journal.model.IncidentJournalRow> list = dispatchService.getIncidentJournalRows();

            List<IncidentJournalRow> result = new ArrayList<IncidentJournalRow>();

            for (com.icl.ios.edds.dispatch.journal.model.IncidentJournalRow element : list) {

                IncidentJournalRow incidentJournalRow = createWSIncidentJournalRow(element);

                result.add(incidentJournalRow);
            }

            return result;
        } finally {
            logger.info("method: getIncidentJournal() time:" + stopWatch.toString());
            stopWatch.stop();
        }
    }
}





Написал клиент по аналогии с этим примером: http://technology.amis.nl/2011/06/29/how-t...ervice-library/

Предварительно поймал сниффером удачное обращение к методу веб-сервиса (из интерфейса другой программы):
Код

<S:Envelope
        xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
        <S:Header>
            <wsse:Security
                xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                S:mustUnderstand="1">
                <xenc:EncryptedKey
                    xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
                    Id="XWSSGID-1361856561728-1108975542">
                    <xenc:EncryptionMethod
                        xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
                        Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
                    <ds:KeyInfo
                        xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                        <wsse:SecurityTokenReference
                            xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                            <wsse:KeyIdentifier
                                EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
                                ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier">
                                G/rY0s6wplJKB0QI4FXPhlNDLDI=
                                </wsse:KeyIdentifier>
                            </wsse:SecurityTokenReference>
                        </ds:KeyInfo>
                    <xenc:CipherData
                        xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                        <xenc:CipherValue
                            xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                            [truncated] jYnP5aBj4QK2vKS3G+VfOLNt9a7+yD++WLUe4wJjVa0uFAiqzt09xvKmGiyAqX8HdJcvEdWuxh8H\nHFPhwUnjNnuhLjDq7Q9s1UhNULrTXOoXjJCJNhVLSNdHh9aY4gj8Bh+FI+4C18DiBDNhkv9SUKhu\nBoxGF2C91HoHm5lfBtorQILUu1XzMQOQu9wDXkmejK3GbT5k8tu/Pjp0gH3GmxYxlKR9VqG
                            </xenc:CipherValue>
                        </xenc:CipherData>
                    </xenc:EncryptedKey>
                <xenc:ReferenceList
                    xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                    <xenc:DataReference
                        URI="#XWSSGID-1361856561728-880401247"/>
                    </xenc:ReferenceList>
                <ds:Signature
                    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
                    Id="XWSSGID-13617909146842136269615">
                    <ds:SignedInfo>
                        <ds:CanonicalizationMethod
                            Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                            <InclusiveNamespaces
                                xmlns="http://www.w3.org/2001/10/xml-exc-c14n#"
                                PrefixList="wsse S"/>
                            </ds:CanonicalizationMethod>
                        <ds:SignatureMethod
                            Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
                        <ds:Reference
                            URI="#XWSSGID-1361856561728-40221937">
                            <ds:DigestMethod
                                Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                            <ds:DigestValue>
                                3QoMOhFkck2b+iiBco7ny2nKMNg=
                                </ds:DigestValue>
                            </ds:Reference>
                        </ds:SignedInfo>
                    <ds:SignatureValue>
                        SVR7j7YQwODWw7tgSX8RzD4wnQi3mKZZYsPeBKGcLgOgPDREjIvFp9HC3z9mBg4FRwzH/9p4asQs\nQLPrTHjrtQ==
                        </ds:SignatureValue>
                    <ds:KeyInfo>
                        <wsse:SecurityTokenReference
                            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="XWSSGID-13618565617281127366461">
                            <wsse:KeyIdentifier
                                EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
                                ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier">
                                RZLm0GvPA91eadj1ayZy0tVUU2E=
                                </wsse:KeyIdentifier>
                            </wsse:SecurityTokenReference>
                        </ds:KeyInfo>
                    </ds:Signature>
                </wsse:Security>
            </S:Header>
        <S:Body
            xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
            wsu:Id="XWSSGID-1361856561728-40221937">
            <xenc:EncryptedData
                xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
                Id="XWSSGID-1361856561728-880401247"
                Type="http://www.w3.org/2001/04/xmlenc#Content">
                <xenc:EncryptionMethod
                    xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
                    Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
                <ds:KeyInfo
                    xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                    <wsse:SecurityTokenReference
                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                        <wsse:Reference
                            URI="#XWSSGID-1361856561728-1108975542"/>
                        </wsse:SecurityTokenReference>
                    </ds:KeyInfo>
                <xenc:CipherData
                    xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                    <xenc:CipherValue
                        xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                        [truncated] o6XzruRnRzNE5G5vqaBx5VTK4f1wPQVDPM7GkLzIaT8mNDzflF+TXIGDws34W0nRPg8mJmwdjXSz\npXXdmoS0KMjBR1N3Uzpt4V5Vx52E7Q1QujwW/Pn2Ek1YbyGSMJYOltZ2IieLYIYfKkogryAhLc7k\n6QvYRwL4QCSRpPLdm/k7zVcGSbYlX/6kN/YvDDU0QkILjtwaMxvWGGJrasntlm+H/bJVRCv
                        </xenc:CipherValue>
                    </xenc:CipherData>
                </xenc:EncryptedData>
            </S:Body>
        </S:Envelope>


Как видно, на другой стороне используется цифровая подпись и шифрование.

Пробовал отсылать в теле запроса аналогичную xml, но получал ошибку:
com.sun.xml.wss.XWSSecurityException: com.sun.xml.wss.impl.WssSoapFaultException: com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException: It should be divisible by four

В Java я совсем новичок и представления не имею, как решить эту задачу. В качестве IDE использую IDEA 11.1, App server - JBoss 7.1.1

PM MAIL   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "Java"
LSD   AntonSaburov
powerOn   tux
  • Прежде, чем задать вопрос, прочтите это!
  • Книги по Java собираются здесь.
  • Документация и ресурсы по Java находятся здесь.
  • Используйте теги [code=java][/code] для подсветки кода. Используйтe чекбокс "транслит", если у Вас нет русских шрифтов.
  • Помечайте свой вопрос как решённый, если на него получен ответ. Ссылка "Пометить как решённый" находится над первым постом.
  • Действия модераторов можно обсудить здесь.
  • FAQ раздела лежит здесь.

Если Вам помогли, и атмосфера форума Вам понравилась, то заходите к нам чаще! С уважением, LSD, AntonSaburov, powerOn, tux.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | Java EE (J2EE) и Spring | Следующая тема »


 




[ Время генерации скрипта: 0.0842 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.