Hello there
I'm new to web services and pl/sql..
Trying to create issue using soap with the pl/sql code under (my code is based on this one http://forums.atlassian.com/thread.jspa?forumID=46&threadID=26313 - if anyone have author's of that code contacts, please, tell me)
-----
declare http_req utl_http.req; http_resp utl_http.resp; request_env varchar2(32767); response_env varchar2(32767); resp varchar2(32767); pv_assignee varchar2(20) := 'admin'; pv_reporter varchar2(20) := 'admin'; pv_project varchar2(20) := 'TEST'; pv_summary varchar2(20) := 'tttttttest'; pv_token varchar2(30) := 'YWRtaW46YWRtaW4='; begin
-- that's for passing SSL-certificate utl_http.set_wallet( path => 'file:/u01/app/oracle/wallet', password => 'orapass22');
-- XML-message body request_env:='<?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" xmlns:m0="http://beans.soap.rpc.jira.atlassian.com"> <SOAP-ENV:Body> <m:createIssue xmlns:m="http://soap.rpc.jira.atlassian.com" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <in0>'||pv_token||'</in0> <in1> <id></id> <assignee>'||pv_assignee||'</assignee> <attachmentNames/> <key/> <project>'||pv_project||'</project> <reporter>'||pv_reporter||'</reporter> <resolution/> <status>1</status> <summary>'||pv_summary||'</summary> <type>3</type> </in1> </m:createIssue> </SOAP-ENV:Body> </SOAP-ENV:Envelope> '; http_req := utl_http.begin_request('https://jirasrv:8443/rpc/soap/jirasoapservice-v2?wsdl', 'POST', 'HTTP/1.1'); utl_http.set_authentication(r => http_req, username => 'admin', password => 'admin', scheme => 'Basic', for_proxy => FALSE); utl_http.set_header(http_req, 'Content-Type', 'text/xml; charset=utf-8'); utl_http.set_header(http_req, 'Content-Length', length(request_env)); utl_http.set_header(http_req, 'SOAPAction', ''); --utl_http.set_header(http_req, 'SOAPAction', '"http://tempuri.org/LogMessage"'); utl_http.write_text(http_req, request_env); http_resp := utl_http.get_response(http_req); dbms_output.put_line('Response Received'); dbms_output.put_line('--------------------------'); dbms_output.put_line ( 'Status code: ' || http_resp.status_code ); dbms_output.put_line ( 'Reason phrase: ' || http_resp.reason_phrase ); utl_http.read_text(http_resp, response_env); dbms_output.put_line('Response: '); dbms_output.put_line(response_env); utl_http.end_response(http_resp); end;
----
And anytime I'm getting an error, even when :
<?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>com.atlassian.jira.rpc.exception.RemoteAuthenticationException: User not authenticated yet, or session timed out.</faultstring><detail><com.atlassian.jira.rpc.exception.RemoteAuthenticationException xsi:type="ns1:RemoteAuthenticationException" xmlns:ns1="http://exception.rpc.jira.atlassian.com"/><ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">gpbjira</ns2:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
I guess there may be incorrect:
1) setting the pv_token variable (i supposed there must be base64-encoded pair "username:password" as I read at wiki - http://en.wikipedia.org/wiki/Basic_access_authentication - and I just tried to encode pair "admin:admin") because I don't know how to get the auth token
2) empty 3rd argument in the function utl_http.set_header(http_req, 'SOAPAction', ''); - I tried to put "https://jirasrv:8443/rpc/soap/jirasoapservice-v2?wsdl#createIssue" here but result was the same
Please, help me :-(
Thanks in advance
Community moderators have prevented the ability to post new answers.
resolved by invoking method login first and then grabbing token from its output
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.