Connie,
I do not remember that I have ever seen the SOAP action as part of the URL. Having said that does not necessarily mean that that is right for all web services. But it is likely the SOAP action parameter part of the URL, that causes the problem. Also the fact that you get back a html web page instead of a SOAP message indicates, that you use a wrong URL. (my two cents)
Usually the SOAP action parameter is passed to http_xml_post() at position 10 of the parameter list. So it might be worth a try to call http_post_xml() like this:
rc = %len(soap);
rc = http_post_xml(
url
: %addr(SOAP) + 4
: %len(SOAP)
: *NULL
: %paddr(endElem)
: *null
: 600
: HTTP_USERAGENT
: 'text/xml'
: SOAPACTION);
Last but not least it often helps to call the web service with soapUI and check the soapUI http log for the details of the POST operation.
Thomas.
-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Connie Fuller
Gesendet: Mittwoch, 21. Oktober 2015 15:20
An: RPG programming on the IBM i (AS/400 and iSeries)
Betreff: RE: WebService
Please bear with me, I think this is the information that you need:
The command run I think is this:
rc = %len(soap);
rc = http_post_xml(
url + SOAPACTION
: %addr(SOAP) + 4
: %len(SOAP)
: *NULL
: %paddr(endElem)
: *null
: 600
: HTTP_USERAGENT
: 'text/xml');
End element procedure looks like this:
p endElem b
d endElem pi
d UserData * value
d depth 10I 0 value
d name 1024A varying const
d path 24576A varying const
d value 32767A varying const
d attrs * dim(32767)
d const options(*varsize)
d vv s 7a
/free
if (name = 'return');
result = value;
Else;
dump;
endif;
/end-free
It's all within an RPG program.
The responses I get back consist of this when looking at the values in Value and Name parameter:
'title'
'html/head'
'runtime error'
'style'
'html/head'
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:bl
ack;} p {font-family:"Verdana";font-weight:normal;color:black;margin-to
p: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-to
p: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;co
lor:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;c
olor:maroon } pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;} .versi
on {color: gray;} .error {margin-bottom: 10px;} .expandable { te
xt-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
'head'
'html'
This I have been told looks like it's pulling in an HTML error page.
I don't have a job log, but I've forced a dump in the EndElem procedure and I get the response data from that.
Hope this is what you're looking for, sorry if it's too vague.
Kind regards,
Connie
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bradley Stone
Sent: 21 October 2015 13:55
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: WebService
Connie,
could you post the command run, the job log and the response? Every little bit helps. :)
Brad
www.bvstools.com
On Wed, Oct 21, 2015 at 5:18 AM, Connie Fuller <CFuller@xxxxxxxxxxx> wrote:
Hello,
Looking for some help relating to webservices.
I need to stress my knowledge of webservices is very small, I've not
used them much, and where I have it's been a direct copy of someone
else's source and the relevant changes made.
I am slowly beginning to understand how they work.
I have put together a SOAP message in an RPG program, and then using
an HTTP_POST_XML command I've tried to send the request.
The responses that I get back from the webservice are not very useful
and looking at one of the responses it seems to pull through an HTML
error page formatting. One response says 'runtime error'.
Does anyone have any ideas on how I can make more sense of the error
that I'm getting?
Any help would be very much appreciated.
Connie
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.
As an Amazon Associate we earn from qualifying purchases.