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

Re: Need some examples to start



Hello Henry,

The debug log you posted shows the following data being sent to the server:

processService?PDMServiceInput=<?xml version="1.0"?>
<PDMServiceInput><RequestID>PartNumberCheck001</RequestID>
<CatalogYear>2011</CatalogYear><PartNumber>01806-9993 </PartNumber>
</PDMServiceInput>

This looks sort of like a web form. Bugt it has "processService" in 
front of it, which doesn't make sense for a web form.  Plus, there are 
certain characters that aren't URL-encoded as they would be in a web form.

But here's the really strange part, you have this:
Content-Type: text/xml

If you are supposed to send the data as a web form, why on earth are you 
telling the server that it's straight XML?  That's not the right 
content-type for a web form!

Even stranger, the response you're getting appears to be SOAP. The 
response you're getting follows (I've reformatted it for readability):

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
  <soapenv:Header
    xmlns:wsa="http://www.w3.org/2005/08/addressing";>
    <wsa:Action>
      http://www.w3.org/2005/08/addressing/soap/fault
    </wsa:Action>
  </soapenv:Header>
<soapenv:Body>
   <soapenv:Fault>
     <faultcode></faultcode>
     <faultstring>
       com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
       character 'p' (code 112) in prolog; expected '&lt;'
       at [row,col {unknown-source}]: [1,1]
     </faultstring>
     <detail />
   </soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

That's clearly a SOAP response.  And it tells you very clearly what it 
thinks you're doing wrong... it's expecting a < character (&lt;) on line 
1, position 1.  So if that's the case, sending a web form doesn't make 
much sense at all.

So please find out how the web service is SUPPOSED to work.

1) is it plain old xml (POX) where you send/receive straight XML?

2) does it use a URL encoded web form like a browser would send?

3) Is it SOAP?

These are three ALTERNATIVES, you only use one of them, don't try to 
combine them into a single program.   We need to know which one the web 
service requires.

If at all possible, please send a WSDL file.


On 5/3/2011 7:05 PM, Kwong, Henry wrote:
> I got a lots of advice, thanks for everybody.
>
> I did try to clone the exchange rate program and apply to my application. The compilation was OK, but when I executed the program, I got a HTTP 500 Internal service error. Attached is the debug log. The web service is running within our internal network. Can I any suggestion to trouble shoot the problem.
>
> Thanks again.
>
>
>
>
> Henry Kwong | Lead System Analyst
> Mattel Global IT - Managed Services
> Mattel, Inc. | 333 Continental Blvd. | El Segundo, CA 90245
> * 310-252-3205 | *  Henry.Kwong@xxxxxxxxxx
>
>
>
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Charles Wilt
> Sent: Tuesday, May 03, 2011 11:08 AM
> To: HTTPAPI and FTPAPI Projects
> Subject: Re: Need some examples to start
>
> Henry,
>
> Scott's examples are the best you're going to find.  Giving you more source isn't going to help.
>
> I suggest you take a look at some of Scott's articles on using HTTPAPI.
> http://systeminetwork.com/article/rpg-consuming-web-services-httpapi-and-soapui
> http://systeminetwork.com/article/report-weather-your-sign-screen
> http://systeminetwork.com/article/look-bank-routing-number-rpg
> http://systeminetwork.com/article/rpg-can-consume-web-services
> http://systeminetwork.com/article/rpg-web-service-consumer
> http://systeminetwork.com/article/rpg-web-service-consumer-part-2
>
> Lastly, you may want to look into a companion tool for HTTPAPI called WSDL2RPG.  With it, you don't need to understand XML or web services...
> http://systeminetwork.com/article/call-web-service-wdsl2rpg
>
> HTH,
> Charles
>
>
> On Tue, May 3, 2011 at 1:35 PM, Kwong, Henry<Henry.Kwong@xxxxxxxxxx>  wrote:
>> I have gone thru the examples. I want to find the one which is close to my application. My application is to pass a input XML string  and getting one output in XML format.
>>
>> Appreciate If anyone can let me know or share the source code.
>>
>> On May 2, 2011, at 8:55 PM, "Ron"<ron@xxxxxxxxxxxx>  wrote:
>>
>>>
>>> Check out example programs EXAMPLE1-EXAMPLE20. It's a good place to start.
>>> Keep in mind HTTPAPI is NOT an XML web services utility. It's a HTTP
>>> communications data exchange tool that lets you write programs that
>>> use web services. You'll need to learn a lot about web services (ie:
>>> HTTP headers, SOAP, XML) outside the constructs of HTTPAPI.
>>>
>>>
>>> -----Original Message-----
>>> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>>> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Kwong,
>>> Henry
>>> Sent: Monday, May 02, 2011 7:27 PM
>>> To: HTTPAPI and FTPAPI Projects
>>> Subject: Need some examples to start
>>>
>>> Hi, I am very new of using iseries to consume a web service. I have
>>> been looking through some of the examples from the HTTPAPI downloads,
>>> but still not fully understand.
>>>
>>> Can anyone have a simple example with the source code, I just want to
>>> see how the coding look like if we are going to consume a web service
>>> with an input parameter and output result set in xml format.
>>>
>>> Thanks in advance for your help.
>>>
>>>
>>> Henry Kwong | Lead System Analyst
>>> Mattel Global IT - Managed Services
>>> Mattel, Inc. | 333 Continental Blvd. | El Segundo, CA 90245
>>> * 310-252-3205 | *  Henry.Kwong@xxxxxxxxxx
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> -- 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
>> ----------------------------------------------------------------------
>> -
>>
> -----------------------------------------------------------------------
> 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
-----------------------------------------------------------------------