You need to sign in to do that
Don't have an account?
dinagrover
J2ME web services Success but small problem
hi Guys,
We created our own SOAP API for talking to Sforce. Everything works fine, except for one or two "random" errors once in a while. One of these is following html we recieve in response:
The URL contains escaped bytes unsupported by the UTF-8 encoding.
generated by Resin-3.0.12 (built Wed, 23 Feb 2005 10:29:38 PST)
Can somebody help here?
We created our own SOAP API for talking to Sforce. Everything works fine, except for one or two "random" errors once in a while. One of these is following html we recieve in response:
The URL contains escaped bytes unsupported by the UTF-8 encoding.
generated by Resin-3.0.12 (built Wed, 23 Feb 2005 10:29:38 PST)
Can somebody help here?
Message Edited by dinagrover on 09-27-2005 06:34 AM
This is the debug string generated. Please see that first send fails, while other attempts goes ok.
<pre><code>
DEBUG:RequestString =
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:SessionHeader soapenv:mustUnderstand="0" xmlns:ns1="urn:enterprise.soap.sforce.com">
<ns2:sessionId xmlns:ns2="urn:enterprise.soap.sforce.com">wEgUKd70INVIeLLQUrxtQWEDuif3OwA2FSYRBDO1LE.fYmYGA6I8sdknLabvwlt_wZ.NJqZqD871_wjNGYFF9xhD2wYHcrlK4SNdGN37zi4=</ns2:sessionId>
</ns1:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<getDeleted xmlns="urn:enterprise.soap.sforce.com">
<sObjectType>Account</sObjectType>
<startDate xsi:type="xsd:dateTime">2005-09-30T10:35:15.370Z</startDate>
<endDate xsi:type="xsd:dateTime">2005-09-30T10:40:59.556Z</endDate>
</getDeleted>
</soapenv:Body>
</soapenv:Envelope>
Writing complete
DEBUG:ResponseString =
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
DEBUG:RequestString =
----------------------------------------- <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:SessionHeader soapenv:mustUnderstand="0" xmlns:ns1="urn:enterprise.soap.sforce.com">
<ns2:sessionId xmlns:ns2="urn:enterprise.soap.sforce.com">wEgUKd70INVIeLLQUrxtQWEDuif3OwA2FSYRBDO1LE.fYmYGA6I8sdknLabvwlt_wZ.NJqZqD871_wjNGYFF9xhD2wYHcrlK4SNdGN37zi4=</ns2:sessionId>
</ns1:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<getDeleted xmlns="urn:enterprise.soap.sforce.com">
<sObjectType>Account</sObjectType>
<startDate xsi:type="xsd:dateTime">2005-09-30T10:35:15.370Z</startDate>
<endDate xsi:type="xsd:dateTime">2005-09-30T10:40:59.556Z</endDate>
</getDeleted>
</soapenv:Body>
</soapenv:Envelope>
Writing complete
DEBUG:ResponseString =
--------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<getDeletedResponse xmlns="urn:enterprise.soap.sforce.com">
<result/>
</getDeletedResponse>
</soapenv:Body>
</soapenv:Envelope>
This is the code used to generate it:
...
hcon = ( HttpConnection )Connector.open( url, Connector.READ_WRITE );
hcon.setRequestProperty("Content-Type","text/xml; charset=utf-8");
hcon.setRequestProperty("SOAPAction","\"\"");
hcon.setRequestProperty("Expect","100-continue");
if(sforceUrl!=null)
hcon.setRequestProperty("SforceService", sforceUrl);
// set the request method to POST
hcon.setRequestMethod( HttpConnection.POST );
// obtain DataOutputStream for sending the request string
dos = hcon.openDataOutputStream();
byte[] request_body = content.getBytes("UTF-8");
// send request string to server
//System.out.println("Byte value =");
Debug.DEBUG("RequestString = \n\n\n\n ----------------------------------------- " + content);
for( int i = 0; i < request_body.length; i++ ) {
dos.writeByte( request_body[i] );
// System.out.print(request_body[i]);
}//end for( int i = 0; i < request_body.length; i++ )
//System.out.println("End Writing Byte value =");
// obtain DataInputStream for receiving server response
System.out.println("Writing complete");
dis = new DataInputStream( hcon.openInputStream());
// retrieve the response from server
int ch;
Debug.DEBUG("ResponseString = \n \n \n \n-------------------------------- ");
while( ( ch = dis.read() ) != -1 ) {
responseMessage.append( (char)ch );
System.out.print((char)ch);
}//end while( ( ch = dis.read() ) != -1 ) {
...
</pre></code>
Message Edited by dinagrover on 09-30-2005 06:29 AM
Hi Dina, I am not able to generate stub using Wireless tool's stub generator. I am getting this error -
error: the following naming conflicts occurred: hi.DescribeLayout_Type
Can you pls point me in the right direction or what am I missing. Thanks a lot in advance.