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

RE: Need some examples to start



Thanks Scott 

I have attached the WSDL from our .net group, they confessed that this
is their first time to create web service from their .net application.
It may be very likely that we are all mess up with the interface
standard. 

As a starter, I am sorry to post some stupid questions, but this is my
intention to learn from you guys. 


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 Scott
Klement
Sent: Tuesday, May 03, 2011 9:31 PM
To: HTTPAPI and FTPAPI Projects
Subject: 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-a
> nd-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
-----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:axis2="http://mattelpdmd:8095/axis2/services/PDMApplicationService"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns:ns1="http://org.apache.axis2/xsd"; xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"; xmlns:ns="http://mattelpdmd:8095/axis2/services/PDMApplicationService/xsd"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; targetNamespace="http://mattelpdmd:8095/axis2/services/PDMApplicationService";>
    <wsdl:documentation>PDMApplicationService</wsdl:documentation>
    <wsdl:types>
        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://mattelpdmd:8095/axis2/services/PDMApplicationService/xsd";>
            <xs:element name="processService">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="PDMServiceInput" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="processServiceResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="processServiceRequest">
        <wsdl:part name="parameters" element="ns:processService"/>
    </wsdl:message>
    <wsdl:message name="processServiceResponse">
        <wsdl:part name="parameters" element="ns:processServiceResponse"/>
    </wsdl:message>
    <wsdl:portType name="PDMApplicationServicePortType">
        <wsdl:operation name="processService">
            <wsdl:input message="axis2:processServiceRequest" wsaw:Action="urn:processService"/>
            <wsdl:output message="axis2:processServiceResponse" wsaw:Action="urn:processServiceResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="PDMApplicationServiceSoap11Binding" type="axis2:PDMApplicationServicePortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
        <wsdl:operation name="processService">
            <soap:operation soapAction="urn:processService" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="PDMApplicationServiceSoap12Binding" type="axis2:PDMApplicationServicePortType">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
        <wsdl:operation name="processService">
            <soap12:operation soapAction="urn:processService" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="PDMApplicationServiceHttpBinding" type="axis2:PDMApplicationServicePortType">
        <http:binding verb="POST"/>
        <wsdl:operation name="processService">
            <http:operation location="PDMApplicationService/processService"/>
            <wsdl:input>
                <mime:content type="text/xml" part="processService"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="processService"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="PDMApplicationService">
        <wsdl:port name="PDMApplicationServiceHttpSoap11Endpoint" binding="axis2:PDMApplicationServiceSoap11Binding">
            <soap:address location="http://192.168.51.150:8095/axis2/services/PDMApplicationService.PDMApplicationServiceHttpSoap11Endpoint/"/>
        </wsdl:port>
        <wsdl:port name="PDMApplicationServiceHttpSoap12Endpoint" binding="axis2:PDMApplicationServiceSoap12Binding">
            <soap12:address location="http://192.168.51.150:8095/axis2/services/PDMApplicationService.PDMApplicationServiceHttpSoap12Endpoint/"/>
        </wsdl:port>
        <wsdl:port name="PDMApplicationServiceHttpEndpoint" binding="axis2:PDMApplicationServiceHttpBinding">
            <http:address location="http://192.168.51.150:8095/axis2/services/PDMApplicationService.PDMApplicationServiceHttpEndpoint/"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------