[ GORSHTAK @ 30.04.2009. 20:55 ] @
Cilj mi je da preko plsql procedure (oracle10g) pošaljem poruku preko sms gateway-a. Jedinu informaciju koju sam dobio je wsdl fajl: Code: <?xml version='1.0' encoding='UTF-8'?> <definitions name="HBSMS" targetNamespace="urn:HBSMS" xmlns:tns="urn:HBSMS" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <message name="SendSMSRequest"> <part name="to" type="xsd:string"/> <part name="message" type="xsd:string"/> <part name="reply" type="xsd:string"/> </message> <message name="SendSMSResponse"> <part name="result" type="xsd:string"/> </message> <portType name="SendSMSPortType"> <operation name="SendSMS"> <input message="tns:SendSMSRequest"/> <output message="tns:SendSMSResponse"/> </operation> </portType> <binding name="SendSMSBinding" type="tns:SendSMSPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="SendSMS"> <soap:operation soapAction="urn:SendSMSAction"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="SendSMSService"> <port name="SendSMSPort" binding="tns:SendSMSBinding"> <soap:address location="http://bla.bla.bla/ws/sms/server.php"/> </port> </service> </definitions> Probao sam da uradim sa ovim: Code: declare l_service UTL_DBWS.service; l_call UTL_DBWS.call; l_result ANYDATA; l_wsdl_url VARCHAR2(1000); l_namespace VARCHAR2(1000); l_service_qname UTL_DBWS.qname; l_port_qname UTL_DBWS.qname; l_operation_qname UTL_DBWS.qname; l_input_params UTL_DBWS.anydata_list; BEGIN l_wsdl_url := 'http://bla.bla.bla/ws/sms/server.wsdl'; l_namespace := 'http://schemas.xmlsoap.org/wsdl/' ; --- 'urn:HBSMS' l_service_qname := UTL_DBWS.to_qname(l_namespace, 'SendSMSService'); l_port_qname := UTL_DBWS.to_qname(l_namespace, 'SendSMSPort'); l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'SendSMS'); l_service := UTL_DBWS.create_service ( wsdl_document_location => URIFACTORY.getURI(l_wsdl_url), service_name => l_service_qname); l_call := UTL_DBWS.create_call ( service_handle => l_service , port_name => l_port_qname, operation_name => l_operation_qname ); l_input_params(0) := ANYDATA.ConvertVarchar2('38164xxxxxx'); l_input_params(1) := ANYDATA.ConvertVarchar2('Neka sms poruka'); -- /* l_result := UTL_DBWS.invoke ( call_handle => l_call, input_params => l_input_params); -- */ UTL_DBWS.release_call (call_handle => l_call); UTL_DBWS.release_service (service_handle => l_service); -- ANYDATA.AccessVarchar2(l_result); END; i za to dobijem grešku u create_service: Code: ORA-29532: Java call terminated by uncaught Java exception: java.lang.IllegalAccessException: error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: input message of binding operation "SendSMS" must specify a value for the "namespace" attribute ORA-06512: at "SYS.UTL_DBWS", line 193 ORA-06512: at "SYS.UTL_DBWS", line 190 ORA-06512: at line 21 tako da nisam siguran da li mi je namespace tačan, ili bilo koja druga vrednost. Ako bih uradio sa: UTL_DBWS.create_service (l_service_qname); UTL_DBWS.create_call (l_service); puklo bi u UTL_DBWS.invoke. UTL_DBWS.invoke može da se koristi sa xmltype umesto UTL_DBWS.anydata_list samo nisam siguran kako da formiram xml kod, imam samo ovaj primer Code: request := sys.xmltype( '<SendSMS xmlns="http://bla.bla.bla/ws/sms/">' || '<to>38164xxxxx</to>' || '<message>Neki sms</message>' --- || '<reply>Reply </reply>' || '</SendSMS>' ); plus što ne mogu anydata da konvertujem u neki razumljiviji oblik, ni ANYDATA.AccessVarchar2 ni getvarchar2 mi nisu prošli, ne prepoznaje ih kompajler Svaka pomoć je dobrodošla |