# Entirex/Meidator

**URL:** <https://techcommunity.softwareag.com/t/entirex-meidator/58431>\
**Category:** Forum\
**Tags:** Former-Crossvision-Products, Service-Orchestrator\
**Created:** [December 30, 2002, 5:17pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431 "2002-12-30T17:17:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 5:17pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/1 "2002-12-30T17:17:07Z")

</div>

Hi Bill  
  
 I changed all that you have said,i changed these lines in java file  
  
\_url = (\_sequenceFile == null) ?  
 \_destinationURL:  
  
 \_destinationURL + “?” + SEQUENCER\_PROPERTY + “=” + \_sequenceFile;  
  
  
  
and sequence fie  
transformsequence.xml as u said  
  
  
 \< !–{Name: step};{Notes: }–\>  
  
  
  
  
  
  
i am getting error 500  
java.io.IOException: Server returned HTTP response code: 500 for URL: [http://loc](http://loc)  
alhost:8080/orchestrator/OrchestratorGateway?xbd.sequence.uri=[http://localhost:8](http://localhost:8)  
080/orchestrator/samples/data/transformsequence.xml  
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon  
nection.java:691)  
 at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLCon  
nection.java:1116)  
 at java.net.URLConnection.getContentType(URLConnection.java:381)  
 at MediatorUtility.httpReceive(MediatorUtility.java:190)  
 at MediatorUtility.getResultsFromMediator(MediatorUtility.java:119)  
 at MediatorUtility.main(MediatorUtility.java:231)  
httpReceive: java.io.IOException: Server returned HTTP response code: 500 for UR  
L: [http://localhost:8080/orchestrator/OrchestratorGateway?xbd.sequence.uri=http:](http://localhost:8080/orchestrator/OrchestratorGateway?xbd.sequence.uri=http:)  
[//localhost:8080/orchestrator/samples/data/transformsequence.xml](https://localhost:8080/orchestrator/samples/data/transformsequence.xml)  
Error! [http://localhost:8080/orchestrator/OrchestratorGateway?xbd.sequence.uri=h](http://localhost:8080/orchestrator/OrchestratorGateway?xbd.sequence.uri=h)  
ttp://localhost:8080/orchestrator/samples/data/transformsequence.xml: [java.io.IO](http://java.io.IO)  
Exception: Server returned HTTP response code: 500 for URL: [http://localhost:808](http://localhost:808)  
0/orchestrator/OrchestratorGateway?xbd.sequence.uri=[http://localhost:8080/orches](http://localhost:8080/orches)  
trator/samples/data/transformsequence.xml  
\*\*\*\*\*\*\*\*\*\* done \*\*\*\*\*\*\*\*\*\*

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 5:34pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/2 "2002-12-30T17:34:55Z")

</div>

First can you please continue a thread rather than starting a new one (just hit Post Reply at the bottom of the page)… but don’t worry about that for now.  
  
Second you seem to have changed your sequence xml file so that the stylesheet location is the same physical file as the sequence file. Please change it to the value I showed you in my original post:  
  
  
and then make sure that the files item1.xsl and transformsequence.xml are both in the same filesystem location (folder).  
  
If you work carefully through my previous reply I’m sure it will work, but if it still fails, please tell us what output do you have in your Component Factory window when you attempt to run your utility (please cut and paste it in reply to this message).  
  
Thanks.  
  
[This message was edited by Bill Leeney on 30 Dec 2002 at 12:14.]

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 5:46pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/3 "2002-12-30T17:46:31Z")

</div>

Hi Bill  
The error in tomcat is  
  
 \*\*\*\*\*\*\*\* Servlet name \<\>  
  
2002-12-30 17:49:12 - Ctx( /orchestrator ): 404 R( /orchestrator + /samples/data  
/transformsequece.xml + null) null  
2002-12-30 17:49:12 - Ctx( /orchestrator ): 500 R( /orchestrator + /Orchestrator  
Gateway + null) No on\_error sequence found, simulating “reply”  
2002-12-30 17:49:12 - Ctx( /orchestrator ): 404 R( /orchestrator + /samples/data  
/transformsequence.xml + null) null  
2002-12-30 17:49:12 - Ctx( /orchestrator ): 500 R( /orchestrator + /Orchestrator  
Gateway + null) No on\_error sequence found, simulating “reply”  
  
  
  
The Error in component Factory  
  
2002-12-30 17:49:12,785 ERROR - Error getting sequence=[http://localhost:8080/orc](http://localhost:8080/orc)  
hestrator/samples/data/transformsequece.xml  
com.softwareag.xbridge.exceptions.DocumentParseException: com.softwareag.xbridge  
.exceptions.DocumentParseException com.softwareag.xbridge.exceptions.DocumentPar  
seException Document parse exception detected ERROR error at line number 0: File  
 “[http://localhost:8080/orchestrator/samples/data/transformsequece.xml](http://localhost:8080/orchestrator/samples/data/transformsequece.xml)” not foun  
d.  
 at com.softwareag.xbridge.util.DocumentParser.parse(DocumentParser.java:  
165)  
 at com.softwareag.xbridge.sequencer.SequencerResource.resolve(SequencerR  
esource.java:103)  
 at com.softwareag.xbridge.sequencer.SequencerResource.(SequencerRe  
source.java:93)  
 at com.softwareag.xbridge.sequencer.SequencerResource.getInstance(Sequen  
cerResource.java:156)  
 at com.softwareag.xbridge.sequencer.SequencerResource.getResource(Sequen  
cerResource.java:198)  
 at com.softwareag.xbridge.sequencer.SequencerResource.getResource(Sequen  
cerResource.java:172)  
 at com.softwareag.xbridge.sequencer.SequencerImpl.getElementToExecute(Se  
quencerImpl.java:218)  
 at com.softwareag.xbridge.sequencer.SequencerImpl.dispatch(SequencerImpl  
.java:121)  
 at com.softwareag.xbridge.infrastructure.DispatcherImpl$MessageDispatche  
r.perform(DispatcherImpl.java:214)  
 at com.softwareag.xbridge.util.WorkerThread.run(ThreadPool.java:365)  
2002-12-30 17:49:12,885 ERROR - Error getting sequence=[http://localhost:8080/orc](http://localhost:8080/orc)  
hestrator/samples/data/transformsequence.xml  
com.softwareag.xbridge.exceptions.DocumentParseException: com.softwareag.xbridge  
.exceptions.DocumentParseException com.softwareag.xbridge.exceptions.DocumentPar  
seException Document parse exception detected ERROR error at line number 0: File  
 “[http://localhost:8080/orchestrator/samples/data/transformsequence.xml](http://localhost:8080/orchestrator/samples/data/transformsequence.xml)” not fou  
nd.  
 at com.softwareag.xbridge.util.DocumentParser.parse(DocumentParser.java:  
165)  
 at com.softwareag.xbridge.sequencer.SequencerResource.resolve(SequencerR  
esource.java:103)  
 at com.softwareag.xbridge.sequencer.SequencerResource.(SequencerRe  
source.java:93)  
 at com.softwareag.xbridge.sequencer.SequencerResource.getInstance(Sequen  
cerResource.java:156)  
 at com.softwareag.xbridge.sequencer.SequencerResource.getResource(Sequen  
cerResource.java:198)  
 at com.softwareag.xbridge.sequencer.SequencerResource.getResource(Sequen  
cerResource.java:172)  
 at com.softwareag.xbridge.sequencer.SequencerImpl.getElementToExecute(Se  
quencerImpl.java:218)  
 at com.softwareag.xbridge.sequencer.SequencerImpl.dispatch(SequencerImpl  
.java:121)  
 at com.softwareag.xbridge.infrastructure.DispatcherImpl$MessageDispatche  
r.perform(DispatcherImpl.java:214)  
 at com.softwareag.xbridge.util.WorkerThread.run(ThreadPool.java:365)

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 5:56pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/4 "2002-12-30T17:56:12Z")

</div>

So you can see from the error in the Factory window that your code is still trying to load “transformsequece.xml”:

```auto
2002-12-30 17:49:12,785 ERROR - Error getting sequence=http://localhost:8080/orc
hestrator/samples/data/transformsequece.xml
```

Have you really corrected and recompiled your code? If so I can only suggest you restart the Factory and Tomcat and try again…

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 6:04pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/5 "2002-12-30T18:04:33Z")

</div>

BBill,  
  
I compiled my code properly,i verified it again  
when u see little down in the error which i had send u will find transformsequence.xml also  
  
  
import java.io.BufferedReader;  
import java.io.ByteArrayOutputStream;  
import java.io.InputStreamReader;  
import java.io.InputStream;  
import java.io.IOException;  
import java.net.URL;  
import java.net.MalformedURLException;  
import java.util.Vector;  
import java.util.Enumeration;  
import java.net.HttpURLConnection;  
import java.net.ProtocolException;  
  
/  
 **\* The MediatorUtility class is used to  
 \* post requests to mediator and recieve response  
 \***

**\*/  
public class MediatorUtility  
{  
 //need to remove hardcoded values**  
  
 **final static String HTTP\_PROTOCOL = “http:”;  
 final static String ORCHESTRATOR\_NAME = “orchestrator”;  
 final static String XBRIDGE\_WEB = “xbridge.web”;  
 final static String PORTAL\_SERVLET = “portal.servlet”;  
 final static String TYPE\_TEXT\_XML = “text/xml”;  
 final static String S\_CONTENT\_TYPE = “Content-Type”;  
 final static String S\_SLASH = “/”;  
 final static String TYPE\_APPLICATION\_XML = “application/xml”;  
 final static String SEQUENCER\_PROPERTY = “xbd.sequence.uri”;  
 static final String DEFAULT\_XBRIDGE\_WEB = “default\_xbridge.web”;  
 static final String DEFAULT\_PORTAL\_SERVLET = “default\_portal.servlet”;**  
  
 **static String \_destinationURL = null;  
 static byte[] \_dataArray = null;  
 static String \_url = null;  
 static String \_sequenceFile = null;**  
  
 **/**  
 \* getResultsFromMediator will send the input XML and sequence file to the specified servlet passed through the  
 \* system property, portal.servlet. The default servlet is  
 \* OrchestratorGateway. If the servlet is OrchestratorGateway,  
 \* an additional argument, the URL format of sequence file will  
 \* be required.  
 \* Note that the MediatorUtility only support the “POST” method.  
  
_/  
 public static byte[] getResultsFromMediator(String argSequenceFile, String argInputXML)throws Exception{_  
  
 _HttpURLConnection \_httpConnection = null;  
 // use System.getProperty to figure out where the xbridge web is  
 // and what the portal servlet is_  
  
 _String xbridgeWeb = System.getProperty (XBRIDGE\_WEB, “[//localhost:8080/orchestrator](https://localhost:8080/orchestrator)”);  
 String portalServlet = System.getProperty (PORTAL\_SERVLET, “OrchestratorGateway”);_  
  
 _\_sequenceFile=argSequenceFile;  
 // get the destination URL_  
  
 _\_destinationURL = HTTP\_PROTOCOL + xbridgeWeb + S\_SLASH + portalServlet;  
 //\_destinationURL =“[http://localhost:8080/orchestrator/OrchestratorGateway](http://localhost:8080/orchestrator/OrchestratorGateway)”;  
 //OrchestratorGateway";  
 //OrchestratorGateway";_  
  
 _\_dataArray=argInputXML.getBytes();_  
  
 _// get the URL for HTTP protocol  
 \_url = (\_sequenceFile == null) ?  
 \_destinationURL:_  
  
 _\_destinationURL + “?” + SEQUENCER\_PROPERTY + “=” + \_sequenceFile;  
 System.out.println("URL: " + \_url);_  
  
 _// get the HTTP URL  
 URL httpURL = null;  
 try {  
 httpURL = new URL(\_url);  
 } catch(MalformedURLException e) {  
 System.out.println("new URL: " + \_url + e.toString());  
 //throw new MediatorConnectionException(e);  
 }_  
  
 _// open the HTTP URL connection  
 try {  
 \_httpConnection =(HttpURLConnection) httpURL.openConnection();  
 } catch(IOException e) {  
 System.out.println("Cannot open URL connection: " + e.toString());  
 //throw new MediatorConnectionException(e);  
 }_  
  
 _// mo caching of documents  
 \_httpConnection.setUseCaches(false);_  
  
 _// only support the “POST” method  
 try {  
 \_httpConnection.setRequestMethod(“POST”);  
 } catch(ProtocolException e) {  
 System.out.println(“setRquestMethod: " + e.toString());  
 }_  
  
 _// use the URL connection for output  
 \_httpConnection.setDoOutput(true);_  
  
 _// set the default value of a general request property  
 \_httpConnection.setRequestProperty(S\_CONTENT\_TYPE, TYPE\_TEXT\_XML);_  
  
 _// use the URL connection for input  
 \_httpConnection.setDoInput(true);_  
  
 _// send the document and receive the reply through the HTTP connection  
 int responseCode = 0;  
 byte[] rDataArray = null;  
 try{  
 httpSend(\_httpConnection);  
 System.out.println(“send was sucessfull”);  
 rDataArray = httpReceive(\_httpConnection);_  
  
 _// get and check the three digit HTTP status code where  
 // 1xx: Informational  
 // 2xx: Success  
 // 3xx: Redirection  
 // 4xx: Client Error  
 // 5xx: Server Error  
 responseCode = \_httpConnection.getResponseCode();  
 System.out.println(”-----\> Response Code: " + responseCode);_  
  
 _// print the error message if the status code is not 200 (HTTP\_OK)  
 if (responseCode != HttpURLConnection.HTTP\_OK) {  
 System.out.println(“HttpURLConnection response error\n”+responseCode);  
 //throw new LicenseChkrException(“some error occured while connecting to mediator”);  
 return null;  
 }  
 return rDataArray;  
 } catch(Exception e) {  
 System.out.println("Error! " + \_url + “: " + e.toString());  
 return null;  
 }finally{_  
  
 _// disconnet the HTTP connection  
 \_httpConnection.disconnect();  
 System.out.println(”_\*\*\*\*\*\*\*\* done \*\*\*\*\*\*\*\*\*\*\n");  
 }  
 }  
  
 /  
 **\* httpSend will send the document out through the opened  
 \* HTTP connection.  
 \*/  
private static void httpSend(HttpURLConnection \_httpConnection) throws Exception  
 {  
 System.out.println(“httpSend: … start …”);**  
  
 **int responseCode = 0;  
 String msg = null;**  
  
 **try {  
 System.out.println(“\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\n” + new String(\_dataArray));**  
  
 **// write the document to the output stream of the HTTP connection  
 \_httpConnection.getOutputStream().write(\_dataArray);**  
  
 **System.out.println(“\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\n”);  
 } catch(IOException e) {  
 msg = "httpSend: " + e.toString();  
 System.out.println(msg);  
 throw new Exception(msg);  
 } finally {  
 // close the output stream of the HTTP connection if error  
 \_httpConnection.getOutputStream().close();  
 }**  
  
 **System.out.println("httpSend: … done … bytes sent: " + \_dataArray.length);  
 }**  
  
 **/**  
 \* httpReceive will receive the reply document through the opened  
 \* HTTP connection.  
 \*/  
 private static byte httpReceive(HttpURLConnection \_httpConnection) throws Exception  
 {  
 System.out.println(“httpReceive: … start …”);  
  
 int rContentLength = 0;  
 byte rDataArray = null;  
  
 // get the content type  
 String rContentType = \_httpConnection.getContentType();  
  
 // use application/xml if no content type is specified  
 if (rContentType == null)  
 rContentType = TYPE\_APPLICATION\_XML;  
  
 // read the document from the output stream of the HTTP connection  
 byte buf = new byte[4096];  
 try {  
 ByteArrayOutputStream baos = new ByteArrayOutputStream ();  
 InputStream is = \_httpConnection.getInputStream ();  
 for (int i=0; (i=is.read (buf, 0, 4096)) != -1; ) baos.write (buf, 0, i);  
 rDataArray = new byte[rContentLength=baos.size ()];  
 rDataArray = baos.toByteArray ();  
 } catch(IOException e) {  
 // cannot receive for some reason  
 String eMsg = "httpReceive: " + e.toString();  
 e.printStackTrace();  
 System.out.println(eMsg);  
 throw new Exception(e.getMessage());  
 } finally {  
 // close the output stream of the HTTP connection if error  
 \_httpConnection.getInputStream().close();  
 }  
  
 // print the content type, content length, and the document  
 System.out.println("httpReceive: Content-Type: " + rContentType +  
 “, Content-Length: " + rContentLength + “\n” +  
 “\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\n” + new String[rDataArray) + “\n” +  
 “\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\n” +  
 “httpReceive: … done … bytes received: " + rContentLength);  
  
 return rDataArray;  
 }  
 public static void main(String args)throws Exception{  
  
 System.out.println(“Checking for valid license”);  
 String inputXML=”\<?xml version='1.0'?\>ramakrishna cellexchangeKKK KKKKKKKK chess cricket KKKKKKKK shoban business KKKKKKKKvollyballtennis KKKKKKKK ”;  
MediatorUtility.getResultsFromMediator(“[http://localhost:8080/orchestrator/samples/data/transformsequece.xml](http://localhost:8080/orchestrator/samples/data/transformsequece.xml)”, inputXML);  
  
  
 MediatorUtility.getResultsFromMediator(“[http://localhost:8080/orchestrator/samples/data/transformsequence.xml](http://localhost:8080/orchestrator/samples/data/transformsequence.xml)”, inputXML);  
  
 }  
  
} // MediatorUtility

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 6:10pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/6 "2002-12-30T18:10:09Z")

</div>

OK I missed that -sorry- but it is still just a File Not Found Exception. If you make sure that the file   
[http://localhost:8080/orchestrator/samples/data/transformsequence.xml](http://localhost:8080/orchestrator/samples/data/transformsequence.xml) can be found, this problem will go away. Please put your “transformsequence.xml” file into directory /webapps/orchestrator/samples/data  
and try again.

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 6:29pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/7 "2002-12-30T18:29:53Z")

</div>

Bill i kept my transformsequence.xml in  
  
[http://localhost:8080/orchestrator/samples/data/trasformsequence.xml](http://localhost:8080/orchestrator/samples/data/trasformsequence.xml) and item1.xsl in same location  
  
i could access this thru browser  
  
Regards  
Dacha

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 6:32pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/8 "2002-12-30T18:32:39Z")

</div>

In your last post you mention file  
[http://localhost:8080/orchestrator/samples/data/trasformsequence.xml](http://localhost:8080/orchestrator/samples/data/trasformsequence.xml)  
but the file we want to load is called  
[n[/b]sformsequence.xml]http://localhost:8080/orchestrator/samples/data/tra **n** sformsequence.xml](http://localhost:8080/orchestrator/samples/data/tra%5Bb)  
Was this just a typo in your posting or a real problem in your filename?

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 7:00pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/9 "2002-12-30T19:00:50Z")

</div>

Bill,  
  
It was a typo,yes i got…there was some problem with item.xsl  
  
 Thanks a lot for all the help u extended  
  
  
Regards  
Dacha

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [December 30, 2002, 7:20pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/10 "2002-12-30T19:20:05Z")

</div>

…glad it worked!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:39pm UTC](https://techcommunity.softwareag.com/t/entirex-meidator/58431/11 "2021-04-02T14:39:15Z")

</div>


