# How to send XML with pub.clent:http ?

**URL:** <https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [May 26, 2008, 12:57am UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594 "2008-05-26T00:57:39Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Walters1](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tom\_Walters1](https://techcommunity.softwareag.com/u/Tom_Walters1)\
**Post date:** [May 26, 2008, 12:57am UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/1 "2008-05-26T00:57:39Z")

</div>

I want to send an invoice in xml format to a client URL using pub.clent.http.

In SAP Business Connector I have successfully mapped an invoice idoc to to xmldata using the service recordToDocument. This data includes the correct header and a \<!DOCTYPE\> element and it seems to be correct because I can open and browse it with Internet Explorer without errors.

My attempts to successfully send the data have failed because I do not fully understand how the pub.client:http service should be populated.

I wonder if anyone could save me a lot of time of trial and error by explaining how it should be done.

The ideal would be an example of some working coding.

Thanks very much in anticipation of your help.

Tom

---

<div class="post-metadata">

**Author:** ![Gunasekhar\_Tirupati1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/gunasekhar_tirupati1/32/710_2.png) [@Gunasekhar\_Tirupati1](https://techcommunity.softwareag.com/u/Gunasekhar_Tirupati1)\
**Post date:** [May 26, 2008, 4:12pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/2 "2008-05-26T16:12:39Z")

</div>

> [@](#):
>
> I wonder if anyone could save me a lot of time of trial and error by explaining how it should be done.

But this is how we learn…

Ok, you can try this.

1. Convert the document to string using documentToXmlString
2. set variable ‘Content-type’ to ‘text/xml’ in pipeline.
3. invoke service pub.client:http and set the url, method = post and map your xml string to ‘string’ variable in ‘data’ document.
4. map the ‘Content-type’ variable to ‘headers/Content-type’.  
This should suffice. The recever will get an xml node.

Cheers  
Gunnasekkhaar

---

<div class="post-metadata">

**Author:** ![Tom\_Walters1](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tom\_Walters1](https://techcommunity.softwareag.com/u/Tom_Walters1)\
**Post date:** [May 26, 2008, 7:10pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/3 "2008-05-26T19:10:27Z")

</div>

Gunnasekkhaar, thanks for your reply, which is much appreciated.

Our version of SAP Business Connector (4.7) does not have the built in service documentToXmlString. Is there any other way to convert my xmldata to the required string or is there somewhere I can obtain the documentToXmlString service.

I agree with your comment “this is how we learn” but as a newcomer to this software I have already climbed a steep learning curve converting a SAP idoc invoice to the required xml structure and am now under pressure to get this working.

Thanks again for your help

Tom

---

<div class="post-metadata">

**Author:** ![wMusers.Com1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wmusers.com1/32/170_2.png) [@wMusers.Com1](https://techcommunity.softwareag.com/u/wMusers.Com1)\
**Post date:** [May 26, 2008, 10:12pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/4 "2008-05-26T22:12:16Z")

</div>

Prior to IS 6.x, documentToXMLString was called recordToXMLString.

Mark

---

<div class="post-metadata">

**Author:** ![Tom\_Walters1](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tom\_Walters1](https://techcommunity.softwareag.com/u/Tom_Walters1)\
**Post date:** [May 28, 2008, 8:28pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/5 "2008-05-28T20:28:09Z")

</div>

Thanks With your help. I got it working like this:

1. defined the URL and mapped it to the http “url” parameter
2. http Method parameter = Post
3. http loadAs parameter = stream
4. In the pipeline prior to the http I created a record “headers” with a field Content-Type. Set the value of this field to “text/xml”
5. Mapped this to the “headers” record parameter of the http.
6. Mapped the “xmldata” output from my preceding recordToDocument to “string” within the “data” parameter of the http.

---

<div class="post-metadata">

**Author:** ![arasu17](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@arasu17](https://techcommunity.softwareag.com/u/arasu17)\
**Post date:** [September 12, 2009, 6:56pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/6 "2009-09-12T18:56:50Z")

</div>

hi,  
i am new to sap business connector, i want some tips regarding sap bc to sap and sap to sap bc using rfc.

Regards,  
Arasukumar

---

<div class="post-metadata">

**Author:** ![u.schmidt.32264](https://avatars.discourse-cdn.com/v4/letter/u/58f4c7/32.png) [@u.schmidt.32264](https://techcommunity.softwareag.com/u/u.schmidt.32264)\
**Post date:** [October 26, 2009, 8:37pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/7 "2009-10-26T20:37:53Z")

</div>

> [@mcarlson;58455](#):
>
> Prior to IS 6.x, documentToXMLString was called recordToXMLString.
> 
> Mark

Well, actually it was called “recordToDocument” in those times… 😉  
Which was a bit “ill-named”, because if “documentToRecord” transforms a “node” object into a “record”, then one would assume, that “recordToDocument” would transform a “record” into a “node” object. But it didn’t, it transforms the record right into a string…

---

<div class="post-metadata">

**Author:** ![u.schmidt.32264](https://avatars.discourse-cdn.com/v4/letter/u/58f4c7/32.png) [@u.schmidt.32264](https://techcommunity.softwareag.com/u/u.schmidt.32264)\
**Post date:** [October 26, 2009, 8:39pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/8 "2009-10-26T20:39:57Z")

</div>

> [@arasu17;68315](#):
>
> hi,  
> i am new to sap business connector, i want some tips regarding sap bc to sap and sap to sap bc using rfc.
> 
> Regards,  
> Arasukumar

This is the wrong forum. Please look at this one instead: “wMUsers → webMethods Adapters → Application Adapters”. There is a lot of stuff regarding the SAP Adapter and using RFC.

---

<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:** [January 11, 2010, 4:42pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/9 "2010-01-11T16:42:30Z")

</div>

Hi,

I too need help with HTTP Post.  
In my case , I need to get xml data from Siebel through HTTP Post to webMethods.  
Can some one give an idea on how to implement this. Haven’t worked with HTTP in webMethods before.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [January 11, 2010, 8:59pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/10 "2010-01-11T20:59:03Z")

</div>

wmprof,

Please use the search functionality in this forum any keyword like: http post

Check these threads:  
[url][wmusers.com](http://wmusers.com/forum/showthread.php?p=64018&highlight=http+post#post64018%5B/url%5D)  
[url][wmusers.com](http://wmusers.com/forum/showthread.php?p=42560&highlight=http+post#post42560%5B/url%5D)

IMO:Your seibel application can do HTTP post invoking a webMethods IS service along with setting Content-Type=“text/xml” and login user credentials for http post to make work and the IS service input should be a node(object).

HTH,  
RMG

---

<div class="post-metadata">

**Author:** ![karim.tazibt](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@karim.tazibt](https://techcommunity.softwareag.com/u/karim.tazibt)\
**Post date:** [July 17, 2012, 6:58pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/11 "2012-07-17T18:58:40Z")

</div>

Hi,  
I encountred a simple-like issu to process an xml retunred by a ws request. I did as following:  
pub:client:http  
bytestostring  
stringtonode  
xmlnodetodocument

I’ve tried all parameters to get rid off theses white spaces within the xml but in vain

Thanks

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [July 17, 2012, 7:09pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/12 "2012-07-17T19:09:51Z")

</div>

What white spaces are you asking about?..Are you referring to line feeds/spaces between each tag below?

data  
data

---

<div class="post-metadata">

**Author:** ![karim.tazibt](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@karim.tazibt](https://techcommunity.softwareag.com/u/karim.tazibt)\
**Post date:** [July 17, 2012, 7:30pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/13 "2012-07-17T19:30:32Z")

</div>

> [@rmg;85197](#):
>
> What white spaces are you asking about?..Are you referring to line feeds/spaces between each tag below?
> 
> data  
> data

Hi and thanks for your reply,  
Yes, for example, if in the xml, I have:  
  
data  
data  
  
The returned values fot tag1, will be:…(white space for tab)data  
Allmost of values are preceeded with (tab) which avoid any insert in tables (data type:null)

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [July 17, 2012, 8:00pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/14 "2012-07-17T20:00:18Z")

</div>

Try using replace service to remove line feeds (searchString - setValue and hit enter and close/save the pop up) and this should take care of LF’s removed from the xmldata string:

HTH,  
RMG

---

<div class="post-metadata">

**Author:** ![karim.tazibt](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@karim.tazibt](https://techcommunity.softwareag.com/u/karim.tazibt)\
**Post date:** [July 18, 2012, 12:14pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/15 "2012-07-18T12:14:35Z")

</div>

Hi,  
Thank’s, it works

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [July 18, 2012, 6:31pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/16 "2012-07-18T18:31:40Z")

</div>

Great as long it works out for you:

---

<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, 3:05pm UTC](https://techcommunity.softwareag.com/t/how-to-send-xml-with-pub-clent-http/109594/17 "2021-04-02T15:05:46Z")

</div>


