How to print SOAP request at client program when program calls web service.
Hi friends,
While calling a web service, I am getting following error: javax.xml.rpc.JAXRPCException: Failed to parse WSDL
I believe it is due to an invalid parameter set for the request soap. I need to analysis this error. Can you help me to print SOAP request at client program when program calls web service.
Is there any way to print SOAP request XML?
Thanks.
Jaykishan
Is this question related to Oracle SOA suite? Which client are you using? Use SOAPUI to validate whether WSDL is correct.
Regards,
Anuj
Similar Messages
-
Oracle form 6i in client server mode to call web service
Hi,
I am using oracle form 6i running in client server mode. My database version is 8.1.7.4. Now I am required to call an external web service. Is it possible to call web service without the existence of application server or web server? Please help!I have tried the method illustrated by the Form 10g Demo. However, when I select the Import Java Classes from the pull down menu, I have got the following error:
PDE-UJI002 Unable to find the required Java Importer Classes.
My Oracle Form version is as follows:
Forms [32 Bit] Version 6.0.8.19.2 (Production)
Oracle8i Enterprise Edition Release 8.1.7.0.0 - 64bit Production
With the Partitioning option
JServer Release 8.1.7.0.0 - 64bit Production
Oracle Toolkit Version 6.0.8.19.1 (Production)
PL/SQL Version 8.0.6.3.0 (Production)
Oracle Procedure Builder V6.0.8.17.0 Build #863 - Production
PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
Oracle Query Builder 6.0.7.1.0 - Production
Oracle Virtual Graphics System Version 6.0.5.38.0 (Production)
Oracle Tools GUI Utilities Version 6.0.8.11.0 (Production)
Oracle Multimedia Version 6.0.8.18.1 (Production)
Oracle Tools Integration Version 6.0.8.18.0 (Production)
Oracle Tools Common Area Version 6.0.8.18.0
Oracle CORE Version 4.0.6.0.0 - Production
Please help ! -
How to create stub for C++ client to invoke a j2ee web service
Hi All,
I have developed a j2ee web service which is deployed in Tomcat. I have to call this service from C++ client. I have followed "Axis C++ Client User's Guide" to create stub for my service. I am running WSDL2Ws tool with command
D:\axisserver\axis-c-win\wsdls>java -cp %AXISCLASSPATH_C%; org.apache.axis.wsdl.wsdl2ws.WSDL2Ws Calculator.wsdl -lc++ -sclient. While running this WSDL2Ws tool , it is giving error.
Exception Stack is as follows.
Exception in thread "main" java.lang.NoSuchMethodError
at org.apache.axis.wsdl.wsdl2ws.info.Type.<init>(Unknown Source)
at org.apache.axis.wsdl.wsdl2ws.info.TypeMap.getType(Unknown Source)
at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.createParameterInfo(Unknown Source)
at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.addRPCStyleInputMessageToMethodInfo(Unknown Source)
at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.setMethodInfo(Unknown Source)
at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.getServiceInfo(Unknown Source)
at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.generateWrappers(Unknown Source)
at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.main(Unknown Source)
Anybody can suggest me what i missed...
Thanks in advance...Hi all,
I have solved this issue. I had JDK1.3 by default. So it was giving error. When i use java from jdk1.4, it created stubs for web service. Java version was the problem. Now it is working fine.
Thanks.... -
How to call web services from PL/SQL?
Hi,
Can one help in how to call web services from PL/SQL? Steps, pros and cons, etc....
Thanks in advanceHere's some example skeleton code to get you started...
PROCEDURE p_soap_request(p_username IN VARCHAR2, p_password IN VARCHAR2, p_proxy IN VARCHAR2) IS
soap_request VARCHAR2(30000);
soap_respond CLOB;
http_req utl_http.req;
http_resp utl_http.resp;
resp XMLType;
soap_err exception;
v_code VARCHAR2(200);
v_msg VARCHAR2(1800);
v_len number;
v_txt Varchar2(32767);
BEGIN
UTL_HTTP.SET_PROXY(p_proxy);
-- Define the SOAP request according the the definition of the web service being called
soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'||
' <SOAP-ENV:Body>'||
' <m:DownloadRequest xmlns:m="http://www.website.net/messages/GetDetails">'||
' <m:UserName>'||p_username||'</m:UserName>'||
' <m:Password>'||p_password||'</m:Password>'||
' </m:DownloadRequest>'||
' </SOAP-ENV:Body>'||
'</SOAP-ENV:Envelope>';
http_req:= utl_http.begin_request
( 'http://www.website.net/webservices/GetDetailsService.asmx'
, 'POST'
, 'HTTP/1.1'
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
utl_http.set_header(http_req, 'Content-Length', length(soap_request));
utl_http.set_header(http_req, 'Download', ''); -- header requirements of particular web service
utl_http.write_text(http_req, soap_request);
http_resp:= utl_http.get_response(http_req);
utl_http.get_header_by_name(http_resp, 'Content-Length', v_len, 1); -- Obtain the length of the response
FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K
LOOP
utl_http.read_text(http_resp, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end);
soap_respond := soap_respond || v_txt; -- build up CLOB
END LOOP;
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond); -- Convert CLOB to XMLTYPE
END;Using secure web services (https)...
Web serivces call in Plsql
As for 'pros and cons'... there's nothing to compare against... either you want to call a web service or you don't. -
How to print Spool requests for cheque printing sequentially
Dear All,
I am making vendor payments and printing cheques using F-58. It automatically creates a spool requests at the end of the transaction. When i complete all my payments and go to SP01 for viewing spool requests, the last request appears at the top of the list.
If i select 3 consecutive requests and print them at a time, the last request gets printed first on the first cheque number and the first request gets printed on the last cheque number.
This results in anomaly in the cheque number assigned in the system and the printed cheque as the last payment is printed on the first cheque.
I am using dot matrix printer with page format fixed for cheque specifications. The cheques are printed properly as per the format except the order of printing.
Kindly let me know how to print multiple requests sequentially from the spool requests list such that the spool request number printed matches with the serial cheque numbers.
Regards,
SAP_2009Hi,
I understod your issue.
Whenever you posted multiple payment documents, and after that if you want to take cheque printouts sequentially by using more spool requests.........there is a way to sort out this issue.
1) Select all of your spool requests and click on Sort in ascending Order (CtrlShiftF5) and click on Print directly (CtrlShiftF8). By doing this you will get the cheque printouts sequentially according to your payment document sequence.
Hope this will help you
Assign ********, if it solved your problem.
Thanks,
Srinu -
How to print page no/total pges in report programing?
how to print page no/total pges in report programing?
Hi
This is an example:
In TOP-OF-PAGE you can write:
WRITE: SY-PAGNO, '/', '-----'.
When the program has finished to print all data, run a routine like this:
Declare a variable
DATA: L_PAGE_COUNT(5) TYPE C,
V_LINE TYPE I. "The line where page number is written
* In my example I suppose the page number is always
* written in the first row of the page.
V_LINE = 1.
* Copy this code to the end of program
* Page count will be printed on each page here
WRITE sy-pagno TO l_page_count LEFT-JUSTIFIED.
DO sy-pagno TIMES.
READ LINE V_LINE OF PAGE sy-index.
REPLACE '-----' WITH l_page_count INTO sy-lisel.
MODIFY CURRENT LINE.
ADD 1 TO sy-index.
ENDDO.
Max -
How to get Soap Request xml in application.cfc
Hi
if api getting soap request using cfhttp like below:
<cfxml variable="mydata">
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header />
<soapenv:Body>
<ns:service_soap_call soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<login>test</login>
<password>test</password>
</ns:service_soap_call>
</soapenv:Body>
</soapenv:Envelope>
</cfxml>
<cfhttp url="http://sm.iclp-dubai.ae/research/wsdl/MyPointsBank.cfc?wsdl" method="post" charset="utf-8" result="myresult">
type" value="text/xml">
<cfhttpparam type="header" name="SOAPAction" value="">
<cfhttpparam name="soapInput" type="xml" value="#trim(mydata)#"/>
</cfhttp>
then how to get Soap Request in application cfc.
like :
<cfif IsSOAPRequest() >
<cfset soapreq = GetSOAPRequest() />
</cfif>
I want to validate the soap xml Request before calling targeted CFC.
Any suggestion!.Let me see whether I understand. Are you attempting to achieve something like this:
test.cfc
<cfcomponent output="no">
<cffunction name="testFunction" returntype="any" access="remote">
<cfargument name="soapInput">
<cfset var inputXML = arguments.soapInput>
<cfset var soapBodyText="">
<cfset var noBodyTextError="">
<cftry>
<cfset soapBodyText = xmlSearch(inputXML,"//soapenv:Body/text()")[1].xmlValue>
<cfsavecontent variable="noBodyTextError"><?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>java.lang.Exception: Body not found.</faultstring></cfsavecontent>
<cfif trim(soapBodyText) is "">
<cfthrow>
</cfif>
<cfreturn inputXML>
<cfcatch type="any">
<cfreturn noBodyTextError>
</cfcatch>
</cftry>
</cffunction>
</cfcomponent>
tester.cfm
<cfxml variable="mydata">
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wor="https://www.worldmilesafrica.com">
<soapenv:Header/>
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
</cfxml>
<cfinvoke webservice = "http://127.0.0.1:8500/workspace/wsTest/test.cfc?wsdl"
method = "testFunction"
returnVariable = "result">
<cfinvokeargument name="soapInput" value="#trim(mydata)#" >
</cfinvoke>
<cfdump var="#result#"> -
How to make a PDF form call Web service and return a static pdf for user to print?
Hi all,
Can anyone help me regarding the feasibility of using PDF forms for my following case?
I would like to create a Dynamic pdf form. User only have the Acrobat reader. they can enter some information. Then have a submit button. when user click the submit button, it can call the web service with data. then Web service returns a Static PDF document based on data and the user can print it out. (and maybe save as separate pdf file)
1. Is that possible to implement? Because I know PDF can call web service, but dont know how it handle when the webservice returns another static PDF document. could it able to handle the responds and open up in another acrobat reader?
2. As I understand I need to have Live Cycle Designer to create a pdf and make it Reader Enabled. So user can user reader to call webservice? am I correct?
3. What minimum reader that user need to have? PDF reader 7 or above?
4. I have a webservice serve the same purpose for web. But if I want the same web services can serve both web and PDF form. So, whatever client (PDF or Web)make the web service call, server returns the PDF document to client. Is that possible ? Do I need to make any changes on web service?
5. Do I need to get any other Adobe server product? (other than Live Cycle Designer )
Thanks a lotWe have done a similar approach in the past and yes, it can be doable.
1. Is that possible to implement? Because I know PDF can call web service, but dont know how it handle when the webservice returns another static PDF document. could it able to handle the responds and open up in another acrobat reader?
Srini: We have developed a Servlet to talk to Webservice. Based on the Webservice response, the Servlet, prepares the Byte stream and sends it to Webbrowser to display as a PDF. The PDF data was submitted to Servlet in XML format.
But if you do not want to use the above approach, then you have to use the Workbench Process.
Submit the PDF data to a Workbench process and the inside process, execute Webservice Service with the data. Once the response is received, prepare the data XML and render a PDF with it.
To do this, you need LiveCycle Server and Reader Extensions server component.
2. As I understand I need to have Live Cycle Designer to create a pdf and make it Reader Enabled. So user can user reader to call webservice? am I correct?
Srini: If you want to use the Servlet, you can Reader extend the PDF with Acrobat.. But if you want to submit the data directly to Webservice, then you need Reader Extensions server component.
3. What minimum reader that user need to have? PDF reader 7 or above?
Srini: Not sure but Reader 8 and above should work.
4. I have a webservice serve the same purpose for web. But if I want the same web services can serve both web and PDF form. So, whatever client (PDF or Web)make the web service call, server returns the PDF document to client. Is that possible ? Do I need to make any changes on web service?
Srini: If you use the Servlet approach, then you can re-use the same webservice. But if you want to submit directly to the same webservice, you may need to change it to suit your data XML.
5. Do I need to get any other Adobe server product? (other than Live Cycle Designer )
Srini: If you use the Servlet approach, you do not need any server component but other approach, you need Livecycle Server and Reader Extensions server component.
Thanks
Srini -
How can print a report from form 6i, when I press a button?
hi Friends,
How can print a report from form 6i, when I press a button?
When i press a button from Form 6i, the report should print through printer.
I have done it by using report parameter DESTYPE Printer but problem is that when I press a button printer dialogue box appear and then I give command Print to printer, I don’t want to show Printer dialogue box.
I want when I press a button form Forms 6i , printer will print my report directly.
Please send me the solution of this problem.
Best regards,
ShahzadHi
If You are using Client server application then to passing to Add all Print Parameter in the Host Command.
Means Print command in unix to Host(lp.............) and Other Parameter to file name of the report to print.
If You not Use Client Server Application the Also Passing a Host Command in Button-Pressed Event and Run. -
Add cookie to HTTP request header when calling web service
I'm trying to call web service using JDeveloper 11g. I successfully generated web service proxy from WSDL document. I can successfully call this particular web service's method "login" which returns "session_id", which then needs to be inserted as a cookie in the HTTP request header in later calls to other methods. This is how the HTTP request header should look like:
POST /webservice HTTP/1.1
Host: registrar.carnet.hr
Connection: Keep-Alive
User-Agent: .hr domene
Content-Type: text/xml; charset=utf-8
SOAPAction: "https://registrar.carnet.hr/webservice#get_domain_name"
Content-Length: 532
Cookie: session_id=f3po0ba01a47gd64792151ee43a25765;
How can this be accomplished? There is not much code that I wrote, everything is generated by JDeveloper's wizard...
public static void main(String[] args) {
try {
RegistrarServicePortPortClient client =
new RegistrarServicePortPortClient();
client.setPortCredentialProviderList();
// add your code here
String login;
login = client.login("username", "password");
System.out.println(login);
String myCookie = "session_id="+login;
System.out.println(myCookie);
*// what can be done to add myCookie to the HTTP request header?*
} catch (Exception ex) {
ex.printStackTrace();
Thanks in advance,
BrunoHi Vishal,
it's not a requirement but I wasn't able to create JAX-WS Style proxy from this WSDL: https://registrar.carnet.hr/wsdl
The exception I'm getting is:
oracle.jdeveloper.webservices.model.WebServiceException: Error creating model from wsdl "https://registrar.carnet.hr/wsdl": Could not bind "{http://schemas.xmlsoap.org/soap/encoding/}Array" in message part "return" to a Java type. If doc/lit style is used then message part should reference to global schema element.
at oracle.jdeveloper.webservices.model.java.JavaWebService.createPortTypes(JavaWebService.java:1635)
at oracle.jdeveloper.webservices.model.WebService.createServiceFromWSDL(WebService.java:2846)
at oracle.jdeveloper.webservices.model.WebService.createServiceFromWSDL(WebService.java:2611)
at oracle.jdeveloper.webservices.model.java.JavaWebService.<init>(JavaWebService.java:509)
at oracle.jdeveloper.webservices.model.java.JavaWebService.<init>(JavaWebService.java:461)
at oracle.jdeveloper.webservices.model.proxy.WebServiceProxy$ProxyJavaWebService.<init>(WebServiceProxy.java:2268)
at oracle.jdeveloper.webservices.model.proxy.WebServiceProxy.updateServiceModel(WebServiceProxy.java:1701)
at oracle.jdeveloper.webservices.model.proxy.WebServiceProxy.setDescription(WebServiceProxy.java:525)
at oracle.jdevimpl.webservices.wizard.jaxrpc.proxy.ProxyJaxWsSpecifyWSDLPanel.setDescription(ProxyJaxWsSpecifyWSDLPanel.java:238)
at oracle.jdevimpl.webservices.wizard.jaxrpc.common.SpecifyWsdlPanel.buildModel(SpecifyWsdlPanel.java:1109)
at oracle.jdevimpl.webservices.wizard.jaxrpc.common.SpecifyWsdlPanel$5.run(SpecifyWsdlPanel.java:661)
at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:655)
at java.lang.Thread.run(Thread.java:619)
Caused by: oracle.jdeveloper.webservices.tools.WsdlValidationException: Error creating model from wsdl "https://registrar.carnet.hr/wsdl": Could not bind "{http://schemas.xmlsoap.org/soap/encoding/}Array" in message part "return" to a Java type. If doc/lit style is used then message part should reference to global schema element.
at oracle.jdevimpl.webservices.tools.wsa.WsaAdaptor.newWsdlValidationException(WsaAdaptor.java:825)
at oracle.jdevimpl.webservices.tools.wsa.WsaAdaptor.getSeiInfo(WsaAdaptor.java:515)
at oracle.jdeveloper.webservices.tools.WebServiceTools.getSeiInfo(WebServiceTools.java:523)
at oracle.jdeveloper.webservices.model.java.JavaWebService.getSeiInfo(JavaWebService.java:1741)
at oracle.jdeveloper.webservices.model.java.JavaWebService.createPortTypes(JavaWebService.java:1496)
... 12 more
Caused by: oracle.j2ee.ws.common.tools.api.ValidationException: Error creating model from wsdl "https://registrar.carnet.hr/wsdl": Could not bind "{http://schemas.xmlsoap.org/soap/encoding/}Array" in message part "return" to a Java type. If doc/lit style is used then message part should reference to global schema element.
at oracle.j2ee.ws.tools.wsa.jaxws.JaxwsWsdlToJavaTool.getJAXWSModel(JaxwsWsdlToJavaTool.java:664)
at oracle.j2ee.ws.tools.wsa.WsdlToJavaTool.createJAXWSModel(WsdlToJavaTool.java:475)
at oracle.j2ee.ws.tools.wsa.Util.getJaxWsSeiInfo(Util.java:1357)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.jdevimpl.webservices.tools.wsa.Assembler$2$1.invoke(Assembler.java:218)
at $Proxy39.getJaxWsSeiInfo(Unknown Source)
at oracle.jdevimpl.webservices.tools.wsa.WsaAdaptor.getSeiInfo(WsaAdaptor.java:505)
... 15 more
Caused by: oracle.j2ee.ws.tools.jaxws.wsdl.ModelBuilderException: Could not bind "{http://schemas.xmlsoap.org/soap/encoding/}Array" in message part "return" to a Java type. If doc/lit style is used then message part should reference to global schema element.
at oracle.j2ee.ws.tools.jaxws.wsdl.OperationMappingBuilder.getPartJavaType(OperationMappingBuilder.java:702)
at oracle.j2ee.ws.tools.jaxws.wsdl.OperationMappingBuilder.createParameterMapping(OperationMappingBuilder.java:675)
at oracle.j2ee.ws.tools.jaxws.wsdl.OperationMappingBuilder.createParameterMapping(OperationMappingBuilder.java:663)
at oracle.j2ee.ws.tools.jaxws.wsdl.OperationMappingBuilder.buildBarePortTypeParameters(OperationMappingBuilder.java:490)
at oracle.j2ee.ws.tools.jaxws.wsdl.OperationMappingBuilder.buildBarePortTypeOperation(OperationMappingBuilder.java:301)
at oracle.j2ee.ws.tools.jaxws.wsdl.OperationMappingBuilder.buildPortTypeOperation(OperationMappingBuilder.java:216)
at oracle.j2ee.ws.tools.jaxws.wsdl.OperationMappingBuilder.build(OperationMappingBuilder.java:93)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.buildPortTypeOperations(WSDLToJavaModelBuilder.java:635)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.buildSEI(WSDLToJavaModelBuilder.java:435)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.buildSEI(WSDLToJavaModelBuilder.java:402)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.buildPorts(WSDLToJavaModelBuilder.java:383)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.buildService(WSDLToJavaModelBuilder.java:322)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.buildServices(WSDLToJavaModelBuilder.java:299)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.buildAll(WSDLToJavaModelBuilder.java:271)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.build(WSDLToJavaModelBuilder.java:188)
at oracle.j2ee.ws.tools.wsa.jaxws.JaxwsWsdlToJavaTool.getJAXWSModel(JaxwsWsdlToJavaTool.java:656)
... 24 more
Caused by: oracle.j2ee.ws.common.databinding.tools.spi.SchemaFindException
at oracle.j2ee.ws.common.tools.databinding.jaxb20.Jaxb20JavaDatabindingContext.getJavaTypeForSchemaType(Jaxb20JavaDatabindingContext.java:52)
at oracle.j2ee.ws.tools.jaxws.wsdl.OperationMappingBuilder.getPartJavaType(OperationMappingBuilder.java:696)
... 39 more
Thanks,
Bruno -
Calling Web services using SOAP
Hi,
I am trying to execute a function through a webservice using a SOAP
package and am getting the following error:ORA-30625: method dispatch
on NULL SELF argument is disallowed. I think this is to do with one of
the parameters being null but dont know how to fix this. Following is
the function:
CREATE OR REPLACE FUNCTION ILACPMSPRC.GET_GREETING_fnc (p_name IN
VARCHAR2
--, p_date VARCHAR2
, p_age VARCHAR2 )
RETURN NUMBER
AS
l_request soap_api_pkg.t_request;
l_response soap_api_pkg.t_response;
l_price NUMBER;
-- DBMS_OUTPUT.ENABLE(20000);
BEGIN
DBMS_OUTPUT.ENABLE(20000);
DBMS_OUTPUT.PUT_LINE('BEGIN');
-- Set proxy details if no direct net connection.
--UTL_HTTP.set_proxy('myproxy:4480', NULL);
--UTL_HTTP.set_persistent_conn_support(TRUE);
-- Set proxy authentication if necessary.
--soap_api.set_proxy_authentication(p_username => 'myusername',
-- p_password => 'mypassword');
l_request := soap_api_pkg.new_request(p_method => 'ns1:validate',
p_namespace => 'xmlns:ns1="http://
impl.webservice.validation.workmgt.cb.irishlife.ie/xsd"');
-- parameter 1 is name
soap_api_pkg.add_parameter(p_request => l_request,
p_name => 'workType',
p_type => 'xsd:string',
p_value => p_name);
-- parameter 2 is date
soap_api_pkg.add_parameter(p_request => l_request,
p_name => 'workItemNo',
p_type => 'xsd:string',
p_value => 'ABC');
--p_value => '2007-01-01T00:00:00Z');
-- parameter 3 is age
soap_api_pkg.add_parameter(p_request => l_request,
p_name => 'indexName',
p_type => 'xsd:string',
p_value => p_age);
l_response := soap_api_pkg.invoke(p_request => l_request,
p_url => 'http://
10.253.55.139:7400/axis2/services/ValidationService',
p_action => 'http://
10.253.55.139:7400/axis2/services/ValidationService/validate');
if l_response.doc is not null then
dbms_output.put_line('the doc is not null');
end if;
DBMS_OUTPUT.PUT_LINE ( 'p_name = ' || p_name );
HERE l_price := soap_api_pkg.get_return_value(p_response =>
l_response,
p_name =>
'validateResponse',
p_namespace =>
'xmlns:ns1="http://impl.webservice.validation.workmgt.cb.irishlife.ie/
xsd"');
if l_price is null then
dbms_output.put_line('opps, the price is null');
end if;
DBMS_OUTPUT.PUT_LINE('PRICE:'||l_price);
RETURN l_price;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SQLCODE || ', ' || SQLERRM);
RETURN NULL;
END GET_GREETING_fnc;
Where HERE is marked is where the problem lies...the package body is
here:
CREATE OR REPLACE PACKAGE BODY SOAP_API_PKG AS
-- Name : http://www.oracle-base.com/dba/miscellaneous/soap_api
-- Author : DR Timothy S Hall
-- Description : SOAP related functions for consuming web services.
-- Ammedments :
-- When Who What
-- =========== ========
=================================================
-- 04-OCT-2003 Tim Hall Initial Creation
-- 23-FEB-2006 Tim Hall Parameterized the "soap" envelope tags.
-- 08-JUN-2006 Tim Hall Add proxy authentication functionality.
g_proxy_username VARCHAR2(50) := NULL;
g_proxy_password VARCHAR2(50) := NULL;
PROCEDURE set_proxy_authentication(p_username IN VARCHAR2,
p_password IN VARCHAR2) AS
BEGIN
g_proxy_username := p_username;
g_proxy_password := p_password;
END;
FUNCTION new_request(p_method IN VARCHAR2,
p_namespace IN VARCHAR2,
p_envelope_tag IN VARCHAR2 DEFAULT 'SOAP-ENV')
RETURN t_request AS
l_request t_request;
BEGIN
l_request.method := p_method;
l_request.namespace := p_namespace;
l_request.envelope_tag := p_envelope_tag;
RETURN l_request;
END;
PROCEDURE add_parameter(p_request IN OUT NOCOPY t_request,
p_name IN VARCHAR2,
p_type IN VARCHAR2,
p_value IN VARCHAR2) AS
BEGIN
p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
p_type||'">'||p_value||'</'||p_name||'>';
DBMS_OUTPUT.PUT_LINE ( 'p_request.body = ' || p_request.body );
END;
--PROCEDURE add_parameter(p_request IN OUT NOCOPY t_request,
-- p_name IN VARCHAR2,
-- p_type IN DATE,
-- p_value IN VARCHAR2) AS
--BEGIN
-- p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
p_type||'">'||p_value||'</'||p_name||'>';
--END;
--PROCEDURE add_parameter(p_request IN OUT NOCOPY t_request,
-- p_name IN VARCHAR2,
-- p_type IN INTEGER,
-- p_value IN VARCHAR2) AS
--BEGIN
-- p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
p_type||'">'||p_value||'</'||p_name||'>';
--END;
PROCEDURE generate_envelope(p_request IN OUT NOCOPY t_request,
p_env IN OUT NOCOPY VARCHAR2) AS
BEGIN
p_env := '<'||p_request.envelope_tag||':Envelope xmlns:'||
p_request.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/"
' ||
'xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">' ||
'<'||p_request.envelope_tag||':Body>' ||
'<'||p_request.method||' '||p_request.namespace||' '||
p_request.envelope_tag||':encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/">' ||
p_request.body ||
'</'||p_request.method||'>' ||
'</'||p_request.envelope_tag||':Body>' ||
'</'||p_request.envelope_tag||':Envelope>';
END;
PROCEDURE show_envelope(p_env IN VARCHAR2) AS
i PLS_INTEGER;
l_len PLS_INTEGER;
BEGIN
i := 1; l_len := LENGTH(p_env);
WHILE (i <= l_len) LOOP
DBMS_OUTPUT.put_line(SUBSTR(p_env, i, 60));
i := i + 60;
END LOOP;
END;
PROCEDURE check_fault(p_response IN OUT NOCOPY t_response) AS
l_fault_node XMLTYPE;
l_fault_code VARCHAR2(256);
l_fault_string VARCHAR2(32767);
BEGIN
dbms_output.put_line('midas8-1');
l_fault_node := p_response.doc.extract('/'||
p_response.envelope_tag||':Fault',
'xmlns:'||
p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
envelope/');
dbms_output.put_line('midas8-2');
IF (l_fault_node IS NOT NULL) THEN
dbms_output.put_line('midas8-3');
l_fault_code := l_fault_node.extract('/'||
p_response.envelope_tag||':Fault/faultcode/child::text()',
'xmlns:'||
p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
envelope/').getstringval();
dbms_output.put_line('midas8-4');
l_fault_string := l_fault_node.extract('/'||
p_response.envelope_tag||':Fault/faultstring/child::text()',
'xmlns:'||
p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
envelope/').getstringval();
dbms_output.put_line('midas8-5');
--RAISE_APPLICATION_ERROR(-20000, l_fault_code || ' - ' ||
l_fault_string);
END IF;
END;
FUNCTION invoke(p_request IN OUT NOCOPY t_request,
p_url IN VARCHAR2,
p_action IN VARCHAR2)
RETURN t_response AS
l_envelope VARCHAR2(32767);
l_http_request UTL_HTTP.req;
l_http_response UTL_HTTP.resp;
l_response t_response;
BEGIN
dbms_output.put_line('Invoking request');
dbms_output.put_line('url :'||p_url);
dbms_output.put_line('action :'|| p_action);
generate_envelope(p_request, l_envelope);
show_envelope(l_envelope);
l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.0');
dbms_output.put_line('midas1');
IF g_proxy_username IS NOT NULL THEN
DBMS_OUTPUT.PUT_LINE('PROXY USERNAME IS NOT NULL');
UTL_HTTP.set_authentication(r => l_http_request,
username => g_proxy_username,
password => g_proxy_password,
scheme => 'Basic',
for_proxy => TRUE);
END IF;
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
UTL_HTTP.set_header(l_http_request, 'Content-Length',
LENGTH(l_envelope));
UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
UTL_HTTP.write_text(l_http_request, l_envelope);
dbms_output.put_line('midas2');
l_http_response := UTL_HTTP.get_response(l_http_request);
dbms_output.put_line('midas3');
UTL_HTTP.read_text(l_http_response, l_envelope);
dbms_output.put_line('midas4');
UTL_HTTP.end_response(l_http_response);
dbms_output.put_line('midas5');
l_response.doc := XMLTYPE.createxml(l_envelope);
dbms_output.put_line('midas6');
l_response.envelope_tag := p_request.envelope_tag;
dbms_output.put_line('midas7');
l_response.doc := l_response.doc.extract('/'||
l_response.envelope_tag||':Envelope/'||l_response.envelope_tag||':Body/
child::node()',
'xmlns:'||
l_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
envelope/"');
-- show_envelope(l_response.doc.getstringval());
dbms_output.put_line('midas8');
check_fault(l_response);
dbms_output.put_line('midas9');
RETURN l_response;
END;
FUNCTION get_return_value(p_response IN OUT NOCOPY t_response,
p_name IN VARCHAR2,
p_namespace IN VARCHAR2)
RETURN VARCHAR2 AS
BEGIN
-- RETURN p_response.doc.extract('//'||p_name||'/
child::text()',p_namespace).getstringval();
dbms_output.put_line('function');
dbms_output.put_line(p_name);
DBMS_OUTPUT.PUT_LINE (p_response.doc.extract('//'||p_name||'/
child::text()', p_namespace).getstringval());
RETURN p_response.doc.extract('//'||p_name||'/child::text()',
p_namespace).getstringval();
END;
END SOAP_API_PKG;
Any help greatly appreciated!!Hello,
I have not looked in detail to you code but I would like to point out that Oracle provides utilities to call Web Services from the database, using a DB package and/or Java in the DB.
Have you looked to the documentation about:
- Developing a Web Service Client in the Database
regards
Tugdual Grall -
JWSDP 1.5 client and WSE 2.0 Web Service
Hello all
This post is mostly about .Net and WSE 2.0 but here goes:
I�m securing a web service using WSE 2.0. One of the potential client�s of the web service is a Java client using Sun JWSDP 1.5. The problem is that the java client gets the error �Server did not recognize the value of HTTP Header SOAPAction:�, and when I look at the trace the error is:
WSE841: An error occured processing an outgoing fault response. ---> System.Web.Services.Protocols.SoapHeaderException: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.
The soap the java client is sending has no Action header and I�m told it can not be changed. Therefore I have been trying to tell my service that actionheader is not required but without success.
This is a actionheader the webservice accepts:
<wsa:Action wsu:Id="Id-29db7046-313a-4675-9bf8-6446b9463aeb">http://tempuri.org/send</wsa:Action>
What I have tried is to change the policy file
This is the default:
<!--MessagePredicate is used to require headers. This assertion should be used along with the Integrity assertion when the presence of the signed element is required. NOTE: this assertion does not do anything for enforcement (send-side) policy.-->
<wsp:MessagePredicate wsp:Usage="wsp:Required" Dialect="http://schemas.xmlsoap.org/2002/12/wsse#part">wsp:Body() wsp:Header(wsa:To) wsp:Header(wsa:Action) wsp:Header(wsa:MessageID) wse:Timestamp()</wsp:MessagePredicate>
Here I tried to tell the service that only body and timestamp was required
<wsp:MessagePredicate wsp:Usage="wsp:Required" Dialect="http://schemas.xmlsoap.org/2002/12/wsse#part">wsp:Body() wse:Timestamp()</wsp:MessagePredicate>
I have also tried to tell the web service everything was optional:
<wsp:MessagePredicate wsp:Usage="wsp:Optional" Dialect="http://schemas.xmlsoap.org/2002/12/wsse#part">wsp:Body() wsp:Header(wsa:To) wsp:Header(wsa:Action) wsp:Header(wsa:MessageID) wse:Timestamp()</wsp:MessagePredicate>
I have also tried to skip the policy file and check on the the bodyparts in code but the error occurs before the webmethod is even invoked.
It is my understanding that WS-specifications are optional and that the way to define which ones I want to use is via a policy file. Is that the correct understanding? I find it difficult to find good documentation on how to use different WS-specifications with WSE 2.0 enabled web service. Does anyone know of good documentation on WS-security using X509 certificates for signing?
Does anyone have solution to this problem or ideas that might lead to solution?
P.s. I have looked at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/wssinteropjwsdp15.asp but I need an example where a java client is talking to a .Net WS. It would be very helpful
Regards,
- Bjarki B.Hi,
firstly JWSDP 1.5 is pretty old, the latest release of JWSDP is JWSDP 2.0 that happened late last year.
The problem is most likely happening due to a bug in JWSDP 1.5. If you dump the Message that is going over the wire you will probably see
SOAPAction : ""
SOAPAction : "<the correct action value>"
And this is the reason for the failure. I believe you are using SOAP 1.1 messages right ?
What you will need to do is upgrade to
JWSDP 2.0 and more important also upgrade your SAAJ jars in the JWSDP installation to SAAJ 1.3
https://saaj.dev.java.net/files/documents/52/32730/saaj1.3.zip
Alternatively, you can use Sun's Project Tango (Sun's Next Generation WebServices Interoperability Technology Offering) which has been tested to interoperate with Microsoft WCF.
http://java.sun.com/developer/technicalArticles/glassfish/ProjectTango/
You can download Project Tango by visiting the following page :
https://wsit.dev.java.net/
Look at the Try It section for instructions on how to use it.
Using the Netbeans Plugin you can develop a java client which can securely communicate with the .Net WebService. All you need to do for that is use Netbeans to create a Java WebService Client by pointing it to the WSDL of the .Net Service.
Let us know if this helped.
Thanks...
Message was edited by:
kumar_at_sun -
Change jsp's in web service client when creating a web service in WID
Hi, Actually , when we a web service, on websphere Integration Developer,JSP's get generated after creating the web service client.
Those JSP's are named as input.html, invoke.jsp etc, I need to change the jsp's for good look and feel,
But I am unalble to do that as there is no configuration information included in the jsps created by default, Please let me know, if any has come across this kind of situation and knows how to deal with.Hi,
Not sure if you can get answer to WID specific questions on the Oracle-WebServices forum. Here, we are mainly talking about SOAP and WSDL, and mostly with the Oracle OC4J implementation.
When you generate a static proxy, you can set the endpoint URL dynamically using a helper method on the class generated by JDeveloper - look for setEndpoint()
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Stub;
public void setEndpoint(String endpoint) {
((Stub) _port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, endpoint);
}The generated code uses the JAX-RPC APIs under the cover, which may also apply to Websphere's internal implementation.
Hope it Helps,
-Eric -
How to call Web Services (with javascript) in a view load event ?
Hello to the expert community,
I'm looking for a piece of javascript code allowing to call Web Services in a view load event ?
Any ideas will be really appreciated.
Regards.
Have a nice week.Thank you for your answer, dongmei.
It seems that the MethodResultTableDataProvider does not return the response of the web service as a value field if the WSDL contains only one result element.
E.g. from WSDL of the USWeather Web Service which returns theGetWeatherReportResult string:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.webserviceX.NET" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www.webserviceX.NET" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET">
<s:element name="GetWeatherReport">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetWeatherReportResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetWeatherReportResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="string" nillable="true" type="s:string" />
</s:schema>If I drag the web service method on the page and I should be able to select the response value in the Bind to Data dialog box. But there is no value field. Value fields only occur if the web service returns more than one value.
The question is how can I get the response GetWeatherReportResult from the service. -
Calling Web service from Java Concurrent Program
Hi,
I created a Java concurrent program and created executable. Here is my code.
public void runProgram(CpContext ctx) {
String value = "Java Concurrent Program Testing";
Hello hell = new Hello();
String returnValue = hell.testURL(value);
if(returnValue.equalsIgnoreCase("TRUE")){
ctx.getLogFile().writeln("-- Java Concurrent Program Testing --", 0);
ctx.getOutFile().writeln("-- Java Concurrent Program Testing --");
ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");
else{
ctx.getLogFile().writeln("-- Hello World! --", 0);
ctx.getOutFile().writeln("-- Hello World! --");
ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");
}testURL() call the web service and get the response. but when I am selecting View Output option I am always geting out put as
-- Hello World! --I tested the logic of calling web service. It giving me out put "true". Here is my Web service calling code
public String testURL(String Value){
HttpURLConnection httpConn = null;
ByteArrayOutputStream bout = null;
String setWebServiceURLResponse = "";
String responseString="";
String outputString = "";
try{
httpConn = getHttpConnection();
bout = new ByteArrayOutputStream();
String xmlInput = soapBodyStart +
"<ns1:getTestURL>\n" +
" <ns1:URL>"+Value+"</ns1:URL>\n" +
" </ns1:getTestURL>"+
soapBodyEnd;
byte[] buffer = new byte[xmlInput.length()];
buffer = xmlInput.getBytes();
bout.write(buffer);
byte[] b = bout.toByteArray();
httpConn = setHttpConnectionRequest(b,httpConn);
//Read the response.
InputStreamReader isr = new InputStreamReader(httpConn.getInputStream());
BufferedReader in = new BufferedReader(isr);
//Write the SOAP message response to a String.
while ((responseString = in.readLine()) != null) {
outputString = outputString + responseString;
//Parse the String output to a org.w3c.dom.Document and be able to reach every node with the org.w3c.dom API.
Document document = parseXmlFile(outputString);
String formattedSOAPResponse = formatXML(outputString);
System.out.println("Formatted response = \n" +formattedSOAPResponse);
//NodeList nodes = document.getElementsByTagName("setWebServiceURLResponse");
//NodeList nodes = document.getElementsByTagName("getTestURLResponse");
NodeList nodes = document.getElementsByTagName("ns0:getTestURLResponse");
int len = nodes.getLength();
System.out.println("Inside testURL Node Lenght = "+ len);
for(int s=0; s<nodes.getLength() ; s++){
Node authenticateResultNode = nodes.item(s);
if(authenticateResultNode.getNodeType() == Node.ELEMENT_NODE){
Element authenticateResultElement = (Element)authenticateResultNode;
//NodeList authenticateResultValueNode = authenticateResultElement.getElementsByTagName("ns0:return");
//NodeList authenticateResultValueNode = authenticateResultElement.getElementsByTagName("return");
NodeList authenticateResultValueNode = authenticateResultElement.getElementsByTagName("ns0:return");
Element authenticateResultValue = (Element)authenticateResultValueNode.item(0);
NodeList textFNList = authenticateResultValue.getChildNodes();
//System.out.println("Authenticate Result : " + ((Node)textFNList.item(0)).getNodeValue().trim());
setWebServiceURLResponse = ((Node)textFNList.item(0)).getNodeValue();
//System.out.println("Authenticate Response in getAuthenticate method : " + authenticateresponse);
}//end of if clause
}//end of for loop with s var
System.out.println("Inside setWebServcieURLToFile response = " + setWebServiceURLResponse);
catch(Exception e){
e.printStackTrace();
return setWebServiceURLResponse;
}Where I am going wrong ?
Regards,
Ajay Sharmasample code:
static string url = "http://my.webservice.url"; ---------------> The actual web service URL
Call = new Call(url); --------------------------------------------------> The call object used by JAX-RPC
Object[] params = new Object[]{param1, param2};---------> build the call parameters
Boolean/Integer/Whatever result = call.invoke("method name", params);------>call the invoke method to get the result
Maybe you are looking for
-
IPod Nano will not sync.
I have the new 8GB iPod Nano, and when I first installed iTunes and plugged in my iPod, it synced perfectly (I had songs from an earlier iTunes for when I had my Shuffle). Now when I try to sync, it doesn't work. I press try, then iTunes freezes for
-
I installed the WebLogic Workshop 8.1.2 (Build: 2003.1211.044125). I built all six projects and everything seems to work well. I could access to the sample web services on the WebLogic server from the local server as well as from a remote client mach
-
Dear Friends, When i am posting down payment with reference to PO i am using a different vendor rather than the vendor in PO. It is giving only warning message. When I am posting down payment amount more than PO value then also system is giving warni
-
MacBook Pro will not load Facebook
MacBook Pro will not load Facebook, pictures on Pinterest, and will not play any Youtube videos. I already checked for software updates and it is still not working. This is happening in both firefox and safari.
-
Pb de musique saccadée avec xp sur deezer
bonjour à tous, j'ai depuis quelque temps, un pb pour la lecture de musique sur deezer sous xp familial le pb est le suivant : - sur mon pc fixe, sous xp familial, sp3, 512 M de ram, et connecté en éthernet (1 méga : je ne suis pas dans une zone dé