• ostate
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
Hi, :smileywink:

I'm trying to generate a PDF printed table from many data records.
Records are over a page, so I'd like to put a table header on every page.

I tried these two examples, but header was put on the only first page when data increased.

http://wiki.apexdevnet.com/index.php/Visualforce_CaseHistoryTimeline
http://wiki.apexdevnet.com/index.php/Visualforce_Quote2PDF

If you have some nice idea, please let me know.

Thanks,
ostate

  • October 16, 2008
  • Like
  • 0
Hello,

I want to implement compressed HTTP request/response, but it seems to fail.

I read past topics, and made several corrects to my sample which went well.

1st, I wrote sub class to make the flags true;

package com.sforce.soap.enterprise;

import javax.xml.rpc.Call;
import javax.xml.rpc.ServiceException;
import org.apache.axis.transport.http.HTTPConstants;
import com.sforce.soap.enterprise.SforceServiceLocator;

public class SforceServiceLocatorSub extends SforceServiceLocator {
    public Call createCall() throws ServiceException {
        Call call = super.createCall();
        call.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
        call.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
        return call;
    }
}

 2nd, I used the sub class to get a stub;

binding = (SoapBindingStub) new SforceServiceLocatorSub().getSoap();

3rd, I set up client-config.wsdd as follows;

<—xml version="1.0" encoding="UTF-8"–>
<deployment name="commonsHTTPConfig"
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <transport name="http"  pivot="java:org.apache.axis.transport.http.CommonsHTTPSender" />
  <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender" />
  <transport name="java"  pivot="java:org.apache.axis.transport.java.JavaSender" />

</deployment>

4th, I added commons-codec(Version1.3) and commons-httpclient(Version3.1) to build path.

Then, I called my sample with VM argument -Daxis.ClientConfigFile=client-config.wsdd.

I watch the request and response by tcpmon included in Axis. The result is

Request Header:
CONNECT na6-api.salesforce.com:443 HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/3.1
Host: xxxxx.yyy:8088
Proxy-Connection: Keep-Alive

 
Response Header:
HTTP/1.1 200 Connection established

There is no elements about compression in headers.
Please let me know what's wrong.

thanks.

  • October 06, 2008
  • Like
  • 0
Hi, everyone!

I'm trying to access to a web service written in Apex. It's very simple as follwing ;

|  global class MyHello {
|      webService static String getHello(String yourName) {
|          return 'Hello, ' + yourName + '!!';
|      }
|  }

I'm using axis-1.4, and I generate stubs with the following command.

|  java org.apache.axis.wsdl.WSDL2Java -a .\MyHello.xml

where MyHello.xml is gotten from Visualforce.com UI.

Then, I write the following client code ;

|  package com.sforce.soap.client;
|  import com.sforce.soap.schemas._class.MyHello.*;
|
|  public class MyHelloClient {
|      public static void main(String[] args) {
|         try {
|              MyHelloService mhs = new MyHelloServiceLocator();
|              MyHelloPortType mh = mhs.getMyHello();
|              System.out.println("GREETING : " + mh.getHello("FooBar"));
|         }
|          catch(Exception e){
|              e.printStackTrace();
|         }
|      }
|  }

This failes with following exception.

|  AxisFault
|   faultCode: {http://soap.sforce.com/schemas/class/MyHello}INVALID_SESSION_ID
|   faultSubcode:
|   faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
|   faultActor:
|   faultNode:
|   faultDetail:
|      {http://xml.apache.org/axis/}stackTrace:INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

"Quick Start" in "Force.com Web Services API Developer's Guide" shows me a sample program to login and set session id.
But I couldn't understand how to implement setting sessionId with the stubs of my custom web service.

If anyone know about this issue, please show me the right way.

thanks.

  • September 30, 2008
  • Like
  • 0
Hello,

I want to implement compressed HTTP request/response, but it seems to fail.

I read past topics, and made several corrects to my sample which went well.

1st, I wrote sub class to make the flags true;

package com.sforce.soap.enterprise;

import javax.xml.rpc.Call;
import javax.xml.rpc.ServiceException;
import org.apache.axis.transport.http.HTTPConstants;
import com.sforce.soap.enterprise.SforceServiceLocator;

public class SforceServiceLocatorSub extends SforceServiceLocator {
    public Call createCall() throws ServiceException {
        Call call = super.createCall();
        call.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
        call.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
        return call;
    }
}

 2nd, I used the sub class to get a stub;

binding = (SoapBindingStub) new SforceServiceLocatorSub().getSoap();

3rd, I set up client-config.wsdd as follows;

<—xml version="1.0" encoding="UTF-8"–>
<deployment name="commonsHTTPConfig"
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <transport name="http"  pivot="java:org.apache.axis.transport.http.CommonsHTTPSender" />
  <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender" />
  <transport name="java"  pivot="java:org.apache.axis.transport.java.JavaSender" />

</deployment>

4th, I added commons-codec(Version1.3) and commons-httpclient(Version3.1) to build path.

Then, I called my sample with VM argument -Daxis.ClientConfigFile=client-config.wsdd.

I watch the request and response by tcpmon included in Axis. The result is

Request Header:
CONNECT na6-api.salesforce.com:443 HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/3.1
Host: xxxxx.yyy:8088
Proxy-Connection: Keep-Alive

 
Response Header:
HTTP/1.1 200 Connection established

There is no elements about compression in headers.
Please let me know what's wrong.

thanks.

  • October 06, 2008
  • Like
  • 0
Hi, everyone!

I'm trying to access to a web service written in Apex. It's very simple as follwing ;

|  global class MyHello {
|      webService static String getHello(String yourName) {
|          return 'Hello, ' + yourName + '!!';
|      }
|  }

I'm using axis-1.4, and I generate stubs with the following command.

|  java org.apache.axis.wsdl.WSDL2Java -a .\MyHello.xml

where MyHello.xml is gotten from Visualforce.com UI.

Then, I write the following client code ;

|  package com.sforce.soap.client;
|  import com.sforce.soap.schemas._class.MyHello.*;
|
|  public class MyHelloClient {
|      public static void main(String[] args) {
|         try {
|              MyHelloService mhs = new MyHelloServiceLocator();
|              MyHelloPortType mh = mhs.getMyHello();
|              System.out.println("GREETING : " + mh.getHello("FooBar"));
|         }
|          catch(Exception e){
|              e.printStackTrace();
|         }
|      }
|  }

This failes with following exception.

|  AxisFault
|   faultCode: {http://soap.sforce.com/schemas/class/MyHello}INVALID_SESSION_ID
|   faultSubcode:
|   faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
|   faultActor:
|   faultNode:
|   faultDetail:
|      {http://xml.apache.org/axis/}stackTrace:INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

"Quick Start" in "Force.com Web Services API Developer's Guide" shows me a sample program to login and set session id.
But I couldn't understand how to implement setting sessionId with the stubs of my custom web service.

If anyone know about this issue, please show me the right way.

thanks.

  • September 30, 2008
  • Like
  • 0
Hi,
 
I have a apex page which has a link to excel page. when i click that it says "Could not Open http://store1/apex/excelview?startDate=7/22/2007&currencyType=EUR". 
The same page is opening in Firefox though.
 
<apex:page cache="false" contentType="application/vnd.ms-excel" controller="StoreController" language="{!userLanguage}">
 
Thanx
 
S
  • July 21, 2008
  • Like
  • 0