You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Bruno Negrao <bn...@gmail.com> on 2006/07/08 22:07:43 UTC

Axis2: Crazy characters being sent

Hi guys, the SOAP message generated by the code bellow is rendering
some wierd characters before and after the XML content.

Bellow is the SOAP message caught using tcpmon. Note the "102" and the
"0" before and after the XML.

POST /pfappspabxutils HTTP/1.1
User-Agent: Axis2
SOAPAction: http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa
Host: pfdesenv.planetarium.com.br:8080
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8

102
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header />
      <soapenv:Body>
         <AgendaPesquisa xmlns="http://localhost:8080/">
            <tipo>C</tipo>
         </AgendaPesquisa>
      </soapenv:Body>
   </soapenv:Envelope>0


What are these characters? the server is not responding my requests.

The code I used to generate this message is bellow:

   public static void main (String[] agrv) throws AxisFault,
MalformedURLException {
    	final EndpointReference targetEPR = new
                     EndpointReference("http://localhost:8080/pfappspabxutils");
    	try {
    		 ServiceClient client = new ServiceClient();
    		 Options options = new Options();
    		 options.setTo(targetEPR);
    		 options.setAction

("http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa");
    		 client.setOptions(options);
    		 client.sendReceive(getOMElement());
         } catch (AxisFault axisFault) {
             axisFault.printStackTrace();
         }
    }

    public static OMElement getOMElement() {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMElement method = fac.createOMElement("AgendaPesquisa", null);
        method.declareDefaultNamespace("http://localhost:8080/");
        OMElement value = fac.createOMElement("tipo", null);
        value.addChild(fac.createOMText(value, "C"));
        method.addChild(value);
        return method;
    }

thank you,
bruno

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: Crazy characters being sent

Posted by Bruno Negrao <bn...@gmail.com>.
Thanks for the info Ajith,

But the server should repond to my request if so.

How can I set the transfer-encoding to other encoding type? for
precaution i want to remove those characters from the transfer.

bruno.

On 7/10/06, Ajith Ranabahu <aj...@gmail.com> wrote:
> Hi,
> You have HTTP chunking enabled. see the header "Transfer-Encoding: chunked"
> What you see as numbers are actually the byte counts. Although you see
> these numbers in TCPMon they have nothing to do with the message and
> will be handled by the client/server appropriately.
>
> Ajith
>
> On 7/9/06, Bruno Negrao <bn...@gmail.com> wrote:
> > Guys,
> >
> > I'm sorry for reposting this message but I cannot pass this problem,
> > and this way I cannot move on in my project. Could someone try to see
> > why am I getting these "alien" characters on the wire?
> >
> > thank you.
> > bruno.
> >
> > On 7/8/06, Bruno Negrao <bn...@gmail.com> wrote:
> > > Hi guys, the SOAP message generated by the code bellow is rendering
> > > some wierd characters before and after the XML content.
> > >
> > > Bellow is the SOAP message caught using tcpmon. Note the "102" and the
> > > "0" before and after the XML.
> > >
> > > POST /pfappspabxutils HTTP/1.1
> > > User-Agent: Axis2
> > > SOAPAction: http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa
> > > Host: pfdesenv.planetarium.com.br:8080
> > > Transfer-Encoding: chunked
> > > Content-Type: text/xml; charset=UTF-8
> > >
> > > 102
> > > <?xml version='1.0' encoding='UTF-8'?>
> > >    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> > >       <soapenv:Header />
> > >       <soapenv:Body>
> > >          <AgendaPesquisa xmlns="http://localhost:8080/">
> > >             <tipo>C</tipo>
> > >          </AgendaPesquisa>
> > >       </soapenv:Body>
> > >    </soapenv:Envelope>0
> > >
> > >
> > > What are these characters? the server is not responding my requests.
> > >
> > > The code I used to generate this message is bellow:
> > >
> > >    public static void main (String[] agrv) throws AxisFault,
> > > MalformedURLException {
> > >         final EndpointReference targetEPR = new
> > >                      EndpointReference("http://localhost:8080/pfappspabxutils");
> > >         try {
> > >                  ServiceClient client = new ServiceClient();
> > >                  Options options = new Options();
> > >                  options.setTo(targetEPR);
> > >                  options.setAction
> > >
> > > ("http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa");
> > >                  client.setOptions(options);
> > >                  client.sendReceive(getOMElement());
> > >          } catch (AxisFault axisFault) {
> > >              axisFault.printStackTrace();
> > >          }
> > >     }
> > >
> > >     public static OMElement getOMElement() {
> > >         OMFactory fac = OMAbstractFactory.getOMFactory();
> > >         OMElement method = fac.createOMElement("AgendaPesquisa", null);
> > >         method.declareDefaultNamespace("http://localhost:8080/");
> > >         OMElement value = fac.createOMElement("tipo", null);
> > >         value.addChild(fac.createOMText(value, "C"));
> > >         method.addChild(value);
> > >         return method;
> > >     }
> > >
> > > thank you,
> > > bruno
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> Ajith Ranabahu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: Crazy characters being sent

Posted by Bruno Negrao <bn...@gmail.com>.
> You have HTTP chunking enabled. see the header "Transfer-Encoding: chunked"
> What you see as numbers are actually the byte counts. Although you see
> these numbers in TCPMon they have nothing to do with the message and
> will be handled by the client/server appropriately.
Ajith, I disabled the "chunked" transfer encoding and then the "crazy
characters" disapeared and the server finally answered my message. So
the chuked encoding was the problem.

I don't know if my server doesn't understand the chunked encoding or
if those characters were really sent to it, and it didn't understand
those characters...(i believe this is the problem)

Well, now I need to know how can I disable the chunked transfer
encoding programatically, because in my test I disabled it using the
debugger and setting the "chunk" variable to false in one object(I
forgot which one).

regards,

bruno

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: Crazy characters being sent

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
You have HTTP chunking enabled. see the header "Transfer-Encoding: chunked"
What you see as numbers are actually the byte counts. Although you see
these numbers in TCPMon they have nothing to do with the message and
will be handled by the client/server appropriately.

Ajith

On 7/9/06, Bruno Negrao <bn...@gmail.com> wrote:
> Guys,
>
> I'm sorry for reposting this message but I cannot pass this problem,
> and this way I cannot move on in my project. Could someone try to see
> why am I getting these "alien" characters on the wire?
>
> thank you.
> bruno.
>
> On 7/8/06, Bruno Negrao <bn...@gmail.com> wrote:
> > Hi guys, the SOAP message generated by the code bellow is rendering
> > some wierd characters before and after the XML content.
> >
> > Bellow is the SOAP message caught using tcpmon. Note the "102" and the
> > "0" before and after the XML.
> >
> > POST /pfappspabxutils HTTP/1.1
> > User-Agent: Axis2
> > SOAPAction: http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa
> > Host: pfdesenv.planetarium.com.br:8080
> > Transfer-Encoding: chunked
> > Content-Type: text/xml; charset=UTF-8
> >
> > 102
> > <?xml version='1.0' encoding='UTF-8'?>
> >    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> >       <soapenv:Header />
> >       <soapenv:Body>
> >          <AgendaPesquisa xmlns="http://localhost:8080/">
> >             <tipo>C</tipo>
> >          </AgendaPesquisa>
> >       </soapenv:Body>
> >    </soapenv:Envelope>0
> >
> >
> > What are these characters? the server is not responding my requests.
> >
> > The code I used to generate this message is bellow:
> >
> >    public static void main (String[] agrv) throws AxisFault,
> > MalformedURLException {
> >         final EndpointReference targetEPR = new
> >                      EndpointReference("http://localhost:8080/pfappspabxutils");
> >         try {
> >                  ServiceClient client = new ServiceClient();
> >                  Options options = new Options();
> >                  options.setTo(targetEPR);
> >                  options.setAction
> >
> > ("http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa");
> >                  client.setOptions(options);
> >                  client.sendReceive(getOMElement());
> >          } catch (AxisFault axisFault) {
> >              axisFault.printStackTrace();
> >          }
> >     }
> >
> >     public static OMElement getOMElement() {
> >         OMFactory fac = OMAbstractFactory.getOMFactory();
> >         OMElement method = fac.createOMElement("AgendaPesquisa", null);
> >         method.declareDefaultNamespace("http://localhost:8080/");
> >         OMElement value = fac.createOMElement("tipo", null);
> >         value.addChild(fac.createOMText(value, "C"));
> >         method.addChild(value);
> >         return method;
> >     }
> >
> > thank you,
> > bruno
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: Crazy characters being sent

Posted by Bruno Negrao <bn...@gmail.com>.
Guys,

I'm sorry for reposting this message but I cannot pass this problem,
and this way I cannot move on in my project. Could someone try to see
why am I getting these "alien" characters on the wire?

thank you.
bruno.

On 7/8/06, Bruno Negrao <bn...@gmail.com> wrote:
> Hi guys, the SOAP message generated by the code bellow is rendering
> some wierd characters before and after the XML content.
>
> Bellow is the SOAP message caught using tcpmon. Note the "102" and the
> "0" before and after the XML.
>
> POST /pfappspabxutils HTTP/1.1
> User-Agent: Axis2
> SOAPAction: http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa
> Host: pfdesenv.planetarium.com.br:8080
> Transfer-Encoding: chunked
> Content-Type: text/xml; charset=UTF-8
>
> 102
> <?xml version='1.0' encoding='UTF-8'?>
>    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>       <soapenv:Header />
>       <soapenv:Body>
>          <AgendaPesquisa xmlns="http://localhost:8080/">
>             <tipo>C</tipo>
>          </AgendaPesquisa>
>       </soapenv:Body>
>    </soapenv:Envelope>0
>
>
> What are these characters? the server is not responding my requests.
>
> The code I used to generate this message is bellow:
>
>    public static void main (String[] agrv) throws AxisFault,
> MalformedURLException {
>         final EndpointReference targetEPR = new
>                      EndpointReference("http://localhost:8080/pfappspabxutils");
>         try {
>                  ServiceClient client = new ServiceClient();
>                  Options options = new Options();
>                  options.setTo(targetEPR);
>                  options.setAction
>
> ("http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa");
>                  client.setOptions(options);
>                  client.sendReceive(getOMElement());
>          } catch (AxisFault axisFault) {
>              axisFault.printStackTrace();
>          }
>     }
>
>     public static OMElement getOMElement() {
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMElement method = fac.createOMElement("AgendaPesquisa", null);
>         method.declareDefaultNamespace("http://localhost:8080/");
>         OMElement value = fac.createOMElement("tipo", null);
>         value.addChild(fac.createOMText(value, "C"));
>         method.addChild(value);
>         return method;
>     }
>
> thank you,
> bruno
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org