|
|
|
Вопрос по Web Services
|
|||
|---|---|---|---|
|
#18+
Я использую версию веб сервиса (предложенную Oracle JDeveloper 10.1.3.2): J2EE 1.4 (JAX-RPC) Web Services + SOAP 1.1 Binding Написал самый простой ws: который возвращает тоже самое число, что и принял. Запускаю ws во встроенном в JDev контейнере, тестирую - работает! Написал клиента для ws на java - НЕ РАБОТАЕТ! Выдает ошибку: Caught exception while handling request: unrecognized operation: {MyWS_1_1}callWS Текст WSDL сервиса: <definitions name="MyWS_1_1" targetNamespace="http://ws/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns0="http://ws/types/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > <types> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ws/types/" elementFormDefault="qualified" xmlns:tns="http://ws/types/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"> <element name="callWSElement"> <complexType> <sequence> <element name="paramWS" type="int"/> </sequence> </complexType> </element> <element name="callWSResponseElement"> <complexType> <sequence> <element name="result" type="int"/> </sequence> </complexType> </element> </schema> </types> <message name="MyWS_1_1_callWS"> <part name="parameters" element="tns0:callWSElement"/> </message> <message name="MyWS_1_1_callWSResponse"> <part name="parameters" element="tns0:callWSResponseElement"/> </message> <portType name="MyWS_1_1"> <operation name="callWS"> <input message="tns:MyWS_1_1_callWS"/> <output message="tns:MyWS_1_1_callWSResponse"/> </operation> </portType> <binding name="MyWS_1_1SoapHttp" type="tns:MyWS_1_1"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="callWS"> <soap:operation soapAction="http://ws//callWS"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="MyWS_1_1"> <port name="MyWS_1_1SoapHttpPort" binding="tns:MyWS_1_1SoapHttp"> <soap:address location="http://10.0.29.36:8888/TestWS-WS-context-root/MyWS_1_1SoapHttpPort"/> </port> </service> </definitions> Текст клиента: import java.io.*; import java.net.*; import java.util.*; import oracle.soap.transport.http.OracleSOAPHTTPConnection; import org.apache.soap.*; import org.apache.soap.encoding.SOAPMappingRegistry; import org.apache.soap.rpc.*; import java.net.URL; import java.util.Vector; public class ClientWS { public ClientWS() { } public static void main (String[] args) throws Exception { //URL url = new URL ("http://10.0.29.36:8888/TestWS-WS-context-root/MyWebServiceSoap12HttpPort"); URL url = new URL ("http://bas:8989/TestWS-WS-context-root/MyWS_1_1SoapHttpPort"); Integer paramWS = new Integer("999"); Call call = new Call(); //OracleSOAPHTTPConnection httpConnection = new OracleSOAPHTTPConnection(); //call.setSOAPTransport(httpConnection); call.setTargetObjectURI("MyWS_1_1"); call.setMethodName("callWS"); call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); Vector params = new Vector (); params.addElement (new Parameter("paramWS", Integer.class, paramWS, null)); call.setParams(params); //SOAPMappingRegistry smr = new SOAPMappingRegistry(); call.setSOAPMappingRegistry(null); System.out.print("SOAP Server respons: "); Response resp = call.invoke(url, ""); if (!resp.generatedFault()) { System.out.println("Ок!"); } else { Fault fault = resp.getFault(); System.out.println("Ошибка: "+fault.getFaultCode()+" - "+fault.getFaultString()); } } } Где ошибка? Что не так? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2007, 12:36:10 |
|
||
|
|

start [/forum/topic.php?fid=59&tid=2146652]: |
0ms |
get settings: |
14ms |
get forum list: |
21ms |
check forum access: |
6ms |
check topic access: |
6ms |
track hit: |
37ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
28ms |
get tp. blocked users: |
2ms |
| others: | 281ms |
| total: | 411ms |

| 0 / 0 |
