[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Facing 500 Internal Server Error while using HTTPAPI to call
On 10/10/06, girija patro <girija79@xxxxxxxxx> wrote:
> Hi All,
>
> I am still facing the 500 Internal Server Error from
> the web service while using Http_Url_Post. I had the
> web service people look in to the xml string I m
> sending and it seems to be ok to them. the program
> goes as below. Please have a look at it and suggest me
> what may be wornng and where should I look at.
Well, a 500 means that the problem is occuring server side. If you
can't get any debug unformation from your server, perhaps you can
recreate the problem another way. Below is a bit of Python that I use
to send hard-coded SOAP messages to my server to see what I get back:
import httplib
SOAP_MESSAGE_TEMPLATE = '''<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<%(SOAP_ACTION)s xmlns="http://%(HOST)s:%(PORT)s%(SERVICE)s">
%(SOAP_ARGS)s
</%(SOAP_ACTION)s>
</soap:Body>
</soap:Envelope>'''
HOST = 'localhost'
PORT = 8080
SERVICE = '/morph_zta/services/PartyBrokerXrefServices'
SOAP_ACTION = 'createBroker'
SOAP_ARGS = ''' <validFromDate>1999-12-21T00:00:00</validFromDate>
<validToDate>2000-05-31T13:20:00</validToDate>
<brokerShortName>BRK A</brokerShortName>
<library>ZRMORPHSB</library>
<brokerMnemonic>123456</brokerMnemonic>
<brokerCode>BKRRR</brokerCode>
<brokerName>BROKER NAME</brokerName>
<alternativeBroker>D0000</alternativeBroker>
<authenticationUser>TestUser</authenticationUser>'''
soap_message = SOAP_MESSAGE_TEMPLATE % {'HOST': HOST,
'PORT': PORT,
'SERVICE': SERVICE,
'SOAP_ACTION': SOAP_ACTION,
'SOAP_ARGS': SOAP_ARGS,}
print 'sending', soap_message
http = httplib.HTTPConnection(HOST, PORT)
http.request('POST',
SERVICE,
soap_message,
headers={'User-Agent': 'Python',
'Host': HOST,
'Content-Type': 'text/plain',
'SOAPAction': SOAP_ACTION})
response = http.getresponse()
print 'got', response.read()
Hnange this to use your SOAP message. Does this also give you a 500?
If so, then the problem is server side, whatever they may tell you.
--
Cheers,
Simon B
simon@xxxxxxxxxxxxxxxxxx
http://www.brunningonline.net/simon/blog/
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------