How to send XML with pub.clent:http ?

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

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

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

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

Mark

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.

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

Well, actually it was called “recordToDocument” in those times… :wink:
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…

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.

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!

wmprof,

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

Check these threads:
[url]wmusers.com
[url]wmusers.com

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

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

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)

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

Hi,
Thank’s, it works

Great as long it works out for you: