How to Parse different HTTP response efficiently ... ?
how to Parse different HTTP response efficiently ... ?
1. Last time I helped you I didn't get any response back.
2. How is this question related to Swing?
3. Your question has too many details...
4. No help for you.
Similar Messages
-
How to change the HTTP Response as XML (Content Type "text\xml") ?
Hi Friends ,
I have created one RFC Destination TYPE H . When i am trying to post some XML Message to that particular HTTP Service using POST method . It succesfully accepted the XML File but , it is returning the String as " OK" . In the connection test trace i have seen the Content Type as "text/html" but * I need to get as "text\xml" .*
I need to get response back as XML not plain text .
1 Any Configuration setting do we need to do on Service (SICF ) ?
2. Or any other place we need to modify to get the HTTP Response as XML not plain text
Can you please help to solve the problem . Any clue ?
Thanks & Regards.,
V.Rangarajan
Edited by: ranga rajan on Jan 2, 2008 2:07 PMDear users,
we have requirement sending SMS to the customers mobiles. I am successfully sending the messages to the customers mobiles by using the above method. Facing issues with response message. The response messages is in plain text fromat in single line like...Sent
Using HTTP_AAE Receiver adapter.
The response message was failed while excution of the message mapping with the error
Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_SMS_CUST_RES_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog.
please share the comments how to pass the Status of the message to SAP ECC from SAP HTTP adapter
Regards,
Sudir. -
How to change the HTTP Response as XML (Content Type "text\xml") When Post
Hi Friends ,
I have created one RFC Destination TYPE H . When i am trying to post some XML Message to that particular HTTP Service using POST method . It succesfully accepted the XML File but , it is returning the String as " OK" . In the connection test trace i have seen the Content Type as "text/html" but * I need to get as XML format no Srting ( Type "text\xml" . ) *
I need to get response back as XML not plain text .
1 Any Configuration setting do we need to do on Service (SICF ) ?
2. Or any other place we need to modify to get the HTTP Response as XML not plain text
Can you please help to solve the problem . Any clue ?
Thanks & Regards.,
V.RangarajanDear users,
we have requirement sending SMS to the customers mobiles. I am successfully sending the messages to the customers mobiles by using the above method. Facing issues with response message. The response messages is in plain text fromat in single line like...Sent
Using HTTP_AAE Receiver adapter.
The response message was failed while excution of the message mapping with the error
Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_SMS_CUST_RES_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog.
please share the comments how to pass the Status of the message to SAP ECC from SAP HTTP adapter
Regards,
Sudir. -
How to get the HTTP response body if the body is a malformed XML document
Hi,
I am using HTTP service with resultFormat = "e4x" set. What i
get in response is a malformed XML document in
some cases. Usually HTTPService throws a FaultEvent with the
fault detail set to faultCode:Client.CouldNotDecode
faultString:'Error #1091' or some other Error #1085 and so.
My client tries to log these errors on the server by using
another HTTP service again. But i would like to know
in the client code during run time what exact XML response
came in the first HTTP response.
How do i retrieve this information?
thanks,
Sunilservice capture or charles debug proxy can do the job.
flex builder 4 is rumored to include a traffic sniffer as
well, but that's next year. -
How to return multipart HTTP response containing image data as well as xml data
Hi,
My web service accepts
request as string and returns response as string. Being new to ASP.Net, please clarify my below doubts.
a) How
can i provide multipart response of the below format while returning response in string format.. How to implement multi-part response where I need to return Image data as well as xml data also.
HTTP/1.0 200 OK
Date: Wed, 03 Mar 2004 14:45:11 GMT
Server: xxx
Connection: close
Content-Type: application/xxx-multipart
Content-Length: 6851
Content-Type: image/jpeg
Content-Length: 5123
CommandID: asset14521
<5123 bytes of jpeg data>
Content-Type: xxx-xml
Content-Length: 1523
<?xml...
Thanks,
DivyaHi MeetDivya,
I suggestion you post the question in the ASP.NET forums at
http://forums.asp.net/. It is appropriate and more experts will assist you.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
IDOC - XI - HTTP/MAIL (How to get the http response and send an email?)
Hi David!
If you are able to send any Http message in reference to message from XI (eg. with Idoc number or msg-id) there is no problem to process it in your scenario (even if comunication is asynchronous).
Regards,
RadekYou need a 2:1 mapping. source interfaces are Idoc and Http response, target interface is the mail.
As you can do his only for abstract interfaces, you have to create an abstract message interface based on the IDoc structure.
For the http call you need abstract async message interfaces representing request and response which you can use for the mapping and for the container variables inside the BPM.
Regards
Stefan -
Hi all :)
I am trying to parse an http response that I get back from a webserver that I sent my request to. The reponse is recieved as an InputStream which I then wrap in a Buffered Reader:
BufferedReader input = new BufferedReader(new InputStreamReader( urlConn.getInputStream()));
The content of the InputStream looks is in the following format:
name1=intValue&name2=strValue&name3=strValue&name4=&name5=strValue
...etc
The content always comes back to me with the same variables in the same order, even if the variables have no value (see name4=&name5 indicates name4 has no value, but the variable is still returned). What I'd like to do is separate the value of name1 and store it in a local variable of the same name. So I have:
String name1 = ?? //some code to browser input stream for "name1" then retrieve the value after the '=' and before the '&'
I am not exactly sure how to write this code? I am looking at the API's for InputStream, StreamTokenizer, and BufferedReader, but I am not having that much luck finding out how to do this.
Any advice or direction is greatly appreciated. Thanks!StringTokenizer st = new StringTokenizer(response, "&");
// creates a tokenizer that uses "&" as the delimiter to break up the response
while (st.hasMoreTokens()) {
String parameter = st.nextToken();
// this should have something like "name1=intValue"
int break = parameter.indexOf("=");
// find where the equals sign is in it
// I leave it to you to use the substring() method to get the 2 bits
}I just noticed the bit about "store it in a local variable of the same name". Forget about that, variables are created at compile time. You need some kind of a Map where the parameter name is the key and the parameter value is the value. -
How to send a http request to a non java appln
I have one legacy web application running which can handle only http request . So I need to connect (using http request) and send my request and get the response, without opening that application in browser.
Any idea
1) How to connect to non - java appln from a java appln ?
2) How to use the Httprequest without displaying the page using browser?You can try one of three routes:
Open a socket and write the HTTP request and parse the HTTP response yourself
Use java.net.URLConnection
Use Jakarta Common's HttpClient at jakarta.apache.org- Saish -
how can i change http response code?
plsi used
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);but when i capture the packets from ethereal i'm getting
0000 00 14 38 c2 4f c7 00 90 7f 05 e7 50 08 00 45 00 ..8.O......P..E.
0010 02 40 0a 70 40 00 e7 06 37 fc c0 c3 cc d8 c0 a8 [email protected]@...7.......
0020 01 07 00 50 f3 d6 72 7c 82 f2 e1 3d 48 a0 50 10 ...P..r|...=H.P.
0030 06 8e 9d 89 00 00 48 54 54 50 2f 31 2e 31 20 32 ......HTTP/1.1 2
0040 30 30 20 4f 4b 0d 0a 44 61 74 65 3a 20 54 75 65 00 OK..Date: Tue
0050 2c 20 32 31 20 4e 6f 76 20 32 30 30 36 20 30 37 , 21 Nov 2006 07
0060 3a 32 33 3a 30 38 20 47 4d 54 0d 0a 53 65 72 76 :23:08 GMT..Servand also the error which i wrote is not comming in the body part.
whats seen is
0160 59 50 45 20 68 74 6d 6c 20 50 55 42 4c 49 43 20 YPE html PUBLIC
0170 22 2d 2f 2f 57 33 43 2f 2f 44 54 44 20 58 48 54 "-//W3C//DTD XHT
0180 4d 4c 20 31 2e 30 20 54 72 61 6e 73 69 74 69 6f ML 1.0 Transitio
0190 6e 61 6c 2f 2f 45 4e 22 20 22 68 74 74 70 3a 2f nal//EN" "http:/
01a0 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 54 52 2f 78 /www.w3.org/TR/x
01b0 68 74 6d 6c 31 2f 44 54 44 2f 78 68 74 6d 6c 31 html1/DTD/xhtml1
01c0 2d 74 72 61 6e 73 69 74 69 6f 6e 61 6c 2e 64 74 -transitional.dt
01d0 64 22 3e 0a 3c 68 74 6d 6c 3e 0a 20 20 20 20 0a d">.<html>. .
01e0 3c 68 65 61 64 3e 0a 09 09 3c 74 69 74 6c 65 3e <head>...<title>
01f0 48 54 4d 4c 20 50 61 67 65 3c 2f 74 69 74 6c 65 HTML Page</title
0200 3e 0a 3c 2f 68 65 61 64 3e 0a 0a 3c 62 6f 64 79 >.</head>..<body
0210 20 62 67 63 6f 6c 6f 72 3d 22 23 46 46 46 46 46 bgcolor="#FFFFF
0220 46 22 3e 0a 54 68 69 73 20 69 73 20 74 65 73 74 F">.This is test
0230 2e 68 74 6d 6c 20 70 61 67 65 0a 3c 2f 62 6f 64 .html page.</bod
0240 79 3e 0a 20 20 20 20 0a 3c 2f 68 74 6d 6c y>. .</htmlsomething like this...i'ven't copied fully... -
Capturing HTTP Response Async RFC - XI - HTTP
Hello All,
Can somebody please explain how to capture the HTTP response. My scenario is
Async RFC --> XI --> HTTP. Its an external HTTP url and the HTTP response is in XML format.
Do I have to use a BPM for this? Without using BPM I'm able to see the HTTP return codes in MONI...but unable to see the HTTP response.
Thanks
KarthikThanks Aamir for the quick reply. We dont have to send back the response to the calling posting RFC. This is just to get a confirmation back saying message was processed. Writing the response to a file would be a good idea. So in that case how would the BPM look like? This would be a Async-Sync bridge case right?
Barring error handling for now..will the basic BPM be something like
Reciever --> MessageTransformation (This interface mapping would be from ZRFC_Abstract_Async_MI to HTTPPostMessage_MI ) --> Sync Send step --> Stop.
Thanks
Karthik -
How do I view HTTP responses that PHP sends to my Flex app?
My RemoteObject throws an exception, because my PHP script prints some kind of error message. So how do I view that error?You can define a fault handler for your RemoteObject component in Flex.
You can also use a tool like Charles or Fiddler in order to see the HTTP requests and responses. -
How to see http response from an axis web service call (Eclipse)
Hello,
I would like to see the raw http response which is returned from web service calls. I have a dynamic web project in Eclipse which uses a local instance of Tomcat 6. I'm using all of the default setting for a top-down web service generated from a WSDL file. I've generated the client using the built-in "generate client" using default settings.
I've tried using the Eclipse plugin TCP/IP monitor and apache's TCPMON, but I am only able to see the http request, not the http response returned from the web server I am querying.
I've seen some sparse documentation outlining how to use logging handlers and a client-config.wsdd file, but I haven't been able to get that working.
So to recap, I'm looking for a way to view raw http responses using a web service client and server generated from a WSDL file in eclipse. I don't mind creating a new project using different code-generating libraries if someone has an easy way to do this using a different configuration.
Thanks very much,
Craig908794 wrote:
Hello,
I would like to see the raw http response which is returned from web service calls.Why the HTTP response? Isn't the soap message body enough? If it is, you probably want to check out SoapUI.
A simple google query for "apache axis2 http response" also return this article:
http://blogs.cocoondev.org/dims/archives/004668.html
And finally, you did go through the Axis2 website right? It has a wiki with a rather staggering amount of articles in there.
http://wiki.apache.org/ws/FrontPage/Axis2/ -
How can I access a response file on the same computer but with different login?
When trying to access a response file on the same computer that was used to set it up, but with a different login, I get an error message that the network resource was not found. How can I retrieve the responses on the same computer but under a different login/username?
The response file is associated with a specific login (as determined under Edit > Preferences > Identity) so you cannot retrieve it if you're using a different login.
-
[Forum FAQ] How to display an image from Http response in Reporting Services?
Question:
There is a kind of scenario that users want to display an image which is from URL. In Reporting Services, if the URL points to an image file, we can directly display it by typing the URL in embedded image. However, some URLs are just sending Http requests
to server side, then redirect to another position and the server will return the image. For these kind of URLs, Reporting Services can’t directly render the image from Http response.
Answer:
To achieve this goal, we can add custom code into the report. Pass the URL as argument into our custom function so that we can create HttpRequest and get the HttpResponse. Then we can use custom function to return the Bytes() from the HttpResponse and render
it into an image in report.
Ps: In Reporting Services, it only support drawing Bytes() array into image, so we need to have our custom function return Bytes array.
Add the assembly and custom code into the report.
Public shared Function GetImageFromByte(Byval URL as String) As byte()
Dim photo as System.Drawing.Image
Dim Request As System.Net.HttpWebRequest
Dim Response As System.Net.HttpWebResponse
Request = System.Net.WebRequest.Create(URL)
Response = CType(Request.GetResponse, System.Net.WebResponse)
If Request.HaveResponse Then
If Response.StatusCode = Net.HttpStatusCode.OK Then
photo = System.Drawing.Image.FromStream(Response.GetResponseStream)
End If
End If
Dim ms AS System.IO.MemoryStream = new System.IO.MemoryStream()
photo.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
Dim imagedata as byte()
imagedata = ms.GetBuffer()
return imagedata
End Function
Grant the permission for assemblies.
Go to:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\RSpreviewPolicy.config
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\rssrvpolicy.config
Give “FullTrust” for Report_Expressions_Default_Permissions.
Insert an image into report.
Expression:
=Code.GetImageFromByte("https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSrVwPoAtlcA2A3KaiAJi-XjS4icr1QUnKYr7uzpX3IL3g2GPisAQ")
The Result looks below:
Applies to:
Reporting Services 2005
Reporting Services 2008
Reporting Services 2008 R2
Reporting Services 2012
Reporting Services 2014
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.>
Hi, I'd like to display a dynamic image from the web inside a JLabel or any other swing component it could work in. I've been looking on the Swing tutorials and others forums, all I can have is that a JLabel can load an Icon object, defined by an image URL, but can this URL be like "http://xxxxx/image.jpg" somehow or can it only be a local image URL?>
I do not know why you start talking about an image on the web then go on to show concerns about whether it will work for a 'local' URL.
But perhaps this answer will cover the possibilities.
So long as you can from an URL to the image, and the bytes are available for download (e.g. some web sites wrap a direct call to an image in HTML that embeds the image), the URL based icon constructors will successfully load it.
It does not matter if that URL points to
- a web site,
- a local server ('localhost'),
- an URL representation of a File on the local file system, or
- it is inside a Jar file that is on the application's run-time classpath.
How you go about forming a valid URL to a 'local resources' (or indeed what you regard as local resources) is another matter, depending on the form of the project, and how the resources are stored (see list above).
Probably the main reason that examples use images at a hard coded URL on the net is that it makes an 'image example' self contained. As soon as we compile and run it, we can see the result. I have posted a few examples like that on these forums.
Edit 1:
BTW - Welcome to the Sun forums
Edited by: AndrewThompson64 on Apr 21, 2009 12:15 PM -
Adobe Document Services - http Response 500 - How to configure the logging?
We are building an application in Web Dynpro Java that fetches data from an R/3 system via an RFC connection and is then supposed to show said data in a pdf within an iview. For that task we want to use the InteractiveForm UIElement. We bind the data to its pdfSource in the iViewu2019s context. Currently the form only consists of a text field bound to one attribute element of the pdfSource context node.
The ADS webservice is configured according to the manuals found here:
http://help.sap.com/saphelp_nw70/helpdata/en/fa/0b700d6cfd4e03a8ec2186ba6ff4af/frameset.htm
and tested successfully under the following link
http://<portal_host>:<port>/AdobeDocumentServices/Config?style=document
However, when we execute the application, an error occurs in the webservice generating the pdf, namely Invalid Content-Type:text/html. The error occurs when the iView containing the form is shown for the first time, even before the attributes of the pdfSource context are filled with data (we expect to see an empty form).
As it seems the webservice is expected to return a MIME type of either application/pdf or text/xml (we donu2019t know for sure since the SAP manuals and forums are inconclusive here), but instead we get text/html. This seems to be due to the fact that the webservice exits with an http response 500 Internal Server Error (we used several network monitoring tools to confirm that such a response is sent). Since such http responses are but html files with an empty body, yet not xml or pdf, the aforementioned error does make sense to us, but we do not know what Internal Error has caused it.
The only help that SAP seems to provide for an error u201CInvalid Content-Type:text/htmlu201D in context with ADS points to an expiring password or otherwise poor configuration of the ADSUser, which (most certainly) is not our case here since, and as said above, the configuration was and can be tested successfully.
We then tried to view the logs for this error on the machine where the J2EE engine is running with ADS installed according to this (not very comprehensible) guide:
http://help.sap.com/saphelp_nw70/helpdata/de/97/ccfc3f0ac2c642e10000000a1550b0/frameset.htm
We cannot find anything relevant in the server.log of the Visual Administrator except this message (it is generated exactly when our error occurs u2013 the trace severity is set to ALL for all Adobe application elements according to manual):
Date , Time , Message , Severity , Category , Location , Application , User
12/08/2010 , 13:50:46:511 , application [webdynpro/dispatcher] Processing HTTP request to servlet [dispatcher] finished with error.
The error is: com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.base.core.PDFDocumentRuntimeException: Failed to GENERATEPDF
Exception id: [0800274DA7ED00850000005B00000900000496E5919E28BA] , Error , /System/Server/WebRequests , com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl , sap.com/tcwddispwda , Guest
There is no error.pdf to be found on the file system and since neither have we known nor are we told by the error message, whether the underlying cause is is a render error or connection error or configuration error or what not, we donu2019t know whether the error.pdf is supposed to be generated at all.
Or could there be any other reason why generation didnu2019t take place?
Furthermore we canu2019t seem to be able to find any logs more verbose or detailed about this issue - at least not within the Visual Administrator or the portalu2019s nwa.
How is it possible to properly debug the webservice for pdf-generation or at least to retrieve a fully detailed log containing all notifications and exception stack traces etc.?
I am assuming that we are making some basic mistakes regarding the logging configuration - but what?
Our goal is to know what causes the 500 Internal Server Error response that causes the Incorrect Content-Type exception.
We are using a NetWeaver 7.01 portal installation with Adobe Document Services 7.01 installed on a Windows Server 2003 platform.
Any help is highly appreciated!
SergHave you tried restarting the Java PDF object in Visual Administrator? Once you do all of your config, you have to restart the PDF object (sao.com/tcwdpdfobject) for the changes to take place. I am assuming you've run all of the test programs in SAP (FP_TEST_00, FP_TEST_03, etc.). Is there any chance that the ADSUSER is locked somehow?
Maybe you are looking for
-
Connecting the coax cable (from the wall) to my tv instead of box?
I was told this: Though I though in order for the set top box to work you need the coax plugged into the box? Please wait for a Samsung Agent to respond. Please wait for a Samsung Agent to respond. You are now chatting with 'Danice'. There will be a
-
How do I convert my text to curves?
I have a document that I've created in AI CS2 and my printer needs the text converted to curves since they don't have the font that I used. I have no idea what all of this means I just know that I need it down, now! Any insight will be greatly apprec
-
Duplicate songs in Itunes after Icloud setup.
Once I subscribed to Itunes Match and it did a sync in Icloud, I found many duplicates in Itunes after that. They are identical. It even loaded two song files on the drive. If I try to delete one, it asks if I want to delete the song from Icloud too.
-
Missing episodes - Nikita (Warner TV)
Missing episodes - Nikita (Warner TV) - should be 22 episodes in series 1, only 14 listed? Solved! Go to Solution.
-
Disconnected device shows up in Airport utility
I have several Airport Extreme and Time capsules connected to my network. One of my Airport Extreme devices seemed defective so I removed it from my network. It's unplugged, no power at all and no light showing. Yet when I open Airport Utility on my