Jump to ID:
  Project: iheprofiles  [Show Path]

Project Home

Tracker

Documents

Source Code

Discussions

Reports

File Releases

Wiki

Project Info
Forum Topic - Error where sending a document on the repository: (7 Items)
View:  as 
 
 
Error where sending a document on the repository
Hi !

I'm trying to send a document on my repository using org.openhealthtools.ihe.xds, but I get the following error : 

ERROR - An error occurred while sending the Provide And Register Document Set Request.
        at org.openhealthtools.ihe.xds.source.B_Source.submit(B_Source.java:93)
org.openhealthtools.ihe.common.ws.IHESOAPException: A SOAP Fault occurred during message transmission.  [Caused by org.
apache.axis2.AxisFault: Transport error: 301 Error: Moved Permanently]


I can access my repository url via my web browser.

Does someone know what I did wrong ?


Here is my code :

// création de l'objet transaction qui servira par la suite
SubmitTransactionData txnData = new SubmitTransactionData();

// création du document CDA à partir de l'url du fichier
XDSDocument clinicalDocument = new XDSDocumentFromFile(DocumentDescriptor.CDA_R2, urlDocument);

// ajout du document ainsi créé à la transaction
String docEntryUUID = txnData.addDocument(clinicalDocument);

 // récupération d'une partie des metadonnées du document pour les compléter
DocumentEntryType docEntry = txnData.getDocumentEntry(docEntryUUID);

// ajout de métadonnées concernant l'identifiant du patient
CX patientId = Hl7v2Factory.eINSTANCE.createCX();
            patientId.setIdNumber(patientIdNumber);
            patientId.setAssigningAuthorityUniversalId("1.3.6.1.4.1.21367.2005.1.1");
            patientId.setAssigningAuthorityUniversalIdType("ISO");
docEntry.setPatientId(patientId);

// récupération d'une autre partie des métadonnées du document pour les compléter
SubmissionSetType subset = txnData.getSubmissionSet();
CodedMetadataType contentTypeCode = MetadataFactory.eINSTANCE.createCodedMetadataType();

// ajout de métadonnées
            contentTypeCode.setCode("Consult");
// contentTypeCode.setDisplayName("Consult");
            subset.setContentTypeCode(contentTypeCode);

// définition de l'url du repository dans lequel on va envoyer le document
 URI repositoryUri = URI.create(repositoryUrl);
B_Source source = new B_Source(repositoryUri);

// définition de l'Audit Record Repository Address
 XDSSourceAuditor auditor = XDSSourceAuditor.getAuditor();
AuditorModuleConfig config = auditor.getConfig();
config.setAuditorEnabled(true);
            config.setAuditRepositoryUri(repositoryUri);

// définition du proxy
            System.setProperty("http.proxySet", "true");
            System.setProperty("http.proxyHost", proxyHost);
            System.setProperty("http.proxyPort", proxyPort);

// exécution de la requête pour envoyer le document vers le repository
XDSResponseType xdsresponsetype = source.submit(txnData);


Thanks for your help !
RE: Error where sending a document on the repository
The server you're connecting to is returning:
301 Error: Moved Permanently]

This means it's sending back an HTTP 301 response instead of 200.  I'm guessing you're using the wrong url to connect to
 it.

________________________________________
From: rme [rmeyer.ext@orange-ftgroup.com]
Sent: Monday, March 01, 2010 6:28 AM
To: users@iheprofiles.projects.openhealthtools.org
Subject: Error where sending a document on the repository

Hi !

I'm trying to send a document on my repository using org.openhealthtools.ihe.xds, but I get the following error :

ERROR - An error occurred while sending the Provide And Register Document Set Request.
        at org.openhealthtools.ihe.xds.source.B_Source.submit(B_Source.java:93)
org.openhealthtools.ihe.common.ws.IHESOAPException: A SOAP Fault occurred during message transmission.  [Caused by org.
apache.axis2.AxisFault: Transport error: 301 Error: Moved Permanently]


I can access my repository url via my web browser.

Does someone know what I did wrong ?


Here is my code :

// création de l'objet transaction qui servira par la suite
SubmitTransactionData txnData = new SubmitTransactionData();

// création du document CDA à partir de l'url du fichier
XDSDocument clinicalDocument = new XDSDocumentFromFile(DocumentDescriptor.CDA_R2, urlDocument);

// ajout du document ainsi créé à la transaction
String docEntryUUID = txnData.addDocument(clinicalDocument);

 // récupération d'une partie des metadonnées du document pour les compléter
DocumentEntryType docEntry = txnData.getDocumentEntry(docEntryUUID);

// ajout de métadonnées concernant l'identifiant du patient
CX patientId = Hl7v2Factory.eINSTANCE.createCX();
            patientId.setIdNumber(patientIdNumber);
            patientId.setAssigningAuthorityUniversalId("1.3.6.1.4.1.21367.2005.1.1");
            patientId.setAssigningAuthorityUniversalIdType("ISO");
docEntry.setPatientId(patientId);

// récupération d'une autre partie des métadonnées du document pour les compléter
SubmissionSetType subset = txnData.getSubmissionSet();
CodedMetadataType contentTypeCode = MetadataFactory.eINSTANCE.createCodedMetadataType();

// ajout de métadonnées
            contentTypeCode.setCode("Consult");
// contentTypeCode.setDisplayName("Consult");
            subset.setContentTypeCode(contentTypeCode);

// définition de l'url du repository dans lequel on va envoyer le document
 URI repositoryUri = URI.create(repositoryUrl);
B_Source source = new B_Source(repositoryUri);

// définition de l'Audit Record Repository Address
 XDSSourceAuditor auditor = XDSSourceAuditor.getAuditor();
AuditorModuleConfig config = auditor.getConfig();
config.setAuditorEnabled(true);
            config.setAuditRepositoryUri(repositoryUri);

// définition du proxy
            System.setProperty("http.proxySet", "true");
            System.setProperty("http.proxyHost", proxyHost);
            System.setProperty("http.proxyPort", proxyPort);

// exécution de la requête pour envoyer le document vers le repository
XDSResponseType xdsresponsetype = source.submit(txnData);


Thanks for your help !

------------------------------------------------------
https://iheprofiles.projects.openhealthtools.org/ds/viewMessage.do?dsForumId=212&dsMessageId=14122
RE: Error where sending a document on the repository
Thanks for your answer !
It is very strange, because when using the same url in a web browser, it works. Maybe is there something to do on the 
server, but I don't know what ...
RE: Error where sending a document on the repository
It is likely that your browser is following the 301 redirect and just displaying the resulting page that the server is 
directing you to, while the oht client is getting the redirect and just telling you that's a problem (you don't want it 
to redirect all the time anyway).  Does the browser end up displaying a different url in the address bar?  

Use Wireshark or some other network trace from your client to the server.  filter on the port like this:
tcp port 8080

Assuming 8080 is the port.  Then issue the url from the browser and then from the client.  I'm guessing you'll see 
what's wrong at that point.  The server is telling you that that url is moved to another url when calling from the oht 
client, so there has to be some difference.  The network trace should illuminate the problem.  It'll probably tell you 
the url the browser is getting redirected to at least.

thanks,
Jesse

________________________________________
From: rme [rmeyer.ext@orange-ftgroup.com]
Sent: Monday, March 01, 2010 7:17 AM
To: users@iheprofiles.projects.openhealthtools.org
Subject: RE: Error where sending a document on the repository

Thanks for your answer !
It is very strange, because when using the same url in a web browser, it works. Maybe is there something to do on the 
server, but I don't know what ...

------------------------------------------------------
https://iheprofiles.projects.openhealthtools.org/ds/viewMessage.do?dsForumId=212&dsMessageId=14124
RE: Error where sending a document on the repository
Hi Jesse,

Thank you very much for your help !
I used wireshark as you told me, and the only difference was that the browser made a "GET" request whereas the client 
made a "POST". In fact, the problem came from the rights on my "repository" directory (I could read but not write ...). 
Yet, the rights are ok. But ... there is another problem :


org.openhealthtools.ihe.common.ws.IHESOAPException: A SOAP Fault occurred during message transmission.  [Caused by org.
apache.axis2.AxisFault: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]]
        at org.openhealthtools.ihe.common.ws.AbstractIHESOAPSender.executeSend(AbstractIHESOAPSender.java:351)
        at org.openhealthtools.ihe.common.ws.AbstractIHESOAPSender.send(AbstractIHESOAPSender.java:482)
        at org.openhealthtools.ihe.xds.soap.AbstractXDSSoapClient.send(AbstractXDSSoapClient.java:219)
        at org.openhealthtools.ihe.xds.source.AbstractSource.submit(AbstractSource.java:191)
        at org.openhealthtools.ihe.xds.source.B_Source.submit(B_Source.java:93)
        at org.openhealthtools.ihe.xds.source.B_Source.submit(B_Source.java:82)
        at testoht.MyXDSManager.putDocument(MyXDSManager.java:104)
        at testoht.Main.main(Main.java:28)



Do you know what does it mean ?
RE: Error where sending a document on the repository
Sarah, any idea on this "Unexpected EOF in prolog"?  I don't really know the answer myself for sure but I'd guess you 
have some characters in your message before your XML starts.  Hopefully Sarah will have a better answer, but my first 
step would be to use a stepping debugger and make sure that in the document you're submitting that the very first 
character is "<".

Try googling "com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog", it's likely you'll find some tips.  I have 
not done that myself, the above is just a guess.

-----Original Message-----
From: rme [mailto:rmeyer.ext@orange-ftgroup.com] 
Sent: Tuesday, March 02, 2010 7:27 AM
To: users@iheprofiles.projects.openhealthtools.org
Subject: RE: Error where sending a document on the repository

Hi Jesse,

Thank you very much for your help !
I used wireshark as you told me, and the only difference was that the browser made a "GET" request whereas the client 
made a "POST". In fact, the problem came from the rights on my "repository" directory (I could read but not write ...). 
Yet, the rights are ok. But ... there is another problem :


org.openhealthtools.ihe.common.ws.IHESOAPException: A SOAP Fault occurred during message transmission.  [Caused by org.
apache.axis2.AxisFault: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]]
        at org.openhealthtools.ihe.common.ws.AbstractIHESOAPSender.executeSend(AbstractIHESOAPSender.java:351)
        at org.openhealthtools.ihe.common.ws.AbstractIHESOAPSender.send(AbstractIHESOAPSender.java:482)
        at org.openhealthtools.ihe.xds.soap.AbstractXDSSoapClient.send(AbstractXDSSoapClient.java:219)
        at org.openhealthtools.ihe.xds.source.AbstractSource.submit(AbstractSource.java:191)
        at org.openhealthtools.ihe.xds.source.B_Source.submit(B_Source.java:93)
        at org.openhealthtools.ihe.xds.source.B_Source.submit(B_Source.java:82)
        at testoht.MyXDSManager.putDocument(MyXDSManager.java:104)
        at testoht.Main.main(Main.java:28)



Do you know what does it mean ?

------------------------------------------------------
https://iheprofiles.projects.openhealthtools.org/ds/viewMessage.do?dsForumId=212&dsMessageId=14164
RE: Error where sending a document on the repository
My guess is some bad XML document being submitted ... same as Jesse.

Sarah Knoop

Healthcare Systems Research Manager
IBM Almaden Research Center





From:
Jesse Pangburn <jesse.pangburn@us.lawson.com>
To:
users@iheprofiles.projects.openhealthtools.org
Date:
03/02/2010 03:35 PM
Subject:
RE: Error where sending a document on the repository



Sarah, any idea on this "Unexpected EOF in prolog"?  I don't really know 
the answer myself for sure but I'd guess you have some characters in your 
message before your XML starts.  Hopefully Sarah will have a better 
answer, but my first step would be to use a stepping debugger and make 
sure that in the document you're submitting that the very first character 
is "<".

Try googling "com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in 
prolog", it's likely you'll find some tips.  I have not done that myself, 
the above is just a guess.

-----Original Message-----
From: rme [mailto:rmeyer.ext@orange-ftgroup.com] 
Sent: Tuesday, March 02, 2010 7:27 AM
To: users@iheprofiles.projects.openhealthtools.org
Subject: RE: Error where sending a document on the repository

Hi Jesse,

Thank you very much for your help !
I used wireshark as you told me, and the only difference was that the 
browser made a "GET" request whereas the client made a "POST". In fact, 
the problem came from the rights on my "repository" directory (I could 
read but not write ...). Yet, the rights are ok. But ... there is another 
problem :


org.openhealthtools.ihe.common.ws.IHESOAPException: A SOAP Fault occurred 
during message transmission.  [Caused by org.apache.axis2.AxisFault: 
com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]]
        at 
org.openhealthtools.ihe.common.ws.AbstractIHESOAPSender.executeSend(AbstractIHESOAPSender.java:351)
        at 
org.openhealthtools.ihe.common.ws.AbstractIHESOAPSender.send(AbstractIHESOAPSender.java:482)
        at 
org.openhealthtools.ihe.xds.soap.AbstractXDSSoapClient.send(AbstractXDSSoapClient.java:219)
        at 
org.openhealthtools.ihe.xds.source.AbstractSource.submit(AbstractSource.java:191)
        at 
org.openhealthtools.ihe.xds.source.B_Source.submit(B_Source.java:93)
        at 
org.openhealthtools.ihe.xds.source.B_Source.submit(B_Source.java:82)
        at testoht.MyXDSManager.putDocument(MyXDSManager.java:104)
        at testoht.Main.main(Main.java:28)



Do you know what does it mean ?

------------------------------------------------------
https://iheprofiles.projects.openhealthtools.org/ds/viewMessage.do?dsForumId=212&dsMessageId=14164


------------------------------------------------------
https://iheprofiles.projects.openhealthtools.org/ds/viewMessage.do?dsForumId=212&dsMessageId=14203
Attachment: attachment-18213 4.24 KB