Help with http 401 code ?
[Add] I forgot to mark this as question [Add]
I wrote a smalll program that send the xml to soap webservice on the server
If I use the browser to type the link on(http://myserver/myservices/RequestWS) , it pops up a window authenfication box. I type user name and password in and it works (logged in, see the message from the server)
However, if I run the java code below, the error is thorwn when I write to the outputStream.
public static void main(String[] args) throws Exception {
String SOAPUrl = args[0];
String xml = args[1];
URL url = new URL(SOAPUrl);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
byte[] b = xml.getBytes();
// Set the appropriate HTTP parameters.
httpConn.setRequestProperty( "Content-Length",String.valueOf( b.length ) );
httpConn.setRequestProperty("Content-Type","text/xml; charset=utf-8");
httpConn.setRequestMethod( "POST" );
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
httpConn.setAllowUserInteraction(true);
httpConn.setDefaultUseCaches(false);
httpConn.setUseCaches(false);
OutputStream out = httpConn.getOutputStream();
System.out.println("httpConn.getResponseCode():"+httpConn.getResponseCode());
out.write( b );
out.close();
}The console is:
httpConn.getResponseCode():401
java.io.IOException: Server returned HTTP response code: 401 for URL: http://ADMIN:password@myserver/myservices/RequestWS
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at SOAPClient.main(SOAPClient.java:81)
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://ADMIN:password@myserver/myservices/RequestWS
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at SOAPClient.main(SOAPClient.java:74)
Exception in thread "main"
Please help.
Thank you very much
Edited by: mycoffee on Jun 8, 2010 10:27 AM
Edited by: mycoffee on Jun 8, 2010 11:06 AM
morgalr wrote:
[Check this thread, it should answer your question.|http://forums.sun.com/thread.jspa?threadID=5247915]
Thank for quick help. My mistake is the colon after "Authorization
I removed it and I get another error now from 401, now I am getting 500 :D
{code}String creds = "ADMIN:password";
String encodeCreds = Base64.encode(creds.getBytes());
httpConn.setRequestProperty("Authorization:", "Basic "+encodeCreds); {code}
Edited by: mycoffee on Jun 8, 2010 12:35 PM
Edited by: mycoffee on Jun 8, 2010 12:36 PM
Similar Messages
-
Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7.
You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.
-
Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work
You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
Regards. -
I need help on some HTML code if at all possible.
What I am trying to do is set up a page that someone can
enter their name address and email into a form and when they hit
the submit button it automatically sends them a premade email of my
choosing that I make prior and somehow maybe embeded into the html
code to the address that they entered? I dont know if it is
possible but I am sure it can be.
Thank you in advanceActually, you could be subject to "abuse complaints", not
"abuse".
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"bregent" <[email protected]> wrote in
message
news:fb547q$b49$[email protected]..
> >What I am trying to do is set up a page that someone
can enter their name
> address
>
> Sure, you can do it fairly easily with any scripting
language. You need to
> be
> cautious about sending automated emails to anyone
without first validating
> that
> they are the actual owners of the email address,
otherwise you open your
> site
> up to abuse.
>
> >I dont know if it is possible but I am sure it can
be.
>
> Huh?
> -
Suspended Workflow in SharePoint 2013 with HTTP 401 Error!
I have a list workflow which starts automatically when creating an item to generate a serial number. But when any user create
a new item, the workflow suspend with the following details, and only the users with "Full Control" permissions can make the workflow work:
RequestorId: eda26c74-95ef-2733-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow
instance. Exception details: System.ApplicationException: HTTP 401 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["1"],"SPClientServiceRequestDuration":["88"],"SPRequestGuid":["eda26c74-95ef-2733-87b9-028d0512861d"],"request-id":["eda26c74-95ef-2733-87b9-028d0512861d"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"Cache-Control":["max-age=0,
private"],"Server":["Microsoft-IIS\/8.0"],"WWW-Authenticate":["NTLM","Basic realm=\"sp.contoso.com\""],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1;
RequireReadOnly"],"Date":["Sun, 27 Apr 2014 11:13:07 GMT"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance
instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)Hi AmrHanmam,
According to your description, my understanding is that SharePoint 2013 workflow suspend with 401 error.
For resolving your issue , please do as the followings:
Be sure User profile synchronization is started.
The user by whom you are logged is available in User Profile list.
Final step full synchronization of User Profile Application.
Here is a similar post for your reference:
http://social.technet.microsoft.com/Forums/en-US/8671e31e-fde2-454c-aba4-0fc6484dd873/sharepoint-2013-workflow-suspend-with-401-error?forum=sharepointcustomization
In addition, there is another reason for this issue, please take a look at:
http://support.microsoft.com/kb/2839070/en-us
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
Help: Received HTTP response code 404 : Not Found
Transmitting the message to endpoint http://chmsxd42:52200/sap/xi/engine?type=entry using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 404 : Not Found.
Our senario is a simple file transfer one, no object has been created in IR.
While we run the wizard, we just put the dummy interface name and namespace in the interface and namespace blanks.
After we activate the objects, the source files were picked up and deleted but there is no file created in the target directory, and we got the error message listed at the top.
Does anyone has some clue about this? Please help.
Thanks a lot.
Aditya BabuHi,
The port of Integration Engine is 80XX, and so 8001.
In the SLD you must to select the Business System of XI and there you can just set the corret Pipeline URL.
It means you AE is unable to communicate with IE.
t-code SMICM..check the HTTP port No:
open the SMICM code...just right click anywhere in the window...then click on the Services..it will show u the HTTP and HTTPs port no.
THen from SLD --Business Landscape --your Business System..chek the Pipeline URL http://<host>:<port>/sap/xi/engine?type=entry
the HTTP port that u will see in the SMICM should be same in the pipeline URL
Have you checked this one,...
/people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
Go through this link which as the information of all HTTP errors in XI
/people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
Thanks
Vikranth -
Deploying simple HTML page to WLS 10.3.6 fails with HTTP response code: 502
- I created a simple HTML page and want to test deployment to WLS 10.3.6 on Linux. I created WAR file and when using JDev 11.1.1.4.0 to deploy to WebLogic Server, it fails to deploy. Full errors/messages are:
[04:40:56 PM] ---- Deployment started. ----
[04:40:56 PM] Target platform is (Weblogic 10.3).
[04:40:59 PM] Retrieving existing application information
[04:40:59 PM] Running dependency analysis...
[04:40:59 PM] Building...
[04:40:59 PM] Deploying profile...
[04:40:59 PM] Wrote Web Application Module to C:\JDeveloper\mywork\Simpe_HTML\Project1\deploy\SimpleHTML.war
[04:41:01 PM] Deploying Application...
[04:41:01 PM] Weblogic Server Exception: weblogic.deploy.api.internal.utils.DeployerHelperException: The source 'C:\DOCUME~1\NGOLDR~1.LAT\LOCALS~1\Temp\SimpleHTML.war' for the application 'SimpleHTML' could not be loaded to the server 'http://dupe:7031/bea_wls_deployment_internal/DeploymentService'.
Server returned HTTP response code: 502 for URL: http://dupe:7031/bea_wls_deployment_internal/DeploymentService
[04:41:01 PM] See server logs or server console for more details.
[04:41:01 PM] weblogic.deploy.api.spi.exceptions.ServerConnectionException: [J2EE Deployment SPI:260041]Unable to upload 'C:\JDeveloper\mywork\Simpe_HTML\Project1\deploy\SimpleHTML.war' to 't3://dupe:7031'
[04:41:01 PM] #### Deployment incomplete. ####
[04:41:01 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
- The Application Server connection is accessible within JDev. 'dupe' is my server name and it's running RH 5.4
- Any help or suggestions appreciated, although I've already asked Mr. Google without success.
Thanks in advance,
NevilleHTTP response code 502 means temporarily overloaded.
I would say that we have to check the deployment error on the weblogic server logs located at <Domain_Home>\servers\dupe\logs\dupe.log
Check for any errors like OutOfMemory etc OR any deployment failures.
If possible, try accessing the console at http://dupe:7031/console
Check if you are able to successfully deploy your application using the console.
From the error it looks like the "dupe" server might not be healthy. So, the log file would really help here to get clues into the root cause.
Arun -
Hi there can you help with this error code Oxc5d1281
I refilled the HP cartridges in my Photosmart C 7250 All-in-One and put them in and got this error. I have D/C power,etc and it still comes up with this error code. Now what?
Cheers,
British_ehHi british_eh
You could try resetting the printer, details here
Note though that the reliability of refills tends not be as good as originals, links below FYI.....
http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00853819&cc=us&dlc=en&lc=en&jumpid=reg_R1002_US...
http://www.qualitylogic.com/2009HPinktest.pdf
Kind Regards, Ciara
Although I am an HP employee, I am speaking for myself and not for HP.
Twitter: @Ciara_B_HP -
Need help with adjusting Javascript code to work in Adobe Edge (Countdown)
Hello
Im a newbie when it comes to working with Javascript and Adobe Edge and need a bit of help with adjusting some javascript code to work with Adobe Edge. A friend of mine helped me with making this javascript code: Edit fiddle - JSFiddle
Its a simple countdown which counts down to a certain time at a certain date. What I aim to do is to add this code as a trigger on a text-element called "countdown" (within a symbol called "count").
I have tried to do this as the code is, but it does not work. Anyone have any suggestions?
Thanks!
Mvh,
Øyvind HermansHello again
I have stumbled upon a problem with these animations; They crash the browser after viewing them a little while, usually less than 30 seconds in.
Is this problem also occuring when you watch the animations?
Is the countdown-code to much for the browsers to handle?
Thanks in advance for your answers.
Sincerely,
Øyvind Hermans -
Need Help With Simple ABAP Code
Hello,
I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
Logic:-
Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
/BIC/ZOCREFNUM = ZOCREFNUM in Infocube
2. Need to populate 0G_CWWTER field in Infocube:
Logic:
Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
then G_CWWTER = 0G_CWWTER in Infocube.
I would need to read single row at a time.
Thanks!I resolved it.
-
Would like help with treeset ,the codes that using for sorting, please ?
hi every body. i faced a problem while writing this program, everything worked properly except this one. The program is related to Jframe and it asks the user to add three labels , three text field , one text area and three Jbuttons which are add sort and exit. i could deal with add and exit but sort, i couldn't do it properly because i don't know the codes that should be added in actionperfomed?
These codes are :
package gui;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JTextArea;
import sun.misc.Sort;
import domain.Student;
public class StudentFrame extends JFrame {
* This method initializes btnAdd
* @return javax.swing.JButton
private JButton getBtnAdd() {
if (btnAdd == null) {
btnAdd = new JButton();
btnAdd.setBounds(new Rectangle(13, 135, 59, 27));
btnAdd.setText("Add");
btnAdd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
btnAddClicked(); // TODO Auto-generated Event stub actionPerformed()
return btnAdd;
protected void btnAddClicked() {
// TODO Auto-generated method stub
String name = txtName.getText();
String id = txtID.getText();
String age = txtAge.getText();
Student s = new Student(name , id , age);
txtArea.setText(String.valueOf(s ));
* This method initializes btnSort
* @return javax.swing.JButton
private JButton getBtnSort() {
if (btnSort == null) {
btnSort = new JButton();
btnSort.setBounds(new Rectangle(95, 136, 62, 25));
btnSort.setText("Sort");
btnSort.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
btnSortClicked(); // TODO Auto-generated Event stub actionPerformed()
return btnSort;
protected void btnSortClicked() {
// TODO Auto-generated method stub
* This method initializes btnExit
* @return javax.swing.JButton
private JButton getBtnExit() {
if (btnExit == null) {
btnExit = new JButton();
btnExit.setBounds(new Rectangle(173, 134, 61, 23));
btnExit.setText("Exit");
btnExit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
System.exit(0); // TODO Auto-generated Event stub actionPerformed()
return btnExit;
* This method initializes txtName
* @return javax.swing.JTextField
private JTextField getTxtName() {
if (txtName == null) {
txtName = new JTextField();
txtName.setBounds(new Rectangle(79, 11, 60, 23));
return txtName;
* This method initializes txtID
* @return javax.swing.JTextField
private JTextField getTxtID() {
if (txtID == null) {
txtID = new JTextField();
txtID.setBounds(new Rectangle(73, 55, 65, 26));
return txtID;
* This method initializes txtAge
* @return javax.swing.JTextField
private JTextField getTxtAge() {
if (txtAge == null) {
txtAge = new JTextField();
txtAge.setBounds(new Rectangle(74, 96, 61, 24));
return txtAge;
* This method initializes txtArea
* @return javax.swing.JTextArea
private JTextArea getTxtArea() {
if (txtArea == null) {
txtArea = new JTextArea();
txtArea.setBounds(new Rectangle(138, 5, 154, 128));
return txtArea;
* @param args
public static void main(String[] args) {
// TODO Auto-generated method stub
SwingUtilities.invokeLater(new Runnable() {
public void run() {
StudentFrame thisClass = new StudentFrame();
thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
thisClass.setVisible(true);
* This is the default constructor
public StudentFrame() {
super();
initialize();
* This method initializes this
* @return void
private void initialize() {
this.setSize(300, 200);
this.setContentPane(getJContentPane());
this.setTitle("JFrame");
return jContentPane;
}Edited by: hypocrisy on Apr 26, 2009 6:51 PMThere are three actionPerformed in that program.One for add Jbutton , Sort , and Exit
the codes that i have added for add button after action performed are
String name = txtName.getText();
String id = txtID.getText();
String age = txtAge.getText();
Student s = new Student ( name , id , age);
System.out.println(s);
the codes for Exit button to make it works properly was :
System.out.println(0);
But when i came to Sort Button and i tried to enter many codes but it didn't sort properly so would you like to help me with the right codes :) -
Help with basic ABAP code (merge internal tables, sort of...)
Hello,
Can someone please help write some basic code for a Basis guy with limited ABAP knowledge?
Should be some easy points for an experienced ABAPer!
I have identicaly structured internal tables I_A and I_B and I_C which have already been filled by function models I called.
How will I code the following?:
I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
Then I want to read I_B and:
1)Update I_MASTER with NEW records
2)Update existing records if the value of field MYFIELD in I_B is smaller than the value of MYFIELD in I_MASTER.
Then I want to read I_C and:
1)Update I_MASTER with NEW records
2)Update existing records if the value of field MYFIELD in I_C is smaller than the value of MYFIELD in I_MASTER.
Let me know if I can provide anymore information.
Thanks in advance for you help!
Adriaan
Message was edited by: Adriaan
Message was edited by: AdriaanHi Adriaan ,
I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
<b>i_master[] = i_a[] .</b>
loop at i_b .
read table i_master with key myfiled < i_b-myfield .
if sy-subrc = 0 .
append i_master from i_b .
endif.
endloop.
loop at i_c .
read table i_master with key myfiled < i_c-myfield .
if sy-subrc = 0 .
append i_master from i_c .
endif.
endloop.
Let me know if this helped .
Regards,
Varun .
Message was edited by: varun sonu -
Hello, I am new to java and I need a bit of help with some code that I'm writing. here is the code:
import javax.swing.*;
public class Test{
public static void main(String[] args){
JOptionPane.showMessageDialog(null,"We will now build a block with *'s","Block",1);
String input=JOptionPane.showInputDialog(null,"Type a number: ","Number",3);
int number=Integer.parseInt(input);
int count=0; int count2=0;
for(count2=0; count2<number; count2++){
for(count=0; count<number; count++){
System.out.print("* ");
System.exit(0);
}Now, all I need is to build a block of *'s with the number that the user inputs. With the code that I wrote I get the correct number of *'s but not in the form of a block. They just print out in a straight line. I know this is a very simple task but could someone please help me out? What do I need to modify in my code so that the *'s print out arranged as a block like so:
**********Your code only uses the print method which prints without a carriage return/line feed. So you need to add a line of code to print a carriage return/line feed. Where? well that is your task to work out.
-
I just purchased a 7290 that was supposed to be unlocked (apparently it is refurbished). It came from cingular originally. My carrier can't unlock it to work with their system. Can anyone help me with free unlock codes?
Only your carrier can provide free unlock codes.
If you contact Horizon below in my signature, they do so cheaply and reliably.
1. If any post helps you please click the below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!
3. Install free BlackBerry Protect today for backups of contacts and data.
4. Guide to Unlocking your BlackBerry & Unlock Codes
Join our BBM Channels (Beta)
BlackBerry Support Forums Channel
PIN: C0001B7B4 Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA Display/Scan Bar Code -
Update-Help cmdlet not able to update the help with https protocol.
Hi all,
I am using powershell 3.0 and trying to implement this updatable feature for our custom powershell module. But I getting the below error:
PS C:\Users\scorchsvc> update-help -Module <modulename> -Force
update-help : Failed to update Help for the module(s) 'modulename' : HelpInfoURI
https://10.65.182.141/dev_releases/modulename/onlinehelp does not start with http.
At line:1 char:1
+ update-help -Module modulename-Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (HelpInfoUri:Uri) [Update-Help], Exception
+ FullyQualifiedErrorId : InvalidHelpInfoUriFormat,Microsoft.PowerShell.Commands.UpdateHelpCommand
I am able to get this work if I use "http". Error message clearly says that it only expects http. But in the Microsoft help topic for Update-Help cmdlet, it is mentioned that cmdlet works for both http and https both.
Here are my enteries:
•HelpInforURI entry in module manifest file is:
HelpInfoURI = "https://10.65.182.141/dev_releases/modulename/onlinehelp"
•HelpContentURI in HelpInfo.xml file is:
<HelpContentURI> https://10.65.182.141/dev_releases/modulename/onlinehelp </HelpContentURI>
I am running powershell as an administrator.
I am not behind any proxy.
Windows firewall is off.
I am mentioning it AGAIN that I am ABLE to update help for our custom module if I use http in HelpInfoURI.
I am also able to access the URI in IE with http/https.
Can any one please help?
Thanks,
Vinay RavishHi vinay,
It seems the certificate issue.
Please access HelpInfoURI =
https://10.65.182.141/dev_releases/modulename/onlinehelp with https header to see if your computer could access that.
If it doesn't work, add it to your trusted site and download to see if there is related certification on that website to download and install it to trusted root certificate for test.
Karen Hu
TechNet Community Support
Maybe you are looking for
-
How to run and displaying output of java file in jsp page ???
Hai, I am going to develop a website which would have everything about java. Example code displayed for all methods.Next to every Example i shoud have *"Run"* button. Click at Run button should compile the example and show the output or even error. E
-
Connect report output to third party systen
Dear Techis Can we connect Report output to third party system and hw? Pls advice............
-
Extend VTextField to dynamically underline font
Rather than use the Hyperlink bean (because it's pretty slow to load), I have taken the concepts in the ModCursor demo and built a simple class that extends VTextField, providing for the traditional webpage look of a hyperlink: the hand cursor, rollo
-
Alright, I am wanting to make certain movie clips visible if the _root.variable equals 'i'. The dynamic text has a instance name on it, but am I using it correctly? for( var i=1; i<=6; i++) if(_root.element_fire == i) { ('fire_'+i+'_text')._visible =
-
I live in a multi lingual country (german, french, italian, romanche) and all I get when I search for Audiobooks is german. Can anyone help me to have a least french showing or even better english?? PLEASE