• Mr_Khan
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hi Guys,

I am trying to display my VF page into Excel.Every thing is fine but the Company logo is not getting displayed in the excel sheet. Another thing that i wana ask is .....

Can we do the formatting of the excel sheet from VF itself ??

 

Thanks in Advance.

 

Hi, I'm new to webservices and struggling with understanding how to set some of the elements when using a HttpRequest object for a web service callout.  Here is a sample of the XML I need to call

 

<?xml version="1.0" encoding="utf-8"?>

<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">

  <soap12:Header>

    <ServiceAuthHeader xmlns="http:// dummyNameForBlogPost ">

      <User>string</User>

      <Password>string</Password>

    </ServiceAuthHeader>

  </soap12:Header>

  <soap12:Body>

    <create_record xmlns="http:/ dummyNameForBlogPost ">

      <packet>

        <ID>string</ID>

        <Address>string</Address>

        <Phone>string</Phone>

        <Email>string</Email>

      </packet>

    </create_record>

  </soap12:Body>

</soap12:Envelope>

<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">  <soap12:Header>    <ServiceAuthHeader xmlns="http://dummyNameForBlogPost ">      <User>string</User>      <Password>string</Password>    </ServiceAuthHeader>  </soap12:Header>  <soap12:Body>    <create_record xmlns="http://dummyNameForExpertsExc">      <packet>        <ID>string</ID>        <Address>string</Address>        <Phone>string</Phone>        <Email>string</Email>      </packet>    </create_record>  </soap12:Body></soap12:Envelope>

 

 

I tried to create my required code using HttpRequest/Response but wasn't 100% sure how to do so.  Here is my

sample code.

 

HttpRequest req = new HttpRequest();

req.setEndpoint('http://dummyNameForBlogPost.com/serviceTest.asmx ');

req.setMethod('POST');

req.setHeader('Content-Type', 'application/soap+xml');

req.setTimeout(60000);


String body="<?xml version="1.0" encoding="utf-8"?>

<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">

  <soap12:Header>

    <ServiceAuthHeader xmlns="http://dummyNameForBlogPost">

      <User>string</User>

      <Password>string</Password>

    </ServiceAuthHeader>

  </soap12:Header>

  <soap12:Body>

    <create_record xmlns="http://dummyNameForBlogPost">

      <packet>

        <ID>string</ID>

        <Address>string</Address>

        <Phone>string</Phone>

        <Email>string</Email>

      </packet>

    </create_record>

  </soap12:Body>

</soap12:Envelope>";



req.setBody(body);

Http http = new Http();  

try {        

  HTTPResponse res = http.send(req);     

  System.debug(res.toString());  

 

 } catch(System.CalloutException e) {  

  System.debug(e.toString());

 } 

 

 

I feel I should not put my Header element values in my "Body" though. Is this correct & if so how should I implement it? I presume I should set the header ServiceAuthHeader elements using req.setHeader().  

 

Thanks in advance for your help.


 

 

I have a Web Service that is expecting it as a part of SOAP header. How do I send it?

 

 


<soapenv:Header>

<wsse:Security

xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-

secext-1.0.xsd">

<wsse:UsernameToken>

<wsse:Username>username</wsse:Username>

<wsse:Password>password</wsse:Password>

</wsse:UsernameToken>

</wsse:Security>

</soapenv:Header>
<soapenv:Body>
<actual callout method here>
</soapenv:Body>

 

 

The only documentation I see is for inputHttpHeaders_x which can send http header and can send username password as part of 'Authorization' Header.

 

 

 

 

 

Message Edited by GoForceGo on 07-14-2009 05:03 PM
Message Edited by GoForceGo on 07-14-2009 05:03 PM
Message Edited by GoForceGo on 07-14-2009 05:05 PM