Abdullah Al Fararjeh

Greenhorn
+ Follow
since Feb 08, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Abdullah Al Fararjeh

Peer Reynders wrote:Another approach is discussed in A Java proxy for MS SQL Server Reporting Services.



Hello Peer,

Firstly, thank you for tip. I have read the article and. Then I downlaoded the attached library code with the article. After that, I changes the server URL and the credintial information. Unfortunately, I got the following error:

ReportRequest - ERROR: No cookie provided by report server. Aborting.

To explore the navigate the error, I have printed all hearder fields as the following

key: null, HTTP/1.1 302 Found
key: Server, Microsoft-IIS/5.1
key: Date, Sat, 14 Feb 2009 17:07:39 GMT
key: X-Powered-By, ASP.NET
key: X-AspNet-Version, 2.0.50727
key: Location, http://localhost/ReportServer05/Pages/ReportViewer.aspx?%2fSMSReports%2fReport1&rs%3aCommand=Render&rc%3aToolbar=false%0d%0a
key: Cache-Control, private
key: Content-Type, text/html; charset=utf-8
key: Content-Length, 249

So I have doubt of the following header parameter whose value "HTTP/1.1 3.2 Found". This code means redirection.


Do you have any suggestion?
15 years ago

William Brogden wrote:The call to the web service needs to use the port that TCPMON is listening on in the URL so you will have to modify that page.

The target port is the one the web service is listening on which TCPMON will redirect to.

You should be able to find examples of using TCPMON on the net.

Bill



Hello Bill,

First of all I want to thank you very much regarding your help and your guide.

I have read the following tutorial from Apache itself (http://ws.apache.org/commons/tcpmon/tcpmontutorial.html). It is great and i found TCPMON is easy to use.

In my case I want to consume .Net web service from Java client application. I have create a simple webservice (HelloWorld) in .net environment and I deployed it into http://localhost/HelloWebService. Then I moved into my Java application which consumes that webservice. I changed the url of webservice in the java application as http://localhost:8087/HelloWebService/HelloWorld.asmx instead of http://localhost/HelloWebService/HelloWorld.asmx. Then I create a listener in TCPMON on the port 8087. Every thing was very interesting and I explored the SOAP messages between the client and the webservice.

Let me get back to my real case of consumint Dot net Reporting services from Java application. TCPMON showed the following messages:

Client Request [from Java Application]

POST /ReportServer05 HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: localhost:8087
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/FindItems"
Content-Length: 555
Authorization: Basic YWJkdWxsYWhQQ1xhYmR1bGxhaDpwQHNzdzByZA==

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><FindItems xmlns="http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices"><Folder>/</Folder><BooleanOperator>Or</BooleanOperator><Conditions><SearchCondition><Name>Name</Name><Value>Report1</Value><Condition>Contains</Condition></SearchCondition></Conditions></FindItems></soapenv:Body></soapenv:Envelope>


Server REsponse [from SQL Server 2005 Reporting Services Report Server]

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Thu, 12 Feb 2009 15:28:55 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Length: 0


As you see I the message from the web service side is clear. Do you have any tip?


Thanks in advanced
15 years ago

William Brogden wrote:You need to see what is actually being transmitted in the request and response. The actual text of the messages in both directions.

This can be done with the utilities I mentioned which have to be configured to capture the text of the request and relay it to the web service while keeping a copy and capturing the returned text.

TCPMON is typically included in AXIS downloads - SoapUI you can find on the net.

Bill



Thank you again for your interest.

I start using TCPMON utility included in AXIS. In fact I run the following command:
java org.apache.axis.utils.tcpmon

I filled the following pararmeters:
Listen Port 123
Target Hostname: localhost
Target Port#: 80 and (I tried to use the value 8080 in another attempt)


After that, I run my application and I called the page that calls the webservice. But unfortunately, no messages was captured.

Is there facility to verify of the webservice port? According to my best knowledge that the web service of SQL Server reporting services is deployed on IIS and the TCP port of IIS is 80.

It seems my questions are still naive but I will be so grateful if you help me.
15 years ago

William Brogden wrote:I would certainly start by capturing the actual messages being sent with TCPMON or SoapUI. The cause may become glaringly obvious.

Bill



Thank you for your reply, Bill.

In fact, I have not got your point. Can you explain more?
15 years ago
My mission is to integrate a .net web service through a J2EE application. Specifically, my case is to integrate MS SQL Server 2005 Reporting Services with J2EE application. For that purpose I used AXIS to generate Java proxy classes for my .net web service and I tried to use those classes inside J2EE application but unfortunately I have trapped with the following error message:

; nested exception is:
org.xml.sax.SAXParseException: Premature end of file.


Then I need your advice to configure the problem. I have doubt of many things:
1. Tomcat version
2. Java SDK version
3. AXIS version
4. the webservice URL

Can anyone help me, please?
15 years ago
Hello everybody,

I want to integrate a J2EE application with SQL Server 2005 Reporting Services. In fact, it is the first time to be involved in developing an interoperability component between .Net web service and Java application. So I have learned for some time how to pass this challenge. Moreover, I found the following virtual lab is an excellent starting point "MSDN Virtual Lab: Implementing SQL Server Reporting Services with a Java Enterprise Edition (EE) Application" http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032315323&EventCategory=3&culture=en-US&CountryCode=US

After going through the lab, I tried to apply the same code in my machine but I have stuck with the following error:

; nested exception is:
org.xml.sax.SAXParseException: Premature end of file.


I use the following tools:
- Netbeans IDE 6.5
- Java SDK: build 1.6.0_01-b06
- Web Server: Apache Tomcat 6.0
- axis Jars (axis.jar, axis-ant.jar, commons-discovery-0.2.jar, commons-logging-1.0.4.jar, jaxrpc.jar, log4j-1.2.8.jar, saaj.jar, wsdl4j-1.5.1.jar)
- Reporting Tool: SQL Server 2005 Reporting Services

I will be so grateful if someone help me. I am waiting your response
this is a snippet of my code :


package net;

//import java.io.*;
import com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.*;
import java.io.Serializable;


/**
*
* @author Abdullah Al Fararjeh
*/
public class NetData implements Serializable
{
static String[] data;


public NetData(){}


public static String[] getData(String myURL, String searchStr)
{
try{
CatalogItem[] returnedItems;
String folderName = "/";
returnedItems = FindReports(folderName, myURL, searchStr);


if(returnedItems != null && returnedItems.length > 0){


int count = returnedItems.length;
data = new String[count];
for(int x = 0; x < returnedItems.length; x++){
data[x] = returnedItems[x].getPath();
}
}
else
data = new String[] {"No Records Found"};


return (data);
}
catch(Exception e){
System.out.println(e.getMessage());
String[] s = new String[1];
s[0] = e.getMessage();
return (s);
}
}


private static CatalogItem[] FindReports(String folderName, String serverUrl, String searchStr)
{
try
{
//CatalogItem find;


ReportingService2005Locator loc = new ReportingService2005Locator();
//retrieve a report from the service locator
ReportingService2005Soap port = loc.getReportingService2005Soap(new java.net.URL(serverUrl));


//set the HTTP Basic Authentication credintials using Stub object methods
javax.xml.rpc.Stub stub = (javax.xml.rpc.Stub) port;
stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "abdullahPC\\abdullah");
stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "mypassword");


//set up a search condition where the item name contains the specified search string
SearchCondition condition = new SearchCondition();
condition.setCondition(ConditionEnum.Contains);


condition.setName("Name");


if(searchStr != null)
condition.setValue(searchStr);
else
condition.setValue("");


//create an array of SearchCondition which will contain our single search condition
SearchCondition[] conditions;
conditions = new SearchCondition[1];
conditions[0] = condition;


//Call the web service with the appropriate parameters
CatalogItem[] returnedItems;
System.out.println("before port.findItems");
returnedItems = port.findItems(folderName, BooleanOperatorEnum.Or, conditions);
System.out.println("after port.findItems");
return returnedItems;
}
catch(Exception e){
System.out.println(e.getMessage());
return null;
}
}
}

15 years ago