Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

The request failed with HTTP status 401: Non-Autorisé.

Avatar

Level 2

i create a process in workbench

i callit via a soap in my dotnet project with this url :

http://name_serveur: port/soap/services/Name_process?wsdl

when i add this as a web reference it runs ok.

for invoking it i write this :

ProcessService

essaiOutput = new ProcessService();

essaiOutput.invoke(

"c:\\creerPdf", "BonCmdeDynamiq.xdp",out outResult,out generatePDFOutputResultDoc);

but when i execute it on a browser i have an error :

the request failed with http status 401 : non autorisé

is anybody know what is the problem?

7 Replies

Avatar

Level 10

You need to change some setting of your service.

See the attached screenshot shows the step by step tasks to be done in the adminui.

Settings are:

Require Callers to Authenticate = No

Specify Run As = System

This should work.

Nith

Avatar

Level 8

Non-Autorisé. - my French is pretty bad, but doesn't that mean "Not authorized"?

LiveCycle services are secured by default. You can remove the server side security (as Nith suggests) - but you'll need to do that for EVERY service you call and all of the operations that service calls.  Also you administrator may not be happy about disabling security :-)

To call it securly, you'll need to set the username and password using a System.Net.NetworkCredential object in your .Net code.

Avatar

Level 2

thanks a lot

finally i have found that i forget to configure my service so now i don't have this error. But i have an other problem..

in my process workbench,for the operation generatePdfOutput i don't know how to define the variable input data :

if  i set :

- input data= variable string input required and i write in the invoke méthode process.invoke("filename","c:\data.xml",....)

i have the error :  The Long Lived Service EssaiOutput can not be invoked synchronously.

or

-input data =  variable xml with xml schema that i provide, but in this case i don't know how to link with my xml file, i try to put this variable to input and write in my code in my project dotnet

WebReference.XML inXml =

new XML();

inXml.document =

"C:\\creerPdf\\PurchaseOrder.xml"

after that i put inXml in the parameter of my method but it doesn't run i have this error

org.xml.sax.SAXParseException: Content is not allowed in prolog

can you drive me to a better solution??

Avatar

Level 8

If I remember right the XML data parameter isn't looking for the filename of the XML data, but it is the data (in a string) itself. The " Content is not allowed in prolog" message means - "this is not valid XML".  In your .net application, read in the XML into a string variable and then pass that variable to the LiveCycle server (rather than the path to the file)

Avatar

Level 2

ok i change my mind : i set input data as a vriable document

and i do that :

BLOB inData = new BLOB();

String inPutFile = "C:\\creerPdf\\PurchaseOrder.xml";

FileStream fs = new FileStream(inPutFile, FileMode.Open);

int longueur = (int)fs.Length;

Byte[] byteArray = new byte[longueur];

fs.Read(byteArray, 0, longueur);

inData.binaryData = byteArray;

and i put indata in the parameter of my invoke methode

and as usual i have an error again this :

System.InvalidOperationException: Response is not well-formed XML. ---> System.Xml.XmlException: There is an unclosed literal string. Line 3, position 64366.

so i look in my xml file but to my mind there is no error

i join with this message mine xml.file

if somoene could say me what it is wrong it would be wonderfull!!!

thanks

Avatar

Level 8

The LiveCycle log is usually more verbose about the actual error than the SOAP error.  Can you access your LC server and see what that error log is saying?

Avatar

Level 2

thanks hodmi your answer help me very much.

in fact my problem is that i don't configure correctly my operation generatePdfOutput in my process, specially the paramètre.

actually when i call the invoke method render nothing in the output parameter :

generatePDFOutputResultDoc and outResult.

i invoke my process like that :

generatePDFOutputMetaDataDoc =

essaiOutput.invoke(

"c:\\creerPdf", inData, "BonCmdeDynamiq.xdp", out outResult, out generatePDFOutputResultDoc);

with indata, outResult, generatePDFOutputResultDoc as blob

in my process i configure the generatePDFOutput operation like that :

INPUT

          transformationformat : PDF

          Form(variable) : FormName(string, input, required)

          ContentRoot(variable): CheminForm(string, input, required)

PDFOutputOption(LiteralValue)

          General :

                         xci uri : empty

                         character set : empty

                         locale : empty

          Batch :

                         recordName : purchaseOrder

                         recordLevel : -1

                         Generate MultipleStream : true

          Rules :

                         patternMatchSize : 500

          Destination :

                         all is empty in this part.

          MetaData :

                         Metadatafilespec : empty

                         RecordId Xpath : empty

                         GenerateRecordLevelMetaData : false

Render Option(Litteral value) :

          Acrobat & PDFVersion : auto

          TagedPdf : false

          linearized pdf : false

          RenderatClient : auto

          DebugEnabled : false

OutPut:

          PDFOutput(variable) : PdfOut (document, output)

          MetaDataDocument(variable) : metaOutPut (document, output)

          OutPutResult(variable) : outResult (outputResult, output).

1. is anybody has got an idea of what is wrong in my config??

2. what is the parameter which can give me the number of pdf generate?

thanks for your help