[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: New to http questions



Walker,

Two questions...

1. Do you have debug turned on in the RPG program? Example 18 has it turned
on. If you took it out, put it back in (http_debug(*ON);). If you have it,
then you can look in the IFS in /tmp (wrklnk '/tmp/httpapi_debug.txt'). Copy
the entire file to your email and send it out.

2. Can you run the web service from some other interface? Such as straight
from IE. If you can, post the code that you use to test that the service is
working.

Mike Krebs

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Walker Powell
Sent: Monday, October 29, 2007 7:38 AM
To: HTTPAPI and FTPAPI Projects
Subject: RE: New to http questions

Good morning, Mr. Klement.  Well I am no longer getting a 404. Now the
message is:
"CommTCP_read: recv: A connection with a remote socket was reset by that
socket."

I surmise that I am not making a connection, or maybe I am but not passing
the correct connect info?  I really hate that I am ignorant about this, so
if you have a small clue, I would appreciate it.  What I really don't like
is my inability to debug the whole process!

Regards,


Walker Powell
Pacer International IT
6805 Perimeter Dr.
Dublin, OH 43016
walker.powell@xxxxxxxxx
614.356.1257 office
614.923.1442 fax

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Mon, October 22, 2007 12:22 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: New to http questions

Hi Walker,

I guess I would do the SOAP message a little differently.  I'd create a SOAP
message that looks like this:

soap = '<?xml version="1.0" encoding="iso-8859-1"'
      + ' standalone="no"?>'
      + '<soap:Envelope '
      + '  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>'
      + '<soap:Body>'
      + '  <tns:processLoad '
      + '    xmlns:tns="http://services.prealert.hwy.pgl";>'
      + '    <loadInfo>' + %trim(AlertData) +'</loadInfo>'
      + '  </tns:processLoad>'
      + '</soap:Body>'
      + '</soap:Envelope>';

Don't forget to encode your "AlertData" if it contains any special XML
characters (less than, greater than, ampersand characters).

Also, you'll note what the WSDL says for SoapAction:

          <wsdlsoap:operation soapAction=""/>

See?  It shows the SoapAction as a blank string....  so you should also tell
HTTPAPI to set a blank string (in the last parameter to
http_url_post_xml)

rc = http_url_post_xml(
'http://172.30.30.20/PreAlertWebServices/services/PreAlertServices'
       : %addr(SOAP) + 2
       : %len(SOAP)
       : *NULL
       : %paddr(Incoming)
       : %addr(status)
       : HTTP_TIMEOUT
       : HTTP_USERAGENT
       : 'text/xml'
       : '' );

Good luck!



Walker Powell wrote:
> Hi, all. As a newbie, I am having a bit of a problem trying to call a web
service to post some data.  I'm trying to send internal data from an rpg pgm
to a web service. I have been sent a wsdl describing the call.
>
> I took example 18 and then tried to substitute info from the wsdl into the
soap build. Not knowing what I am supposed to substitute, other than the
obvious, I'm frustrated.
>
> I got the pgm to compile, but running it produced a 404 error. I know what
that means, but I think there are other problems.
>
> Would someone look at see if there is anything obvious?  I am going to
show the wsdl and then my mods. Please pardon the length, as it is a bit
long.
>
> ----WSDL--------
> <?xml version=.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace=ttp://services.prealert.hwy.pgl"
> xmlns:impl="http://services.prealert.hwy.pgl";
> xmlns:intf="http://services.prealert.hwy.pgl";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>  <wsdl:types>
>   <schema targetNamespace=ttp://services.prealert.hwy.pgl"
xmlns="http://www.w3.org/2001/XMLSchema";
xmlns:impl="http://services.prealert.hwy.pgl";
xmlns:intf="http://services.prealert.hwy.pgl";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>    <element name=rocessLoadResponse">
>     <complexType>
>      <sequence>
>       <element name=rocessLoadReturn" nillable="true"
type="impl:ArrayOfXSDAnyType"/>
>      </sequence>
>     </complexType>
>    </element>
>    <element name=rocessLoad">
>     <complexType>
>      <sequence>
>       <element name=oadInfo" nillable="true" type="xsd:string"/>
>      </sequence>
>     </complexType>
>    </element>
>    <complexType name=rrayOfXSDAnyType">
>     <sequence>
>      <element maxOccurs=nbounded" minOccurs="0" name="anyType"
nillable="true" type="xsd:anyType"/>
>     </sequence>
>    </complexType>
>   </schema>
>  </wsdl:types>
>    <wsdl:message name=rocessLoadRequest">
>       <wsdl:part element=mpl:processLoad" name="parameters"/>
>    </wsdl:message>
>    <wsdl:message name=rocessLoadResponse">
>       <wsdl:part element=mpl:processLoadResponse" name="parameters"/>
>    </wsdl:message>
>    <wsdl:portType name=reAlertServices">
>       <wsdl:operation name=rocessLoad">
>          <wsdl:input message=mpl:processLoadRequest"
name="processLoadRequest"/>
>          <wsdl:output message=mpl:processLoadResponse"
name="processLoadResponse"/>
>       </wsdl:operation>
>    </wsdl:portType>
>    <wsdl:binding name=reAlertServicesSoapBinding"
type="impl:PreAlertServices">
>       <wsdlsoap:binding style=ocument"
transport="http://schemas.xmlsoap.org/soap/http"/>
>       <wsdl:operation name=rocessLoad">
>          <wsdlsoap:operation soapAction=/>
>          <wsdl:input name=rocessLoadRequest">
>             <wsdlsoap:body use=iteral"/>
>          </wsdl:input>
>          <wsdl:output name=rocessLoadResponse">
>             <wsdlsoap:body use=iteral"/>
>          </wsdl:output>
>       </wsdl:operation>
>    </wsdl:binding>
>    <wsdl:service name=reAlertServicesService">
>       <wsdl:port binding=mpl:PreAlertServicesSoapBinding"
name="PreAlertServices">
>          <wsdlsoap:address
location=ttp://172.30.30.20/PreAlertWebServices/services/PreAlertServices"/>
>       </wsdl:port>
>    </wsdl:service>
> </wsdl:definitions>
> ------------------------------
> --- My mods------
> d ALERT_DFS       PR                  ExtPgm('ALERT_DFS')
> d   AlertData                  256a   const
> d ALERT_DFS       PI
> d   AlertData                  256a   const
> ~~~
> ~~~
> SOAP  '<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>'
> +'<SOAP:Envelope'
> +'    xmlns:SOAP=ttp://schemas.xmlsoap.org/soap/envelope/"'
> +'    xmlns:tns=ttp://172.30.30.20/PreAlertWebServices'
> +     '/services/PreAlertServices">'
> +'<SOAP:Body>'
> +'  <tns:PreAlertServices>'
> +'      <tns:processLoad>'+ %trim(AlertData) + '</tns:processLoad>'
> +'  </tns:PreAlertServices>'
> +'</SOAP:Body>'
> +'</SOAP:Envelope>';
>
> http_debug(*ON);
> rc =ttp_url_post_xml(
> 'http://172.30.30.20/PreAlertWebServices/services/PreAlertServices'
>       : %addr(SOAP) + 2
>       : %len(SOAP)
>       : *NULL
>       : %paddr(Incoming)
>       : %addr(status)
>       : HTTP_TIMEOUT
>       : HTTP_USERAGENT
>       : 'text/xml'
>       : 'http://172.30.30.20/PreAlertWebServices/services' +
>          '/PreAlertServices' + ')');
> --------------------
>
> I'm not sure just what the "tns" in in the soap body refers to. That 
> is not in the wsdl Thanks for any help ... I'm really in the dark here.
> W.powell


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------