Reading ESB Request Header elements
Hi!
Is it possible to get to SOAP header elements using ehdr:getRequestHeader() function? If yes, can someone provide and example of it? Also, what all are included in the Request Header? Is there a place where I can learn more about Request and other ESB headers?
More specifically given the following SOAP envelope sent to the routing service:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">qqqqqqqqqqq</wsa:MessageID>
</soapenv:Header>
<soapenv:Body>
<ns1:Response xmlns:ns1="GeneralResponse">
<ns1:KeyData>af</ns1:KeyData>
</ns1:Response>
</soapenv:Body>
</soapenv:Envelope>
How can I read the value of wsa:MessageID? (Please note that we are only using the element from WS-Addressing and not WS-Addressing itself).
Thank you.
The only header I get is sap-ep-version, but I am referencing my WD application via iView.
When I access my WD app via URL, then it doesn't have any HTTP headers.
I can pass in URL parameters, which is picked up as HTTP headers. For security reasons, I would rather not send information as URL parameters.
I am guessing the code above is for URL parameters. Is there an option/configuration I am missing here?
Similar Messages
-
Reading custom SOAP header with XHeaderName1
Hello Experts,
I have a SOAP to File scenario and I am trying to do dynamic receiver determination by looking at the SOAP request header info. I am adding a custom field (System_ID) that I want rules to run against in Receiver Determination..
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:*******************">
<soapenv:Header>
<System_ID>100</System_ID>
</soapenv:Header>
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
In the Receiver Determination I have multiple rules using SOAP context object to XHeaderName1 = the System_ID (100) to pass the message to the right system at runtime according to the System_ID.
In the SOAP sender channel I have Set Adapter-Specific Message Attributes and Variable Transport Binding checked. I also have the variable name System_ID in the first Variable Header (XHeaderName1).
In the SOAP sender Conversion Parameters I have Do Not Use SOAP Envelope and Keep Headers checked, as well as nosoap=true in the SOAP request URL.
I'm getting the System ID to show in XI in sxmb_moni in the Header but no where do I see it being used with XHeaderName1.
Am I using XHeaderName1 right? If not could you advise as to how XHeaderName1 should be used?
My requirement is to read system ID from Header, not payload.
Thank you!
TimI was able to find a solution to my problem.
I created a basic senario below to test:
1.A basic Asynchronous scenario is created using a SOAP sender adapter to 2 possible flat file receivers.
2.The SOAP sender channel will have the option u201CDo Not Use SOAP envelopeu201D checked and SOAPUI URL will have u201C&nosoap=trueu201D added to the end.
3.The receiver system name will be stored in the WS-Addressing u201CActionu201D field sent from SOAPUI.
4.Two ABAP mappings are created. One mapping will extract the system number from the WS-Addressing u201CActionu201D field. The other mapping will extract just the body of the SOAP message to send along. Using regex and string manipulation in the ABAP mappings we can reuse the mappings for any SOAP message.
5.Enhanced (Extended) Receiver Determination is selected and interface mapping using system/XI ReceiverDetermination service interface is used to capture the receiver system.
While this is a solution is not the best, it is a solution. Upon research I found a recent SAP Note 1385579 talking about implementing a SAP delivered generic SOAP Sender AXIS handler com.sap.aii.axis.soap.HeaderExtractionHandler to extract SOAP Header elements and place in message attributes. I will be trying this out. -
Adding Header Elements in Jdev 11g
Hi ll,
Using Jdev 11g and created a SOA application. My input xml has 5 header elements (versionNo, ServiceName etc), that I want to ultimately pass to the webservice I am invoking.
Question: How do I create a XSD which will include these 5 Header elemnts ?
OR is there a way in Jdev 11g soa editor to provide these required Header elements as part of my request ? If yes, then what are the steps in jdev, which wizard do i use to include these header elements ?
thx
ppTry asking this on the SOA Suite forum.
-
Reading POST-Request-Parameter-Values from WebDynPro now possible?
Hello,
in the past I always was disappointed that in WebDynPro there was no way to read POST-request-parameter-values directly after the call of a WebDynPro-Application.
The only (documented) way to read / transfer request-data into an WebDynPro-application was via "URL query string parameters" in the request URL.
The last week I forgot this restriction. I called my WebDynPro-application using a POST-Request-Parameter (cookie_guid) instead of an URL-parameter.
After noticing my mistake, I was really surprised that the WebDynPro could read / shows the the POST-Request-Value.
I didn't make any changes in the coding of my WebDynPro-Application (zvis_show_sso_cookie).
After this cognition I built the following simple HTML-formular to analyse the behavior of the WebyDynPro by calling it with an URL-Parameter (cookie_guid=Url-GUID) together with the POST-Parameter (cookie_guid = Post-Value-GUID).
After calling the WebyDynPro it reads / shows the "POST-Value" of the request !!!
(Remark: If I made a simple refresh or type directly the URL "http://hg10762.vis-extranet.de:1080/sap/bc/webdynpro/sap/zvis_show_sso_cookie?sap-language=DE&cookie_guid=Url-GUID" in the browser, the same webdynpro reads / shows the URL-Parameter-Value).
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<form method="post" action="http://hg10762.vis-extranet.de:1080/sap/bc/webdynpro/sap/zvis_show_sso_cookie?sap-language=DE&cookie_guid=Url-GUID">
<table border="0" cellpadding="5" cellspacing="0" bgcolor="#E0E0E0">
<tr>
<td align="right">Cookie_GUID:</td>
<td><input name="cookie_guid" type="text" size="30" maxlength="30" value="Post-Value-GUID"></td>
</tr>
<tr>
<td>
<input type="submit" value=" Absenden ">
<input type="reset" value=" Abbrechen">
</td>
</tr>
</table>
</form>
</body>
</html>
My questions:
I there any documentation that describes the behavior of WebDynPro after calling it by using POST-Parameter values?
I believe in the past it wasn't possible to read POST-request-parameter-values in WD. Has SAP changed the functionality?
Is the behavior I described in my example above mandatory?
Regards
SteffenAs far as i know in general HTTP request GET method is standard but in SAP POST is standard. All the client request is passed as POST to the server in order to avoid the URL parameter length restriction in GET method.
-
ERROR : Cannot read the request body while creating new calendar event api.
Hi,
I was trying to create and update the calendar event using [POST] https://outlook.office365.com/api/v1.0/me/events and [PATCH] https://outlook.office365.com/api/v1.0/me/events/<eventId> respectively.
When i try with poster or postman, I get this error
{error: {code: "ErrorInvalidRequest" message: "Cannot read the request body."} }
its not working . Any help will be appreciated.
Note: GET events and DELETE Events are working. I think the API with payload is not working.
Test Data :
URL: https://outlook.office365.com/api/v1.0/me/events/
Method: POST
JSON Data(Payload):
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
"Start": "2015-01-06T07:03:07.481Z",
"End": "2015-01-05T07:03:07.481Z",
"Attendees": [
"EmailAddress": {
"Address": "[email protected]",
"Name": "Konveen"
"Type": "Required"
Error:
"error": {
"code": "ErrorInvalidRequest",
"message": "Cannot read the request body."Hi Sahil,
I was able to make your request work fine against my Office 365 mailbox with 2 changes.
1. Can you please make sure you are adding header "Content-Type: Application/Json"?
2. Can you please make sure your end time is AFTER start time? Looks like there is a typo with your current request as the start time is on 2015-01-06 and end time is on 2015-01-05.
Hope that helps ...
Thanks,
Venkat -
I can no longer access Bejeweled Blitz through facebook. I get the message, "your browser sent a request that this server could not understand. Size of a request header field exceeds server limit". I can access Bejeweled through FB using my husband's log in so to me that suggests the problem is with my log in. Help please.
Contact FB or use another browser.
-
Upgraded to Firefox 5.0.1 yesterday. No, after logging on to firefox, which takes me to my comcast page and when I try to get
my e-mail I get this message "your browser sent a request this server could not understand. Size of request header field exceeds server limit" Then it says something about "cookies" I also tried to connect to other sites and get similar messages. Just to let you know I am not a guru, and 80 years old, but I did not have this problem with the previous version. Question, why are the headers repeated? Could that be the problem???This issue can be caused by corrupted cookies.
Clear the cache and the cookies from sites (e.g. comcast) that cause problems.
"Clear the Cache":
* Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
"Remove Cookies" from sites causing problems:
* Firefox > Preferences > Privacy > Cookies: "Show Cookies" -
How i can find user locale/language from his/her request header ?
Hi
thank you for reading my post
what is request header field that shows user agent language/locale ?
is there any http header value that shows user locale/language ?
if yes , how i can extract it ?
thanksCertainly there is.
http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z12
The header is "accept-language"
You can get it via
request.getHeader("accept-language");
You can use request.getHeaderNames() to give you an enumeration of all the headers sent by the browser, so you can see them and the values.
Here is an extract from a test page I use every once in a while that prints out useful information. This bit prints out request headers (using JSTL)
You can just drop it into a jsp page (don't forget to import the JSTL tag library) and it will show you all the request headers.
<h3>Headers </h3>
<table>
<c:forEach var="h" items="${header}">
<tr><td><c:out value="${h.key}"/></td><td><c:out value="${h.value}"/></td></tr>
</c:forEach>
</table>Cheers,
evnafets -
Retrieving Request XML Element in Web Service Code
to create a web service: I write java code and using JDeveloper, I 'create J2EE web service' from the java code.
I need to get and handle a parameter, passed to the web service in the request xml and process it in my java code. For example I want to access a header element received in the request.
How can I retrieve those elements in my code?
Regards
FarbodHi V.S,
[Here|http://img144.imageshack.us/my.php?image=datetimekb1.jpg] by the screenshot of the working example.
The expression that I have used is :
=DSTR(@DATE1,"XML_DATE")&TSTR(@TIME1,"XML_TIME")
Where,
XML_DATE YYYY-MM-DD 2001-01-31
XML_TIME THH:NN:SS 02:39:40
This should work now. Let me know.
Best regards,
Dharmi
Edited by: Dharmi Tanna on Sep 8, 2008 2:29 PM -
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 -
External URL link in Request header page
Hi Experts,
I know that with transaction launcher in solman we can connect to external URL in navigation area, but I want to publish the same link within the Request header page, as a URL. Any thoughts ?
Thanks in advance.
JigneshGot it, by adding the below code in the GET_P_xxxx method of the attribute
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_sortable. "This column is not sortable
rv_value = 'false'. "#EC NOTEXT
WHEN if_bsp_wd_model_setter_getter=>fp_disable_filter. "Disable filter
rv_value = 'true'. "#EC NOTEXT
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
* -> field type: client click
rv_value = cl_bsp_dlc_view_descriptor=>field_type_link.
WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
* -> onClick
** Get the path name
rv_value = "'http://www.google.com'.
ENDCASE. -
How to use Request header in the OSB error handler
Hi
I have a scenario where OSB proxy service accptes the payload and routes to the target service
and before routing, I'm generating UUId and inserting in to the request header and publishing the request payload along with UUID to another service.
when the target service is thrown some business fault,i need to publish the fault along with the header(which has UUID).since my target service sends only fault body,header is getting emptied in the error hanlder section.
How can I use the requestheader in the error handler section. Any help is highly appreciated.
Thanks,
N
Edited by: user13154768 on Sep 23, 2010 3:25 AM
Edited by: user13154768 on Sep 23, 2010 3:26 AMJust assign your request header ($header) to your variable (e.g. $myRequestHeader) and than use this variable in your error handler. Fault response will override your $header but can't override $myRequestHeader.
-
Adding cookies to request header
hi,
I am using http client to make a url connection and getting the data back.
I need to set cookies while making this request . does any one have any idea how to do this?viiveek wrote:
hi,
i am using the following code
URL pluckURL = new URL(accessURL);
URLConnection connection = pluckURL.openConnection();
connection.setRequestProperty("hd",hdVal);
connection.setRequestProperty("anonId",anonIdVal);
connection.connect();
both hd and anonid are the cookies i need to set in request header. when i do this i dont get any input.That's not how you've been shown. If you can't update to a modern JDK, then you will have to construct the header used for transferring Cookies yourself. Read the associated RFCs and find out how the header must look like. -
Add request header for a iplanet web server instance
Hello
Does any one know how can I add a request header for a iplanet web server instance?I believe you want to add request header :
Adding request header :
AuthTrans fn="set-variable" $headers{"myheader1"}="myheadervalue"
Adding response header
Output fn="set-variable" $srvhdrs{"myresphdr"}="myresphdrvalue" -
HTTP extra '\r' is used in the request header
We received the following error:
<timestamp> <E> <HTTP> extra '\r' is used in the request header
Shortly after - we received several other application specific "null pointer errors"
and the system keeled over and died. This happened on production code that has
not changed in 45 days. Has anybody seen this error before? Any ideas as to the
cause?We have seen the same error message in our server as well. The system kept running
well even after the error, so we are not sure what it was about. But I would also
like to know what could cause this, and what the implications are. Thanks.
Sudin
"John Slaman" <[email protected]> wrote:
>
>
We received the following error:
<timestamp> <E> <HTTP> extra '\r' is used in the request header
Shortly after - we received several other application specific "null
pointer errors"
and the system keeled over and died. This happened on production code
that has
not changed in 45 days. Has anybody seen this error before? Any ideas
as to the
cause?
Maybe you are looking for
-
Open url link in custom workflow. SharepPoint 2010
Hi, i created custom workflow in Visual studio 2010. I want my workflow opened page of the site. In workflow i using method - Process.strart("http:\\mysite\myform.aspx") try to open the page. But my workflow is completed after his the start. Browser
-
hi, when i am executing the smartform a runtime error is raised in function module SSFCOMP_GENERATE_SMART_FORM and the error is err_comp ssf_err_main_width_changed 'A' 080 can anyone tell what is the error its throwing ?
-
Problems connecting a psp to the net
i just replaced my psp that was stolen last year, when i had the first one i owned i could use the net on it and only get like 17% signal, now with this new one i get 55% signal, on someones linksys and there isnt any security on it, but if i try to
-
Starting forms app - 6i / iAS in UNIX
When I try to start 6iForms designer, I get an error 'Unable to start/complete the build' and Default Resource file not found. Could you also let me know the commands I need to use in UNIX for starting,compiling and running forms Thanks Hans
-
IMS 5.2 Symetric Cluster Install
hi, the docs discuss the installation process for an asymetric cluster (Sun Cluster 3.0) in a reasonable amount of detail but there are no specific docs for a symmetric cluster install. Are these available anywhere?