I am programming an app that is going to function as a existing PC program. It connects to a machine's SOAP web service to get data.
I got it running and communicating with the machine but when I try my program on a slightly newer machine with updated software I only receive "400 Bad Request". I tried the PC program and it can communicate without problem.
I'm using WireShark to monitor the communication and I can verify the XML SOAP request is identical between my program and the PC software.
The differences is in the header.
Due to the sensitive nature of my project I have altered some names.
The differences in the header are:
APPOST / HTTP/1.1
PCPOST * HTTP/1.1
DIF: "/" instead of "*"
APP add a space after the ":"
APP add "HOST:"
Is there anyway that I can exactly control how the Header looks like?
/J
I got it running and communicating with the machine but when I try my program on a slightly newer machine with updated software I only receive "400 Bad Request". I tried the PC program and it can communicate without problem.
I'm using WireShark to monitor the communication and I can verify the XML SOAP request is identical between my program and the PC software.
The differences is in the header.
Due to the sensitive nature of my project I have altered some names.
My app sending:
POST / HTTP/1.1
Content-Type: text/xml;charset=ISO-8859-1
SOAPAction: http://www.death.star/laser/command#ReadRequest
Content-Length: 469
Host: 10.10.10.2:500
Connection: Keep-Alive
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><AP-MSG:ReadRequest xmlns:AP-MSG="http://www.death.star/laser/command" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><RequestBase ClientRequestHandle="1" ReturnItemTime="true" ReturnItemName="true"/><ItemRequestSpec MaxAge="PT0.1S"/><ItemList><Item ItemName="Death.Star.Laser.UnitID"/></ItemList></AP-MSG:ReadRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
From machine:
HTTP/1.1 400 Bad Request
Content-Type: text/xml; charset=ISO-8859-1
Content-Length: 0
PC Program sending:
POST * HTTP/1.1
Content-Type:text/xml;charset=ISO-8859-1
Connection:Keep-Alive
SOAPAction:http://www.death.star/laser/command#ReadRequest
Content-Length:469
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><AP-MSG:ReadRequest xmlns:AP-MSG="http://www.death.star/laser/command" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><RequestBase ClientRequestHandle="1" ReturnItemTime="true" ReturnItemName="true"/><ItemRequestSpec MaxAge="PT0.1S"/><ItemList><Item ItemName="Death.Star.Laser.UnitID"/></ItemList></AP-MSG:ReadRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
From Machine:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=ISO-8859-1
Content-Length: 583
Data comes here.....
The differences in the header are:
APPOST / HTTP/1.1
PCPOST * HTTP/1.1
DIF: "/" instead of "*"
APP add a space after the ":"
APP add "HOST:"
Is there anyway that I can exactly control how the Header looks like?
/J
Last edited: