FRAGE: Wie kann ich eine andere Kodierung (Zeichensatz und Transfer) mit Achse verwenden?AXIS2 generiert falsche SOAP-Nachricht wegen Kodierung. wie man es repariert?
Dies ist mein Kunde:
public Object[] invoke(String xmlRepresentation)
throws CustomApplicationException {
Object[] responseWS = null;
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
options.setAction("WBSREFT");
options.setTo(new EndpointReference("http://localhost:6132"));
QName qName = new QName(XML_SCHEMA, operation);
Object[] args = new Object[] { "blablabla" };
responseWS = serviceClient.invokeBlocking(qName, args, returnTypes);
String responseAsString = (String) responseWS[0];
return responseWS;
}
ist hier der SOAPEnvelope (unter Verwendung von TCP/IP-Monitor erfaßt) erzeugt wird:
<?xml version="1.0" encoding="http://schemas.xmlsoap.org/soap/envelope/"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<WBSREFT xmlns="http://tempuri.org/LICPOCSampleService">
<arg0 xmlns="">blablabla</arg0>
</WBSREFT>
</soapenv:Body>
</soapenv:Envelope>
WARUM Axis2 diese dumme Codierung (http://schemas.xmlsoap.org/soap/envelope) erzeugt ???
Verwendung von Apache tcpmon Ich habe diese Anfrage erfasst:
POST/HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "WBSREFT"
User-Agent: Axis2
Host: 172.17.192.113:6133
Transfer-Encoding: chunked
102
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<WBSREFT xmlns="http://tempuri.org/LICPOCSampleService">
<arg0 xmlns="">to cobol</arg0>
</WBSREFT>
</soapenv:Body>
</soapenv:Envelope>0
Wenn ich die XML-Anforderung mit soapUI senden, das ist es, was tcpmon einfängt:
POST/HTTP/0.9
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 172.17.192.113:6133
Content-Length: 265
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<WBSREFT xmlns="http://tempuri.org/LICPOCSampleService">
<arg0 xmlns="">to cobol</arg0>
</WBSREFT>
</soapenv:Body>
</soapenv:Envelope>
ich diese seltsame Ausgabe bemerkt haben: 102 und 0 in der Mitte des XML ... was kann es sein?
Ich glaube, Sie sollten Geben Sie außerdem den Mindestcode ein, der die fehlerhafte SOAP-Anforderung reproduzierbar erstellt. – Tomalak
Sie veröffentlichen 3 XML-Fragmente. Nur die erste hat das seltsame/gebrochene Codierungsattribut. Wie haben Sie die letzten beiden produziert? –