Http 302 found response while consuming rest service
Hi,
When Sap Pi consumed rest service in receiver rest adpater, the response is as following:
HTTP PUT call to http://host:port/backend/v2/test/test1 not successful. HTTP/1.1 302 Found
when i tried with rest client tool:
firstly it said :
Redirect To: http://host:port/login.jsp with status: 302 HTTP/1.1 302 Found
Redirection information has not been cached.
the second is:
Status
200 OK Loading time: 22
How can i redirect in sap PI?
Thanks,
Nurhan
Can you please post some of the values you are using to connect to your Schema Service? (please redact the hostname URL for security purposes)
You can also follow this tutorial:
Data Loading and the Oracle Database Cloud Service
Format is usually:
username used to sign up
password giving at sign up
Service Instance URL
Similar Messages
-
SOAP client receives HTTP 302 Found
Hi all
I have a message interface for which I generated a wsdl pointing to the SOAP adapter:
http://server:50000/XISOAPAdapter/MessageServlet?channel:=servicename:channelname
If I am using SAP Soap Client to send a request (http, HTTP Basic Auth.) everything is fine, the message is in the SOAP adapter, in IS and I receive a correct SOAP response.
But if am using other clients, e. g. SoapUI, I get an HTTP 302 Found error back before the data even reaches the SOAP adapter (no message there).
Has anybody an idea how to solve this or where to find more information about it?
Thanks in advanceThanks for your answers,
but I am still lost with this error. The cluster only consists of one server node and the redirect posts to
http*s*://server:5000*1*/XISOAPAdapter/MessageServlet?channel:=servicename:channelname
So it changes to https. Why is this? What is the client (which is a standard application that we cannot change) supposed to do?
Thanks for any info
Hans -
No transport error while consuming WCF service in a REST way
Hi,
Here is a small article on when we usually face No Transport error and how to get rid of it.
I recently worked on a sample application using “app for Office” (New in Visual Studio 11.0)
What is “app for Office”?
An app for Office is basically a webpage that is hosted inside an Office client application. You can use apps to extend the functionality of a document, email message, meeting request, or appointment. Apps
can run in multiple environments and clients, including rich Office desktop clients, Office Web Apps, mobile browsers, and also on-premises and in the cloud.
What can an app for Office do?
An app for Office can do pretty much anything a webpage can do inside the browser, such as the following:
Provide an interactive UI and custom logic through JavaScript. (Develop UI using HTML and JavaScript)
Use JavaScript frameworks such as jQuery.
Connect to REST endpoints and web services via HTTP and AJAX.
Run server-side code or logic, if the page is implemented using a server-side scripting language such as ASP or PHP.
As “app for Office” doesn’t have an option to write server side scripting (unlike code behind or in-line coding feature in ASP.NET/MVC) we will have to go for web service or WCF service and consume the service
using any JavaScript framework like Jquery.
I wrote a simple WCF service to hook up with server side code and consumed the service using Jquery as follows
$(document).ready(function () {
$.ajax({
type: "GET",
url: "http://localhost/MyService.svc/rh/data?id=" + $('#sampleType').val(),
processData: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
crossDomain: true,
success: function (data) {
alert(data)
error: function (xhr, status, error) {
alert(error);
I encountered an error saying “No Transport” when I executed the client application.
I did some investigation on this and found out the root cause that cross-domain request was disabled. But I was really not sure whether it was at my WCF service end or “app for Office” client end. I added
Client Access policy and Cross-domain-policy xml files to WCF service in order to enable cross-domain request
so that service will accept any type requests sent form different domains.
Client Access policy
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
Cross-domain-policy
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
Both the policies should be in different XML files
But this didn’t solve my problem. After a little bit more investigation I found exactly where and how to enable-cross domain requests.
Solution
We need to enable cross-domain requests in environments that do not support cross-domain requests.
“Cors is equal to true if a browser can create an XMLHttpRequest object and if thatXMLHttpRequest
object has a withCredentials property. To enable cross-domain requests in environments that do not support cors yet but do allow cross-domain XHRrequests (windows gadget, etc), set $.support.cors = true;”
You just have to add jQuery.support.cors = true; in your client scripting and it works perfectly fine.
[Cors- Cross-Origin Resource Sharing]
A simple example:
$.support.cors = true;
$(document).ready(function () {
$.ajax({
type: "GET",
url: "http://localhost/MyService.svc/rh/data?id=" + $('#sampleType').val(),
processData: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
crossDomain: true,
success: function (data) {
alert(data)
error: function (xhr, status, error) {
alert(error);
Hope this will be helpful.
ThanksThis is very good technich to resolve the problem. but this is not working in Google chrome or Firfox . can any one help me.
-
Hi Oracle Cloud Gurus,
I have signed up for Oracle Database Cloud Service Trial and activated the same. I am able to login to Apex applications, SQL Workshop etc but not able to connect from SQL*Developer on my local m/c.
I configured the "Cloud Connection" by giving the provided username, password and URL. When I try to connect, I get the error - "HTTP/1.1 302 Found". Any ideas how to resolve this ?
Here is the complete error stack:
oracle.dbtools.raptor.cloud.auth.AuthenticationFailedException: HTTP/1.1 302 Found
at oracle.dbtools.raptor.cloud.auth.basic.BasicAuthenticationEngine.doPost(BasicAuthenticationEngine.java:162)
at oracle.dbtools.raptor.cloud.auth.basic.BasicAuthenticationEngine.authenticate(BasicAuthenticationEngine.java:63)
at oracle.dbtools.raptor.cloud.auth.basic.GUIBasicAuthenticationEngine.authenticate(GUIBasicAuthenticationEngine.java:26)
at oracle.dbtools.raptor.cloud.connection.ConnectionCreator.createConnection(ConnectionCreator.java:24)
at oracle.dbtools.raptor.cloud.connection.CConnections$C.getConnection(CConnections.java:39)
at oracle.dbtools.raptor.cloud.connection.CConnections.getConnection(CConnections.java:176)
at oracle.dbtools.raptor.cloud.navigator.CloudConnection.openConnectionImpl(CloudConnection.java:127)
at oracle.dbtools.raptor.cloud.navigator.CloudConnection.getConnection(CloudConnection.java:89)
at oracle.dbtools.raptor.cloud.navigator.ConnectionTreeNode$LoadTask.doWork(ConnectionTreeNode.java:74)
at oracle.dbtools.raptor.cloud.navigator.ConnectionTreeNode$LoadTask.doWork(ConnectionTreeNode.java:38)
at oracle.dbtools.raptor.backgroundTask.RaptorTask.call(RaptorTask.java:193)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$RaptorFutureTask.run(RaptorTaskManager.java:554)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: HTTP/1.1 302 Found
at oracle.dbtools.raptor.cloud.auth.basic.BasicAuthenticationHandler.handleError(BasicAuthenticationHandler.java:250)
at oracle.dbtools.raptor.cloud.auth.basic.BasicAuthenticationHandler.handleError(BasicAuthenticationHandler.java:24)
at oracle.dbtools.raptor.cloud.connection.CloudHander.handleResponse(CloudHander.java:38)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:945)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:919)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:910)
at oracle.dbtools.raptor.cloud.connection.DefaultClient.executeRequest(DefaultClient.java:96)
at oracle.dbtools.raptor.cloud.auth.basic.BasicAuthenticationEngine.doPost(BasicAuthenticationEngine.java:153)
... 17 moreCan you please post some of the values you are using to connect to your Schema Service? (please redact the hostname URL for security purposes)
You can also follow this tutorial:
Data Loading and the Oracle Database Cloud Service
Format is usually:
username used to sign up
password giving at sign up
Service Instance URL -
Consuming REST Services from Sharepoint Online (office 365) with jquery
I hosted Rest services in one server but i am consuming the REST Service through jquery which is using from sharepoint online.
while consuming i am getting the error like "Blocked cross domain ........ "
another exception like since we are calling from https(sharepoint online) to http(other server) , so the problem will be like..
any body having any idea to solve the cross domain issue to access the http from https call.
advance thanks !Hi,
For the cross domain issue when using REST API, I suggest you take a look at the articles below with more information and code samples provided:
http://blogs.msdn.com/b/officeapps/archive/2012/11/29/solving-cross-domain-problems-in-apps-for-sharepoint.aspx
http://msdn.microsoft.com/en-us/library/office/fp179927(v=office.15).aspx
http://msdn.microsoft.com/en-us/magazine/dn198245.aspx
Thanks
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they
help and unmark them if they provide no help. If you have feedback for TechNet
Subscriber Support, contact [email protected]
Patrick Liang
TechNet Community Support -
Error while consuming Odata service from Gateway client i.e /iwfnd/gw_client
Hello Experts.
I am facing below an error while consuming the Odata service from GW client... The error is "No service found for the namespace /IWFND/,name ZTEST_STOREROOM_SRV,version 001". Even i have tried to deep dive in /IWFND/Error_log but no use..
Actually what I was doing :- My aim is to connect multiple back end systems in the same server with the help of Aliasing concept.. I have created multiple aliases and added in the /IWFND/MAINT_Service transaction.. but i am not getting how to consume the service..
I have followed the solution upto some extent in the link => Multiple Origin Composition - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library
Can you please let me know how to resolve this.. Also please let me know, the syntax for the URI...
Your help is highly appreciated..
Please find the screenshot attached.
Thanks,
Srinivas.Hello @Nrisimhanadh_Yandamuri
Thanks for your reply..
I have got all the required authorization.. But still I am not able to hit the service.. Please let me know what could be the solution..
Thanks,
Srinivas. -
HELP: Error while consuming Web Service: ClassCastException
Hi,
I am trying to consume a web service that I deployed on Tomcat/Axis. Any guideline will be helpful. I generated stubs using WSDL2Java utility from Axis. The method I am trying to call is getFibo(), which returns an object FiboHolder. Unfortunately everytime it is throwing ClassCastException. I have couple of other methods in the service that returns int and int[] and both works fine. Could anyone please help why I am not able to consume the service when it is returning the object FiboHolder but works fine when I consume other methods of the service that returns int or int[]?
Following is my client code:
FibonacciService service = new FibonacciServiceLocator();
FibonacciSoapBindingStub stub = (FibonacciSoapBindingStub) service.getfibonacci(new URL("http://localhost:8080/axis/services/fibonacci"));
// Now use the service to get a stub to the service
FiboHolder fibHold = stub.getFibo(); //code errors out at runtime here
System.out.println(fibHold.getFibo1());Following is the error message I get:
org.apache.axis.AxisFault: java.lang.ClassCastException
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.ClassCastException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:
Thanks,Hi all,
Please throw some light into this issue i am getting the following exception.
com.sap.engine.services.webservices.jaxm.soap.accessor.NestedSOAPException: Problem in server response: Proxy Authentication Required.
I have given the proxy settings in the com.sap.portal.ivs.httpservice in the portal and also
defined a proxy server in the Visual Administrator under Services -> Webservice Container -> HTTP Proxy Server
I am calling service in the following manner.
IPortalRuntimeResources runtime = PortalRuntime.getRuntimeResources();
IService service = runtime.getService(IWS_P_Service.KEY);
IWS_P_Service ws_service = (IWS_P_Service)service;
Volumes from = new Volumes(Volumes.VOLUMES_KILOLITER_VALUE);
Volumes to = new Volumes(Volumes.VOLUMES_LITER_VALUE);
ChangeVolumeUnit cvu = new ChangeVolumeUnit(1200,from,to);
// working upto here
response.write("working");
ChangeVolumeUnitResponse cvu_res = ws_service.ChangeVolumeUnit(cvu);
double result = cvu_res.getChangeVolumeUnitResult();
response.write(result+"");
It is working upto "working".
If any body has any solutions please post.
Thanks -
Hi,
Can you please let me know the approach to consume a REST service dynamically.
I have a custom orchestration service as described in the below thread. I use BRE resolvers to resolve and set the endpoints runtime on dynamic ports. Also using dynamic transforms.
http://www.ithero.nl/post/2013/06/02/Creating-a-Custom-Itinerary-Orchestration-Service-for-the-Recipient-List-pattern.aspx
Now i want to extend this to invoke REST apis as well. Can you please guide to a link or share some ideas on how this can be achieved using BizTalk 2013.
Also could you please comment on authentication of such requests.
Thanks,
Ujjwal
-UjjwalHi Ujjwal,
Here is a useful link for you.
Calling Restful Service using Dynamic Send Ports – BizTalk 2013
How to call RESTFULL service using Dynamic Ports with Variable Mapping in
WCF-WebHttp Adapter
Rachit
Please mark as answer or vote as helpful if my reply does -
TNS timed out error while testing REST service
4.2
11g
Hi There,
We had a new application which was to get and post data using REST API which connects to an internal server. This works fine when we use the Google Chrome Advance REST application through the browser, but get a TNS timed out when trying through Apex
Even a simple sql in the SQL workarea in Apex throws the same error
select utl_http.request( 'http://ourserver.com/api/subscriptions') test
from dual;
ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1130 ORA-12535: TNS:operation timed out
Any idea, what the issue could be? Works fine from the browser though using a REST client
Trying this for the first time.
thanks,
RyanHi Ryan,
During your installation, did you follow the steps to enable Network Services, which is one of the requirements when using web services in APEX. You'll find the necessary information in the installation guide. Also in your utl_http.request call, have you tried specifying a proxy, if one is required? You might also want to take a look at at apex_web_service API, specifically the make_rest_request function, which might be useful if you're looking to invoke a RESTful Service via PL/SQL in your application.
Regards,
Hilary -
XML Deserialization error while consuming Enterprise service in wd java..
Hello,
I am trying to build 2 webdynpro java webdynpro applications which consumes enterprise service for purchase order and another application for Busines partner.
While i was able to successfully consume the PO service in webdynpro java and get the desired output for PO..i get XML Deserialization error while running appliation for Business Partner..
These are the details/steps i followed for the Business Partner application:
1. After creating the model using the enterprise service, i created a service controller from the model to the component controller..
2. Out of many inputs/output attributes during mapping from model to component controller. i further mapped the context from CC to ViewC.
3. In the wdDoInit() method, i added the follwing code:
BPCreate model1 = new BPCreate();
Request_BusinessPartnerERPCreateRequestConfirmation_In RequestC = new Request_BusinessPartnerERPCreateRequestConfirmation_In(model1);
BPERPCrteReqMsg_S CreateMessage = new BPERPCrteReqMsg_S(model1);
BPERPCrteReq_SBP Cpartner = new BPERPCrteReq_SBP(model1);
String Category = new String();
String lf = new String();
Cpartner.setInternalID(new String());
Cpartner.setNumberRangeIntervalBusinessPartnerGroupCode(new String());
Cpartner.setLifeCycleStatusCode(lf);
Cpartner.setCategoryCode(Category);
CreateMessage.setBusinessPartner(Cpartner);
RequestC.setBusinessPartnerERPCreateRequestMessage_Sync(CreateMessage);
wdContext.nodeBusinessPartnerERPCreateRequestMessage_Sync().bind(CreateMessage);
4. When i comment this code and run the application, the aplication comes up but the input fields are non-editable..
5. If i place this code in wdDoInit() method, i get the Deserialization error..
Any idea about why this error occurs and which areas in the application can lead to these errors?
I checked that the service runs fine in soamanager.
Thanks, JVRHi Kishore,
This error is majorly because while executing this Webdynpro application you are not entering all the mandatory fileds of WS.
Please try to execute this WS from WS-Navigator, check which fileds are mandatory and then
appropriately instantiate it in wdDoInit and pass all the fields required.
Regards,
Vaibhav Modi. -
Windows authentification while consuming web service from ABAP
Hi All,
We are consuming web service from ABAP, we have created client proxy in SE80 and configured logical port in LPCONFIG.
This one was working fine. Now we have added windows user authentification to access this service.
Now when I'm trying to regenerate this proxy in R/3 it is asking for user and password. When I enter these details this one is not working.
If I access this service direcly from internet explorer and I enter same user and password then I would able to access this service.
Could you please let me know how to handle this.
Regards
VikramThe dialog that is produced by HTTP Destination object of the logical port is designed only for use within Classic Dynpro applications. There is no prompt produced when running in Web Dynpro. If possible assign a generic user within the logical port definition and this will be used automatically by all users.
-
Passing HTTP Headers from BPEL to a RESTFul service in SOA 11g PS2.
Hi All,
We have the following requirement.
We need to pass the following headers to RESTFul service.
x_invensys_wss_username = "Some UserName"
x_invensys_wss_password = "Some Password".
I tried to first pass username and password properties by following below post.
Attach Http headers in BPEL Process
Specifically below steps..
Hi,
If you are talking about how to invoke a secured webservice...please follow this...
After creating the reference for your secured webservice in your composite, right click on the composite and say configure web service policies...
Add the security policy named "oracle/wss_http_token_client_policy"
And also, for the reference, create two binding properties
1. oracle.webservices.auth.username
2. oracle.webservices.auth.password
For the above two properties, provide the appropriate values.....
Please test the same after making this changes and let me know....
Thanks,
Narsing Pumandla
======================================================
Somehow i don't see the headers getting added to the call.
The service i am calling don't really need these headers.But the URL we will be calling shortly for the real application need them.
Can someone let me know whether this SOA version supports this or not.?
If yes , Then what is the best way to solve this issue.[i.e Able to send hardcoded values and also user specified values.]
Thanks,
Sid.I am using this URL : api.geonames.org/postalCodeSearch?postalcode=90110&username=siddhardha
I see below message in audit trail.Not sure why the headers are not visible.
Am i missing something which is very fundamental.?
<messages>
<Rest_InputVariable>
<part name="Input">
<Input>
<postalcode>90110</postalcode>
<username>Siddhardha</username>
</Input>
</part>
</Rest_InputVariable>
<Rest_OutputVariable>
<part name="geonames">
<geonames>
.....results.............
</geonames>
</part>
</Rest_OutputVariable>
</messages>
Edited by: Siddhardha M on Jul 19, 2012 5:44 AM -
Intermittently getting 404 while accessing RESTFul Service
Hi,
I am using apex.oraclecorp.com and exposed simple not secure RESTFul Service. Some user of it in different geographic location are getting error 404.
Any idea why? Also how can I enable debug or look at the logs etc?
Thanks,
-AbhiHi Srinivas
Try putting the port of your portal
http://<ip>:<port>/irj/portal
good luck
Joshua
Message was edited by: Josue Cruz -
Error in HTTP framework - 401 unauthorised while creating a service consume
Hi,
I am trying to create a service consumer in SE80 by specifying a WSDL URL of a webservice ( I created this webservice from an inbound service interface ).....but at the last step it asks for user id and pwd......after specifying the user / pwd it says Error in HTTP framework - 401 unauthorised
what may be the problem....the user has all tha required authorisation as I can use the same user to test in wsnavigator.In my experience this problem was always found to be around authorizations necessary for execution of specific activity. I would strongly advise you to speak with your Security/Authorization consultant to help you.
-
Authentication error while consuming web service published in SR of CE 7.1
Hi,
I am having this error while trying to consume a web service published in local services registry. Authentication level is set as Basic in the web service and in end point. I am receiving this error in security log files.
Message:Authentication for web service ServicesRegistrySiService, configuration ServicesRegistrySiPort using security policy sap.com/tcesiuddisrws~earServicesRegistrySiServiceServicesRegistrySiPort*ws failed: Login failed.. (See SAP Note 880896 for further info).
Category: /System/Security/WS/Authentication
Location: com.sap.engine.services.wssec.authentication.authenticate
Application: sap.com/tcesiuddisrws~ear
Thread: HTTP Worker [1]
Data Source: j2ee\cluster\server0\log\system\security_00.log
Correlator ID: 33747500000034965
Argument Objects:
Arguments:
DSR Component:
DSR Transaction: 72b226c009ed11dd9a3e000c29c818ce
DSR User:
Message Code:
Session: 4196
Transaction:
User: Guest
Host: ########
System: ###
Instance: J00
Node: server0
following is the code in a C# .Net 2.0 from where the service is called.
CnarService srv = new CnarService();
NetworkCredential ic = new NetworkCredential("user", "password");
CredentialCache cache = new CredentialCache();
srv.UseDefaultCredentials = false;
srv.PreAuthenticate = true;
srv.Credentials = ic;
try
srv.Timeout = 600;
cnarobject cnObj = srv.GetObject("1");
fnameTextBox.Text = cnObj.firstname;
lnameTextBox.Text = cnObj.lastname;
mnameTextBox.Text = cnObj.middlename;
catch (WebException wex)
MessageBox.Show(wex.Message + wex.Response + wex.StackTrace);
I tried to find the SAP Note 880896 but note doesn't exists. I am receiving similar error while trying to connect Enterprise Services explorer for .Net
Please help.
Regards
MontyHi,
maybe you should see the settings for the ServicesRegistrySiService too. Under nwa->SOA.
I am not sure, but the error seems like not able to use the ServicesRegistrySiPort, which is to be authenticated against.
It is then used for retrieval of web services and publishing to the registry... i suppose.
I am not sure though.
Best regards,
Vera
Maybe you are looking for
-
Noobie - script trying to open classic when it's not needed
I need some help. I have written a short, simple script that I hope will work to open an index.htm file in a users default browser when it is run from a cd. I have a disk that basically contains a website with links on the disc and links to the web.
-
IPhone 5 (iOS 6.1.4) back up issue
This started of late; every time I try to back up I get the message "iTunes could not back up the iPhone "... iPhone" because the iPhone disconnected" while it's still connected via Lightning. It goes through suncing just fine, but does not back up.
-
I was given a used iPod touch 2nd. gen because my old faithful 5th generation nano was tragically washed. But I'm scared to just plug the new one into my computer to see what happens. I want to make sure I don't lose all of the music I have on my nan
-
Time Machine Taking a Long Time to Index
Hi everyone. I first noticed this today. My Time Machine is taking a long time to index. It's stuck on "Waiting for index to be ready (100)" for about 10 minutes at least, it seems. I did notice earlier today that it had to delete old backups to m
-
Not sure where to post this, so here goes... I'm using Firefox 2.0x and Adobe Reader 8.0 on iMac Core2Duo. When I click on a link to a pdf file, the file opens nicely in the browser, but at the same time downloads a copy to my Downloads folder. I don