WebService Client - how to enable HTTP Compression

Hi
I have written a simple WebService Client. The WebService expects that the WebService clients enable HTTP compression. This is the exact text from the docs:-
""1. Client should be HTTP Compression enabled
HTTP Compression had been made mandatory for API�s. Thus API�s client should
include �Accept-Encoding: zip� header as part of request and should be able to
handle compressed data. Please note that system will send an error message if client
are not http compression enabled saying client should be compression enabled."
I do not know how to enable HTTP compression in the WebService Client. The method called is "GetInstantaneousFlowData". It accepts no arguments and returns xsd:datetime.
The wsdl can be found at:-
http://energywatch.natgrid.co.uk/EDP-PublicUI/PublicPI/InstantaneousFlowWebService.asmx?WSDL
Can someone please help :-
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import javax.xml.rpc.Call;
import javax.xml.rpc.ParameterMode;
import javax.xml.namespace.QName;
import java.util.Calendar;
public class TestNGPubTime4 {
public static void main(String[] args) throws Exception {
     // Setup the global JAX-RPC service factory
     System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
// create service factory
ServiceFactory factory = ServiceFactory.newInstance();
// define qnames
String targetNamespace = "http://www.NationalGrid.com/EDP/BusinessEntities/Public/";
QName serviceName = new QName(targetNamespace, "InstantaneousFlowWebService");
QName portName = new QName(targetNamespace, "InstantaneousFlowWebServiceSoap");
QName operationName = new QName("http://www.NationalGrid.com/EDP/UI/GetInstantaneousFlowData",
     "GetLatestPublicationTime");
// create service
Service service = factory.createService(serviceName);
// create call
Call call = service.createCall();
// set port and operation name
call.setPortTypeName(portName);
call.setOperationName(operationName); // add parameters
     call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
     call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://www.NationalGrid.com/EDP/UI/GetInstantaneousFlowData");
//     call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "http://schemas.xmlsoap.org/soap/encoding/");
call.setReturnType(new QName( "http://www.w3.org/2001/XMLSchema","datetime") );
// set end point address : soap address location
call.setTargetEndpointAddress("http://energywatch.natgrid.co.uk/EDP-PublicUI/PublicPI/InstantaneousFlowWebService.asmx");
// invoke the remote web service
Calendar result = (Calendar) call.invoke(new Object[] {});
System.out.println("result=" + result);
}

Rishika,
Thanks for your reply.
Could I get clariffication on some more thing?
I am using Axis 1.4 version. And I am able to implement the gzip while doing the following steps.
1) Change the pivote value to CommonsHTTpSender.
<transport name="http" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender"/>
2) public class RetreiveReservationsSOAPBindingStubLocal extends RetreiveReservationsSOAPBindingStub.
I Override the method to support GZIP.
org.apache.axis.client.Call _call = super.createCall();
call.setOperation(operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("retreiveReservations");
_call.setEncodingStyle(null);
call.setProperty(org.apache.axis.client.Call.SENDTYPE_ATTR, Boolean.FALSE);
call.setProperty(org.apache.axis.AxisEngine.PROPDOMULTIREFS, Boolean.FALSE);
call.setProperty(HTTPConstants.MCACCEPT_GZIP, Boolean.TRUE);
call.setProperty(HTTPConstants.MCGZIP_REQUEST, Boolean.TRUE);
call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("", "retreiveReservations"));
super.setRequestHeaders(_call);
super.setAttachments(_call);
Object resp = call.invoke(new Object[] {retreiveReservationsRequest});
I am able to send and receive the request and response in gzip encoded format.
Now my clarrification is,
Is it possible to set the piote value to CommonsHTTPSender for the transport http through my code?
How could I set the values from code?
Reason is, I don't want to manually edit the axis 1.4's client-config.wsdd
Since this is very critical thing, please please help me.
Thanks in advance.
Regards,
Nishad Ponery

Similar Messages

  • Weblogic WebServices Client: how to use HTTP 1.1 protocol ?

    Hi,
    I generated a stub ( jar file) to call a weblogic webservice from a client, both in weblogic workshop 8.1.4 and weblogic workshop 10.3.
    It seems that both jars (generated by weblogic) use HTTP 1.0 protocol (I can see the HTTP 1.0 requests from access log file)
    I would like to use HTTP 1.1 protocol : can I set some property ? Which property ? Can you help me ?

    Weblogic 10.3 generated client use HTTP 1.1 protocol

  • Weblogic WebServices Client: how to force HTTP 1.1 protocol ?

    I generated a stub ( jar file) to call a weblogic webservice from a client, both in weblogic workshop 8.1.4 and weblogic workshop 10.3.
    It seems that both jars use HTTP 1.0 protocol; I can see the HTTP 1.0 requests from access log file.
    I would like to use HTTP 1.1 protocol : can I set some property ? Which property ? Can you help me ?

    Weblogic 10.3 generated client use HTTP 1.1 protocol

  • What are the required settings to enable HTTP Compression?

    I am running into download speed issues with some of my clients.  I am looking for ways to improve download response without having to rewrite my system(s).
    On the server side, I am using CF 8.01 on a W2003 system.  I have enable HTTP Compression for the web site in IIS 6.0 for both static and dynamic files.
    On the client side where I am doing my testing, I am using IE 8.0 on a W7 professional system.  In I.E., I have enabled HTTP 1.1 under advanced options and am using Automatic mode as the download methodology for Temporary Files.
    It is my understanding that there is nothing that I have to do to CF to enable HTTP Compression.
    It does not appear to work because the downloaded cfm files (5717 and 694389) are the same size regardless of these setting.  In addition, I am using HttpWatch to determine all of the time and size parameters for each request. HttpWatch tells me in the summary that there are no HTTP Compression savings; i.e., HTTP Compression saving: 0 bytes.  Based upon some of the info I've read on the web, I would have expected 50% to 75% savings since the two files being downloaded are both dynamic text files.  All of the graphics, javascript, css files are cached so they do not figure into the equation.
    Is there something else beyond the IIS and IE settings that needs to be done to implement HTTP Compresssion???
    Thanks in advance for your suggestions/help.
    Len 

    Adam,
    I have read the references and may now be confused, but it seems to me that just doing the standard IIS Manager setup, which is what I've done, will not compress CFM files since the only things that are compressed under dynamic files are exe, dll and asp.
    One would think that CF should have added CFM to the list of compressed dynamic files when it was installed as it does with default.cfm, but maybe I'm expecting too much.
    If I am correct about this, then it would seem that I'm going to have to customize the compression setup as described in this quote from the reference,
    "Specify additional file types to compress. Edit the ... HcScriptFileExtensions metabase property (for dynamic files) to apply compression to additional file types."
    Am I misunderstanding this document???
    Len

  • How to enable OHS compression/cache for OBIEE

    Hi i have installed OHS (11.1.1.7) and webcache on OBIEE 11.1.1.7. Does any one know how to enable/configure compression/cache for OBIEE analytics? Also how to validate if compression is working?

    Hi Anke,
    all tables that have been created in V9.7 with attribute COMPRESS YES will be compressed statically .
    db2 " select count(*) , rowcompmode from syscat.tables group by rowcompmode "
    After the upgrade to 10.5 all tables created with attribute COMPRESS YES will get rowcompmode='A' but old tables created with V9.7 will stay with rowcompmode='S' .
    You can change tables from  rowcompmode='S' to rowcompmode='A' via  ALTER TABLE . After this all new pages or old pages that are touched will be adaptively compressed. But old pages that are not touched will only be static compressed. To get all pages of an existinbg table adaptive compressed you need to move data. For example with DB6CONV.
    Regards
                   Frank

  • Enable http compression on iplanet 7

    Hi Brother,
    We are enable http compression on iplanet 7.0 but the flash file "flv" unable to load by IE/firefox after enable this setting. Does it not support flash on http compression?

    I ran into a similar problem with pdf files and IE. It turned out to be a problem with IE. You can exclude IE with something like this:
    <If $browser = "*MSIE*" && $uri =~ ".flv$">
    #IE Bug - do nothing
    </If>
    <Else>
    NameTrans fn="assign-name" from="*" name="compress-on-demand"
    </Else>
    You may have to exclude the entire page that serves the flash too.

  • Netbeans 5.5 WebService Client - How do I pass a parameter to the service?

    I'm using Netbeans 5.5 and have generated a webservice client (JAX-WS 2.0) off of the existing WSDL. The webservice requires me to pass it some information. Per the generated code, it is expecting an EncryptedData object. The problem is, I have no idea what the content of this data object should be as it pertains to an anonymous complex type. The code generated for this class is listed below. Any ideas? By the way, I know what SOAP should be generated... I just don't know how to stick the soap information into this EncryptedData object. Thanks!
    * <p>Java class for anonymous complex type.
    * <p>The following schema fragment specifies the expected content contained within this class.
    * <pre>
    * <complexType>
    * <complexContent>
    * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    * <sequence>
    * <any/>
    * </sequence>
    * </restriction>
    * </complexContent>
    * </complexType>
    * </pre>
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
    "content"
    public static class EncryptedData {
    @XmlMixed
    @XmlAnyElement(lax = true)
    protected List<Object> content;
    * Gets the value of the content property.
    * <p>
    * This accessor method returns a reference to the live list,
    * not a snapshot. Therefore any modification you make to the
    * returned list will be present inside the JAXB object.
    * This is why there is not a <CODE>set</CODE> method for the content property.
    * <p>
    * For example, to add a new item, do as follows:
    * <pre>
    * getContent().add(newItem);
    * </pre>
    * <p>
    * Objects of the following type(s) are allowed in the list
    * {@link Object }
    * {@link String }
    public List<Object> getContent() {
    if (content == null) {
    content = new ArrayList<Object>();
    return this.content;
    Message was edited by:
    Tosa_Developer

    hello,
    I have done exactly as you have mentioned but I am facing prob passing String or XML data in the newItem variable:
    If I run the below code in jsp --->
    EncryptedData eD=new EncryptedData ();
    String newItem="test";
    eD.getContent().add(newItem);
    port.webMethod(eD);
    I encouter the following error at runtime:
    javax.xml.bind.MarshalException - with linked exception: [com.sun.istack.SAXException2: unable to marshal type "java.lang.String" as an element because it is missing an @XmlRootElement annotation]
    Pls help me pass either XML or String value to the webservice inside this encrpteddata.
    Thanx 4 ton 4 ur time and help.

  • JAX-RS and Weblogic 10.3 - How to enable HTTP PUT?

    I'm playing around with JAX-RS and Weblogic 10.3.
    I just sent a HTTP PUT request, and got back
    HTTP/1.1 405 Method Not Allowed
    Is this because HTTP PUT is disabled?
    If so, how do I enable it? I can't find the answer on Google or the forums here, so maybe I'm on the wrong track...

    In my case, WebLogic 10.3.1 returns this messege every time a Send a HTTP PUT request:
    Error 400--Bad Request
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.1 400 Bad Request
    The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
    Is there any way to enable HTTP PUT and HTTP DELETE in WebLogic?
    I can´t believe it's not possible to deploy RESTful Web Applications in WebLogic. That's terrible...

  • How to enable HTTPS Port in abap system

    Hello All,
    Hope all are doing great,can any one please tell me the procedure step by step how can i enable https port in my only abap system,is it required to enable ssl also for this?..
    Regards,
    Syed

    Hi,
    For enabling the HTTPS port you need to do alot many things
    At first change the para meters in Rz10
    icm/server_port_0 - PROT=HTTPS, PORT=1443, TIMEOUT=900
    icm/HTTPS/verify_client - 1
    ms/server_port_0 - PROT=HTTPS, PORT=1443
    SE80 - Utilities > Settings > Internet Transaction Sevrer = HTTPS
    and also check SMICM under Services HTTPS is not showing as Active
    and still if you are facing any issue with the port check with the network team/firewall team whether any port is being blocked on the network/firewall.
    Regards
    Mohammed nizam

  • How to enable https for a single webapp in tomcat 5.5 ?

    Hi ,
    I want to enable https for my web app in Tomcat 5.5(with JDK 1.5, in WinXP) without affecting other webapps running in the same server . Any idea how to do it ? Pl. note , I dont want to make the entire tomcat as SSL enabled.
    Regards
    Diana

    You specify SSL in web.xml of your application. So, in that case other web applications in same server would not be affected.
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>myresources</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    </security-constraint>Following link will help you to setup SSL in tomcat:
    [http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/|http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/]
    Thanks,
    Mrityunjoy

  • As a webservice client, how to set character encoding for JAX-WS?

    I couldn't find the right API to set character encoding for a webservice client. What I did is
    1, wsimport which gives me MyService, MyPortType...
    2. Create new MyService
    3. Get MyPort from MyService
    4. Call myPort.myOperation with objects
    Where is the right place to set character encoding and how to set it? Thanks.
    Regards
    -Jiaqi Guo

    The .js file and the html need to have the same encoding. If
    your html uses iso-8859-7, then the .js must also use that. But if
    the original text editor created the .js file using utf-8, then
    that is what the html needs to use.

  • How to enable https or SSL for login page only?

    Hi,
    My application is runnnin in iPlanet web server 4.1 version.
    how to make my login page only secured (SSL)?
    previously we have done https enable for the whole application. but client specifically wants for login page only, not for the whole application. how can i make SSL for login page only in iPlanet 4.1.
    I searched through iPlanet console, but i didn't get any option such.
    i found one more thing console,i.e., "encrypt on or off". if i put encrypt "on" means, it will be for the whole application? How can i make it for login page only.
    Do i need to do any code changes for that?
    i tried through web.xml security constraints tags, but it is not working and taking that file as we are doing everything in servlet.properties and rules.properties files.
    can anybody help me in this regard?
    Regards,
    Chandu

    You specify SSL in web.xml of your application. So, in that case other web applications in same server would not be affected.
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>myresources</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    </security-constraint>Following link will help you to setup SSL in tomcat:
    [http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/|http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/]
    Thanks,
    Mrityunjoy

  • How to enable SOAP compression in web services

    Hi, I have created a web services by exposing an EJB using annotations. Trouble now is that the output is an array of Objects which grew to a significant size to cause latency issue. I have saw folks using filters to compress the HTTP response but is unable to find much resources on the web linking up annotated-EJB web services to link up with the filters but most of the examples I see are based on handlers and not EJB-exposed web services, can someone point me to some resources for that type of web services + compression?
    Another thing which caught my attention is the use of the <compress-html-template> tag which needs to be in the web.xml file, but since I am using a "generated" web services as per say, I do not have that web.xml file, how then can I use that feature?
    Thanks in advance.

    Hi Anke,
    all tables that have been created in V9.7 with attribute COMPRESS YES will be compressed statically .
    db2 " select count(*) , rowcompmode from syscat.tables group by rowcompmode "
    After the upgrade to 10.5 all tables created with attribute COMPRESS YES will get rowcompmode='A' but old tables created with V9.7 will stay with rowcompmode='S' .
    You can change tables from  rowcompmode='S' to rowcompmode='A' via  ALTER TABLE . After this all new pages or old pages that are touched will be adaptively compressed. But old pages that are not touched will only be static compressed. To get all pages of an existinbg table adaptive compressed you need to move data. For example with DB6CONV.
    Regards
                   Frank

  • How to enable http trace for a mobile application??

    Hi ,
    SSO(single Sign On) is failing in my client's application.And it is an android application.So,we are not able to enable the http trace and see where its failing/where the cookie is getting wiped out. Please let me know if there is any alternative way to trace this mobile application.
    Cheers & regards
    Priyadarshini

    Interesting
    android - Capturing mobile phone traffic on wireshark - Stack Overflow
    Check if any of the method mentioned on above link helps
    To replicate the issue you can also use the emulator. Emulator can be downloaded from Android Developers

  • How to enable https in Oracle BPEL Process Manager 10.1.2

    Hi,
    I have a few security related questions surrounding BPEL process manager.
    1. Does the BPEL engine have the capability to invoke a web service using https (HTTP over SSL)? Does it automatically do that if partner link URI starts with https:// ?
    2. If not, what needs to be done to enable accessing a https based web service?
    Thanks,
    Vidya

    Eric,
    I had applied the steps specified in the URL and modified the files default-web-site.xml, secure-web-site.xml and server.xml in directory Ora_Home\j2ee\home\config. Able to invoke the application deployed in Ora_Home\j2ee\home\applications successfully using https.
    For securing BPEL process I had followed the same steps by modifying files default-web-site.xml, secure-web-site.xml and server.xml in directory Ora_Home\j2ee\OC4J_BPEL\config. While invoking the BPEL Processes using https protocol I am facing error “HTTP 500 - Internal server error”, after the security alert popup.
    Do I need to do any other configurations for securing BPEL processes deployed in Ora_Home\integration\orabpel\domains\default\deploy directory?
    Please assist me on this.
    Thanks,
    Vidya

Maybe you are looking for