Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Java EE (J2EE) и Spring > create proxy


Автор: eXcile 10.8.2007, 06:51
всем доброго времени суток!
столкнулся со следующей проблемой.
Есть web сервис писанный на delphi, работающий по протоколу soap. Мне нужно из jboss к нему обратиться. Проблемы с генерацией прокси классов. ПРокси создаю с помощью Apache muse 22.2.0

вылетает следующий эксепшн:
WARNING: [ID = 'NoWSRPSchema'] No WS-RP schema found.
java.lang.RuntimeException: [ID = 'NotDocLiteral'] The WSDL operation 'login' is
 not doc-literal because it defines a message with more than one message part fo
r its SOAP Body. The SOAP Body of a doc-literal message should contain one root
request element (with the operation name) with zero or more child elements (the
parameters).
        at org.apache.muse.tools.inspector.ResourceInspector.getInputName(Resour
ceInspector.java:486)
        at org.apache.muse.tools.inspector.ResourceInspector.createJavaMethod(Re
sourceInspector.java:329)
        at org.apache.muse.tools.inspector.ResourceInspector.getOperations(Resou
rceInspector.java:570)
        at org.apache.muse.tools.inspector.ResourceInspector.run(ResourceInspect
or.java:888)
        at org.apache.muse.tools.generator.analyzer.SimpleAnalyzer.inspect(Simpl
eAnalyzer.java:409)
        at org.apache.muse.tools.generator.analyzer.SimpleAnalyzer.analyze(Simpl
eAnalyzer.java:348)
        at org.apache.muse.tools.generator.Wsdl2Java.run(Wsdl2Java.java:178)
        at org.apache.muse.tools.generator.Wsdl2Java.main(Wsdl2Java.java:270)

SEVERE: [ID = 'CodeGenFailed'] Code generation failed, see the exception informa
tion below.

An exception was caught: [ID = 'NotDocLiteral'] The WSDL operation 'login' is no
t doc-literal because it defines a message with more than one message part for i
ts SOAP Body. The SOAP Body of a doc-literal message should contain one root req
uest element (with the operation name) with zero or more child elements (the par
ameters).

что это за WS-RP? PLZ подскажите в чем эрор...

Автор: eXcile 10.8.2007, 08:28
при общении soap мессагами
отправляю запрос на сервис
Код

public static void main(String[] args) throws Exception{
        
        
            String mes = 
            "<SOAP-ENV:Envelope "+ 
            "xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/wsdl/\" "+ 
            "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "+ 
            "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "+ 
            "xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" "+ 
            "xmlns:si=\"http://soapinterop.org/xsd\""+ 
            "xmlns:galactivism=\"urn:suiIntf-Isui\">\n"+ 
            "<SOAP-ENV:Body>\n"+ 
                "<q1:getUserInfoByLogin>"+
                    "<name xsi:type=\"xsd:string\">blabla</name>"+
                "</q1:getUserInfoByLogin>"+
            "</SOAP-ENV:Body>\n"+ 
            "</SOAP-ENV:Envelope>"; 

            try{
                byte[] data = mes.getBytes("UTF-8");//
                URL url = new URL("http://address_of_web_service");
                HttpURLConnection uc = (HttpURLConnection) url.openConnection();
                
                uc.setDoOutput(true);
                uc.setDoInput(true);
                uc.setUseCaches(false);
                uc.setRequestProperty("Content-Type","text/xml;charset=\"utf-8\"") ;
                uc.setRequestProperty("Content-Length",Integer.toString(mes.length ()));
                        uc.connect();
                        DataOutputStream dos =    new DataOutputStream(uc.getOutputStream());
                        dos.write(data, 0, data.length);
                        //dos.close();
                        BufferedReader br = new BufferedReader(new InputStreamReader (uc.getInputStream(), "UTF-8"));
                        String res = null;
                        while ((res = br.readLine()) != null)
                        System.out.println(res);
                        
                        br.close();
            }catch(Exception e){
                        e.printStackTrace();
                        System.err.println("From client: " + e);
                        e.printStackTrace(System.out);
            }
}



при соединении со службой приходит весь wsdl файл, хотя должен прийти ответ. никаких ошибок нет, в чем может быть ГВОЗДЬ?
это первый опыт работы с web службами, попробовал создать на axis, прекрасная вещь, все сделал за 5 минут. Но сказали работать через уже имеющуюся службу, а сроки горят... smile 
Форумчане помогите

Автор: y3u 10.8.2007, 08:58
http://en.wikipedia.org/wiki/WSRP хрен с ним с ворнингом, имхо smile

по поводу еррора. 
покажи WSDL-ник, что ли... с XSD-ихами...

по поводу "мануального" коннекта, не все так просто, как ты пишешь smile тебе надо сначала запросить WSDL-ник и схему, достать оттуда биндинги, порты и операции веб сервиса, на основе этой информации уже надо слать соапы, т.е. недостаточно знать URL веб сервиса...

ПыСы
если хочешь досконально разобраться на примере, то возьми XML Spy, он умеет разбирать WSDL-и слать на порты соап энвелопы по схеме, и возьми какой-нибудь сниффер, посмотришь содержимое пакетов которыее гоняются

Автор: eXcile 10.8.2007, 09:47
вот wsdl
Код

  <?xml version="1.0" encoding="utf-8" ?> 
- <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Isuiservice" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns1="urn:uUIData" xmlns:ns2="urn:First">
- <types>
- <xs:schema targetNamespace="urn:uUIData" xmlns="urn:uUIData">
- <xs:complexType name="TUserInfo">
- <xs:sequence>
  <xs:element name="Id" type="xs:int" /> 
  <xs:element name="Login" type="xs:string" /> 
  <xs:element name="Fio" type="xs:string" /> 
  <xs:element name="FioB" type="ns2:TArrayOfByte" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="TServiceInfo">
- <xs:sequence>
  <xs:element name="Id" type="xs:int" /> 
  <xs:element name="IdModule" type="xs:int" /> 
  <xs:element name="Name" type="xs:string" /> 
  <xs:element name="Param1" type="xs:string" /> 
  <xs:element name="Param2" type="xs:string" /> 
  <xs:element name="Res" type="xs:string" /> 
  <xs:element name="NameB" type="ns2:TArrayOfByte" /> 
  <xs:element name="Param1B" type="ns2:TArrayOfByte" /> 
  <xs:element name="Param2B" type="ns2:TArrayOfByte" /> 
  <xs:element name="ResB" type="ns2:TArrayOfByte" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="TArrayOfUserInfo">
- <xs:complexContent>
- <xs:restriction base="soapenc:Array">
  <xs:sequence /> 
  <xs:attribute ref="soapenc:arrayType" n1:arrayType="ns1:TUserInfo[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/" /> 
  </xs:restriction>
  </xs:complexContent>
  </xs:complexType>
- <xs:complexType name="TArrayOfUserModuleRight">
- <xs:complexContent>
- <xs:restriction base="soapenc:Array">
  <xs:sequence /> 
  <xs:attribute ref="soapenc:arrayType" n1:arrayType="ns1:TUserModuleRight[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/" /> 
  </xs:restriction>
  </xs:complexContent>
  </xs:complexType>
- <xs:complexType name="TUserModuleRight">
- <xs:sequence>
  <xs:element name="IdService" type="xs:int" /> 
  <xs:element name="IdRight" type="xs:int" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:schema>
- <xs:schema targetNamespace="urn:First" xmlns="urn:First">
- <xs:complexType name="TArrayOfByte">
- <xs:complexContent>
- <xs:restriction base="soapenc:Array">
  <xs:sequence /> 
  <xs:attribute ref="soapenc:arrayType" n1:arrayType="xs:unsignedByte[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/" /> 
  </xs:restriction>
  </xs:complexContent>
  </xs:complexType>
- <xs:complexType name="TArrayOfInt">
- <xs:complexContent>
- <xs:restriction base="soapenc:Array">
  <xs:sequence /> 
  <xs:attribute ref="soapenc:arrayType" n1:arrayType="xs:int[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/" /> 
  </xs:restriction>
  </xs:complexContent>
  </xs:complexType>
  </xs:schema>
  </types>
- <message name="login0Request">
  <part name="uName" type="xs:string" /> 
  <part name="passwd" type="xs:string" /> 
  </message>
- <message name="login0Response">
  <part name="return" type="xs:boolean" /> 
  </message>
- <message name="getUserInfoByID1Request">
  <part name="id" type="xs:int" /> 
  </message>
- <message name="getUserInfoByID1Response">
  <part name="return" type="ns1:TUserInfo" /> 
  </message>
- <message name="getServiceInfoByID2Request">
  <part name="id" type="xs:int" /> 
  </message>
- <message name="getServiceInfoByID2Response">
  <part name="return" type="ns1:TServiceInfo" /> 
  </message>
- <message name="getUserInfoByLogin3Request">
  <part name="login" type="xs:string" /> 
  </message>
- <message name="getUserInfoByLogin3Response">
  <part name="return" type="ns1:TUserInfo" /> 
  </message>
- <message name="getIDServicesByModuleName4Request">
  <part name="module" type="xs:string" /> 
  </message>
- <message name="getIDServicesByModuleName4Response">
  <part name="return" type="ns2:TArrayOfInt" /> 
  </message>
- <message name="getIDServicesByModuleID5Request">
  <part name="moduleID" type="xs:int" /> 
  </message>
- <message name="getIDServicesByModuleID5Response">
  <part name="return" type="ns2:TArrayOfInt" /> 
  </message>
- <message name="getIDUsersByIDService6Request">
  <part name="idRes" type="xs:int" /> 
  <part name="idRight" type="xs:int" /> 
  </message>
- <message name="getIDUsersByIDService6Response">
  <part name="return" type="ns2:TArrayOfInt" /> 
  </message>
- <message name="getUsersInfoByModuleName7Request">
  <part name="module" type="xs:string" /> 
  <part name="idRight" type="xs:int" /> 
  </message>
- <message name="getUsersInfoByModuleName7Response">
  <part name="return" type="ns1:TArrayOfUserInfo" /> 
  </message>
- <message name="getRight8Request">
  <part name="userID" type="xs:int" /> 
  <part name="resID" type="xs:int" /> 
  </message>
- <message name="getRight8Response">
  <part name="return" type="xs:int" /> 
  </message>
- <message name="GetUserModuleRight9Request">
  <part name="login" type="xs:string" /> 
  <part name="moduleName" type="xs:string" /> 
  </message>
- <message name="GetUserModuleRight9Response">
  <part name="return" type="ns1:TArrayOfUserModuleRight" /> 
  </message>
- <portType name="Isui">
- <operation name="login">
  <input message="tns:login0Request" /> 
  <output message="tns:login0Response" /> 
  </operation>
- <operation name="getUserInfoByID">
  <input message="tns:getUserInfoByID1Request" /> 
  <output message="tns:getUserInfoByID1Response" /> 
  </operation>
- <operation name="getServiceInfoByID">
  <input message="tns:getServiceInfoByID2Request" /> 
  <output message="tns:getServiceInfoByID2Response" /> 
  </operation>
- <operation name="getUserInfoByLogin">
  <input message="tns:getUserInfoByLogin3Request" /> 
  <output message="tns:getUserInfoByLogin3Response" /> 
  </operation>
- <operation name="getIDServicesByModuleName">
  <input message="tns:getIDServicesByModuleName4Request" /> 
  <output message="tns:getIDServicesByModuleName4Response" /> 
  </operation>
- <operation name="getIDServicesByModuleID">
  <input message="tns:getIDServicesByModuleID5Request" /> 
  <output message="tns:getIDServicesByModuleID5Response" /> 
  </operation>
- <operation name="getIDUsersByIDService">
  <input message="tns:getIDUsersByIDService6Request" /> 
  <output message="tns:getIDUsersByIDService6Response" /> 
  </operation>
- <operation name="getUsersInfoByModuleName">
  <input message="tns:getUsersInfoByModuleName7Request" /> 
  <output message="tns:getUsersInfoByModuleName7Response" /> 
  </operation>
- <operation name="getRight">
  <input message="tns:getRight8Request" /> 
  <output message="tns:getRight8Response" /> 
  </operation>
- <operation name="GetUserModuleRight">
  <input message="tns:GetUserModuleRight9Request" /> 
  <output message="tns:GetUserModuleRight9Response" /> 
  </operation>
  </portType>
- <binding name="Isuibinding" type="tns:Isui">
  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 
- <operation name="login">
  <soap:operation soapAction="urn:suiIntf-Isui#login" style="rpc" /> 
- <input message="tns:login0Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:login0Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
- <operation name="getUserInfoByID">
  <soap:operation soapAction="urn:suiIntf-Isui#getUserInfoByID" style="rpc" /> 
- <input message="tns:getUserInfoByID1Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:getUserInfoByID1Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
- <operation name="getServiceInfoByID">
  <soap:operation soapAction="urn:suiIntf-Isui#getServiceInfoByID" style="rpc" /> 
- <input message="tns:getServiceInfoByID2Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:getServiceInfoByID2Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
- <operation name="getUserInfoByLogin">
  <soap:operation soapAction="urn:suiIntf-Isui#getUserInfoByLogin" style="rpc" /> 
- <input message="tns:getUserInfoByLogin3Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:getUserInfoByLogin3Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
- <operation name="getIDServicesByModuleName">
  <soap:operation soapAction="urn:suiIntf-Isui#getIDServicesByModuleName" style="rpc" /> 
- <input message="tns:getIDServicesByModuleName4Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:getIDServicesByModuleName4Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
- <operation name="getIDServicesByModuleID">
  <soap:operation soapAction="urn:suiIntf-Isui#getIDServicesByModuleID" style="rpc" /> 
- <input message="tns:getIDServicesByModuleID5Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:getIDServicesByModuleID5Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
- <operation name="getIDUsersByIDService">
  <soap:operation soapAction="urn:suiIntf-Isui#getIDUsersByIDService" style="rpc" /> 
- <input message="tns:getIDUsersByIDService6Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:getIDUsersByIDService6Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
- <operation name="getUsersInfoByModuleName">
  <soap:operation soapAction="urn:suiIntf-Isui#getUsersInfoByModuleName" style="rpc" /> 
- <input message="tns:getUsersInfoByModuleName7Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:getUsersInfoByModuleName7Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
- <operation name="getRight">
  <soap:operation soapAction="urn:suiIntf-Isui#getRight" style="rpc" /> 
- <input message="tns:getRight8Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:getRight8Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
- <operation name="GetUserModuleRight">
  <soap:operation soapAction="urn:suiIntf-Isui#GetUserModuleRight" style="rpc" /> 
- <input message="tns:GetUserModuleRight9Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:GetUserModuleRight9Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>
  </binding>
- <service name="Isuiservice">
- <port name="IsuiPort" binding="tns:Isuibinding">
  <soap:address location="http://host/UIWS/srvui.exe/soap/Isui" /> 
  </port>
  </service>
  </definitions>

Автор: ekr 10.8.2007, 10:03
Цитата(eXcile @  10.8.2007,  06:51 Найти цитируемый пост)
The WSDL operation 'login' is no
t doc-literal 

Так эта operation в wsdl и задекларирована НЕ как doc-literal:
Цитата(eXcile @  10.8.2007,  09:47 Найти цитируемый пост)
<operation name="login">
  <soap:operation soapAction="urn:suiIntf-Isui#login" style="rpc" /> 
- <input message="tns:login0Request">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </input>
- <output message="tns:login0Response">
  <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:suiIntf-Isui" /> 
  </output>
  </operation>


eXcile, скажи, а кто реализовывал сервис и писал WSDL? Не мог ли WSDL измениться?

Автор: eXcile 10.8.2007, 10:29
Цитата(ekr @  10.8.2007,  10:03 Найти цитируемый пост)
eXcile, скажи, а кто реализовывал сервис и писал WSDL? 

Служба была реализована раньше, средствами delphi, сейчас она просто предстала передо мной.

Цитата(ekr @  10.8.2007,  10:03 Найти цитируемый пост)
 Не мог ли WSDL измениться?

маловероятно. 


Цитата(ekr @  10.8.2007,  10:03 Найти цитируемый пост)
Так эта operation в wsdl и задекларирована НЕ как doc-literal:

может сделать doc-literal и можно прокси сгенерить?

y3u предложил хороший метод разобраться, но это займет определенное время. Хотелось бы забацать через прокси, там по-моему организация через вызов метода и передачу параметров, как в axis.

Автор: y3u 10.8.2007, 11:05
довольно странно... попробуй вручную сгенерить прокси классы при помощи тулы wsdl2java... единственное что, я не знаю как в этой либе она имплементирована... кстати, может это она глючит smile Хотя больше похоже, что ты используешь WSDL-ник не тот, который надо...

Автор: ekr 10.8.2007, 11:12
Цитата(eXcile @  10.8.2007,  10:29 Найти цитируемый пост)
маловероятно. 

значит, все-таки такая вероятность есть )

Цитата(y3u @  10.8.2007,  11:05 Найти цитируемый пост)
попробуй вручную сгенерить прокси классы

да, я думаю, стоит попробовать перегенерить stub.

Цитата(eXcile @  10.8.2007,  10:29 Найти цитируемый пост)
может сделать doc-literal 

попробуй пока просто перегенерить stub по существующему wsdl.

Автор: eXcile 10.8.2007, 11:21
Цитата(y3u @  10.8.2007,  11:05 Найти цитируемый пост)
Хотя больше похоже, что ты используешь WSDL-ник не тот, который надо...

я думаю, что wsdl-ник тот, так как с этим сервисом работают клиенты php, asp и delphi


Цитата(y3u @  10.8.2007,  11:05 Найти цитируемый пост)
попробуй вручную сгенерить прокси классы при помощи тулы wsdl2java

буду пробовать

Автор: eXcile 10.8.2007, 13:22
Цитата(ekr @  10.8.2007,  11:12 Найти цитируемый пост)
попробуй пока просто перегенерить stub по существующему wsdl.

вылетел такой эксепшн

C:\>java org.apache.axis.wsdl.WSDL2Java d:\1\Isui.wsdl
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectR
esourceBundle).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoClassDefFoundError: javax.wsdl.Definition

        at org.apache.axis.wsdl.toJava.JavaGeneratorFactory.class$(JavaGenerator
Factory.java:68)
        at org.apache.axis.wsdl.toJava.JavaGeneratorFactory.addDefinitionGenerat
ors(JavaGeneratorFactory.java:179)
        at org.apache.axis.wsdl.toJava.JavaGeneratorFactory.addGenerators(JavaGe
neratorFactory.java:133)
        at org.apache.axis.wsdl.toJava.JavaGeneratorFactory.<init>(JavaGenerator
Factory.java:111)
        at org.apache.axis.wsdl.toJava.Emitter.<init>(Emitter.java:159)
        at org.apache.axis.wsdl.WSDL2Java.createParser(WSDL2Java.java:209)
        at org.apache.axis.wsdl.gen.WSDL2.<init>(WSDL2.java:96)
        at org.apache.axis.wsdl.WSDL2Java.<init>(WSDL2Java.java:194)
        at org.apache.axis.wsdl.WSDL2Java.main(WSDL2Java.java:371)

каким образом инициализировать log4j? и что это такое и для чего?

Автор: y3u 10.8.2007, 13:32
да хрен с ним с ворнингом. Проблема в том, что ты classpath не сформировал... у тебя не может найти класс javax.wsdl.Definition....

Автор: eXcile 10.8.2007, 13:45
Цитата(y3u @  10.8.2007,  13:32 Найти цитируемый пост)
 Проблема в том, что ты classpath не сформировал... у тебя не может найти класс javax.wsdl.Definition....

готово
 вылетел новый эксепшн
Код

WSDLException (at /definitions/binding/operation[1]/input): faultCode=INVALID_WS
DL: Element '{http://schemas.xmlsoap.org/wsdl/}input' contained unexpected attri
butes: 'message':
        at com.ibm.wsdl.util.xml.DOMUtils.throwWSDLException(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseBindingInput(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseBindingOperation(Unknown Source)

        at com.ibm.wsdl.xml.WSDLReaderImpl.parseBinding(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:516)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:495)
        at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
        at java.lang.Thread.run(Thread.java:619)


Автор: AntonSaburov 10.8.2007, 14:08
Цитата(eXcile @  10.8.2007,  13:45 Найти цитируемый пост)
Element '{http://schemas.xmlsoap.org/wsdl/}input' contained unexpected attributes: 'message':

Ну у тебя где-то атрибут странный - message. Его похоже в схеме не предусмотрено.

Автор: eXcile 14.8.2007, 08:01
методом ручной модификации wsdl-ника: 
удалил блоки в блоке portType
<input message="tns:XXX">
</input>
<output message="tns:XXX">
</output>

стабы сгенерированы. получилось 7 объектов.
Isui.java
IsuibindingStub.java
Isuiservice.java
IsuiserviceLocator.java
TServiceInfo.java
TUserInfo.java
TUserModuleRight.java

но дальше не могу понять последовательность действий, чтобы вызвать методы

Автор: y3u 14.8.2007, 10:30
ну я так понимаю, что сервис называется Isui? тогда первым делом надо смотреть в класс Isui и в Isuiservice, какие там есть методы. Обычно, стабы генерятся в виде фэктори. Надо посмотреть в каком классике есть методы, которые предоставляет веб сервис и посмотреть по иерархии как этот класс может инстанциироваться. Стабы используются как обычные бины, т.е. MyWSProxyFactory.createWebServiceStub(...) или же просто new MyService(...). Что-то вроде. Думаю, подробности можно уточнить в документации...

Автор: eXcile 14.8.2007, 10:45
для статической заглушки
Код

 private String endpointAddress;

       public static void main(String argv[]) {   
          try 
          {
             Stub stub = createProxy();

             stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,"http://адресс_до_wsdl");

             Isui math = (Isui) stub;
             System.out.println(math.login("ghost"));
             
          } 
          catch (Exception ex) 
          {
             ex.printStackTrace();
          }
       }

    private static Stub createProxy() 
       {
        try{
                       return (Stub) (new IsuiserviceLocator().getIsuiPort());
        }catch(ServiceException se){
            se.printStackTrace();
        }
        return null;
       }

y3u, AntonSaburov, ekr очень благодарен за помощь. 
З.Ы. Поплыл дальше бороздить просторы web сервисов


Автор: poltora 14.9.2007, 12:00
Цитата(y3u @ 10.8.2007,  13:32)
да хрен с ним с ворнингом. Проблема в том, что ты classpath не сформировал... у тебя не может найти класс javax.wsdl.Definition....

насчет classpath - помогите разобраться.

1. порядок установки/использования classpath?

генерация из java wsdl происходит без ексепшенов ТОЛЬКО, если в %java.endorsed.dirs% помещу следущие jar - javaee.jar, wsdl4j.jar
(wsdl4j - взят из %JBOSS_HOME%/client/)
прописывание переменой окружения %CLASSPATH% в путь к этим библиотекам, и/или указывание в параметрах вызова интерпертатора -cp - непомогает.
(может потому, что одновременно еще используется параметр -classpath ?)

запускаю - 
Код

C:\DOCUME~1\86C2~1\LOCALS~1\Temp\jbosswsgen56387>

c:\progra~1\jetbra~1\intell~1.0\jre\jre\bin\java 
-classpath <пути к jar'ам JBossWS в %JBOSS_HOME%/client>
-Djava.endorsed.dirs=<путь к %JBOSS_HOME%\lib\endorsed>
org.jboss.ws.tools.WSTools 
-cp <пути к jar'ам JBossWS в %JBOSS_HOME%/client> 
плюс <пути ко всем директориям моего проекта и используемым библиотекам>
плюс <путь к wsdl4j.jar>
-config C:\DOCUME~1\86C2~1\LOCALS~1\Temp\jbossws56388config.xml

экспешн, при отсутствии wsdl4j.jar в %java.endorsed.dirs%- 
Код

Exception in thread "main" java.lang.NoClassDefFoundError: javax/wsdl/WSDLException
    at org.jboss.ws.tools.wsdl.WSDLWriter.write(WSDLWriter.java:89)

эксепшн, при отсутствии javaee.jar в %java.endorsed.dirs%- 
Код

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/encoding/TypeMapping
    at org.jboss.ws.tools.WSTools.process(WSTools.java:130)

эксепшн, при использовании j2ee.jar вместо javaee.jar - 
Код

Exception in thread "main" java.lang.NoClassDefFoundError: javax/jws/soap/SOAPBinding$ParameterStyle
    at org.jboss.ws.tools.helpers.ToolsHelper.handleJavaToWSDLGeneration(ToolsHelper.java:105)


2. какой набор библиотек содержит JBossWS?

В оригинальном wstools.bat нет упоминания о wsdl4j.jar - мысль о нем возникла только после гугления форумов, и только копирование его в endorsed помогло сгенерировать .wsdl

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)