[ 
http://issues.apache.org/jira/browse/AXIS2-767?page=comments#action_12413779 ] 

Deepal Jayasinghe commented on AXIS2-767:
-----------------------------------------

I did the following and did not able to regenerate the problem can you please 
explain me how to regenerate the issue.

My Client code look like below;

 Adding string headers: 

 public static final EndpointReference targetEPR = new EndpointReference(
            "http://127.0.0.1:8000/axis2/services/Sample";);

    public static void main(String[] args) throws Exception {
        OMElement payload = createDummyOMElement("echoElement1");
        Options options = new Options();
        options.setTo(targetEPR);
        ServiceClient sc = new ServiceClient(null , null);
        sc.addStringHeader(new QName("qname"), "Header text");
        //sc.addHeader(createDummyOMElement("echoElement1"));
        sc.setOptions(options);
        OMElement res = sc.sendReceive(payload);
        System.out.println("res = " + res);
    }

    public static OMElement createDummyOMElement(String opName) {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd";, 
"ns1");
        OMElement method = fac.createOMElement(opName, omNs);
        OMElement value = fac.createOMElement("myValue", omNs);
        value.addChild(
                fac.createOMText(value, "Isaac Asimov, The Foundation 
Trilogy"));
        method.addChild(value);
        return method;
    }

Req : 
POST /axis2/services/Sample HTTP/1.1
User-Agent: Axis2
SOAPAction: ""
Host: 127.0.0.1
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8

169
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
      <soapenv:Header>
         <qname>Header text</qname>
      </soapenv:Header>
      <soapenv:Body>
         <ns1:echoElement1 xmlns:ns1="http://org.apache.axis2/xsd";>
            <ns1:myValue>Isaac Asimov, The Foundation Trilogy</ns1:myValue>
         </ns1:echoElement1>
      </soapenv:Body>
   </soapenv:Envelope>0


Res : 
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8
Set-Cookie: urn:uuid:99B7C61BA9D17CF26911489769562187
Set-Cookie2: urn:uuid:99B7C61BA9D17CF26911489769562187

167
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
      <soapenv:Header />
      <soapenv:Body>
         <ns1:echoElement1 xmlns:ns1="http://org.apache.axis2/xsd"; 
xmlns:tns="http://ws.apache.org/axis2";>
            <ns1:myValue>Isaac Asimov, The Foundation Trilogy</ns1:myValue>
         </ns1:echoElement1>
      </soapenv:Body>
   </soapenv:Envelope>
0


Adding OMElement
 client class;
 public static void main(String[] args) throws Exception {
        OMElement payload = createDummyOMElement("echoElement1");
        Options options = new Options();
        options.setTo(targetEPR);
        ServiceClient sc = new ServiceClient(null , null);
        sc.addHeader(createDummyOMElement("echoElement1"));
        sc.setOptions(options);
        OMElement res = sc.sendReceive(payload);
        System.out.println("res = " + res);
    }

Req : 

POST /axis2/services/Sample HTTP/1.1
User-Agent: Axis2
SOAPAction: ""
Host: 127.0.0.1
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8

1db
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
      <soapenv:Header>
         <ns1:echoElement1 xmlns:ns1="http://org.apache.axis2/xsd";>
            <ns1:myValue>Isaac Asimov, The Foundation Trilogy</ns1:myValue>
         </ns1:echoElement1>
      </soapenv:Header>
      <soapenv:Body>
         <ns1:echoElement1 xmlns:ns1="http://org.apache.axis2/xsd";>
            <ns1:myValue>Isaac Asimov, The Foundation Trilogy</ns1:myValue>
         </ns1:echoElement1>
      </soapenv:Body>
   </soapenv:Envelope>0

Res: 
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8
Set-Cookie: urn:uuid:99B7C61BA9D17CF269114897710170710
Set-Cookie2: urn:uuid:99B7C61BA9D17CF269114897710170710

167
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
      <soapenv:Header />
      <soapenv:Body>
         <ns1:echoElement1 xmlns:ns1="http://org.apache.axis2/xsd"; 
xmlns:tns="http://ws.apache.org/axis2";>
            <ns1:myValue>Isaac Asimov, The Foundation Trilogy</ns1:myValue>
         </ns1:echoElement1>
      </soapenv:Body>
   </soapenv:Envelope>
0


> ServiceClient.addStringHeader()
> -------------------------------
>
>          Key: AXIS2-767
>          URL: http://issues.apache.org/jira/browse/AXIS2-767
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>     Versions: 1.0
>  Environment: Windows XP SP2, Java Sun JDK 1.5.0_03, ant 1.6.5
>     Reporter: Michele Mazzucco
>     Assignee: Deepal Jayasinghe
>     Priority: Critical

>
> The calls ServiceClient.addStringHeader() and ServiceClient.addHeader() cause 
> the message to be not received.
> Using tcpmon and the MyService sample (provided with Axis2) you get:
> 1) no headers added:
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Set-Cookie: JSESSIONID=CF2A6A3A366706087FBBD8818E91A62C; Path=/axis2
> Content-Type: multipart/related;
> boundary=MIMEBoundaryurn_uuid_1CAAD3F62EB8F21F2011478815557861;
> type="application/xop+xml";
> start="<0.urn:uuid:[EMAIL PROTECTED]>";
> start-info="text/xml";charset=UTF-8
> Transfer-Encoding: chunked
> Date: Wed, 17 May 2006 15:59:15 GMT
> 23e
> --MIMEBoundaryurn_uuid_1CAAD3F62EB8F21F2011478815557861
> content-type:application/xop+xml; charset=UTF-8; type="text/xml";
> content-transfer-encoding:binary
> content-id:<0.urn:uuid:[EMAIL PROTECTED]>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header
> /><soapenv:Body><example1:echo
> xmlns:example1="http://example1.org/example1";
> xmlns:tns="http://ws.apache.org/axis2";><example1:Text>Axis2 Echo String
> </example1:Text></example1:echo></soapenv:Body></soapenv:Envelope>
> 3b
> --MIMEBoundaryurn_uuid_1CAAD3F62EB8F21F2011478815557861--
> 0
> 2) sender.addHeader(OMElement), where the OMElement is very similar to
> the object returned by ClientUtil.getEchoElement():
> HTTP/1.1 500 Internal Server Error
> Server: Apache-Coyote/1.1
> Content-Type: text/html;charset=utf-8
> Content-Length: 2118
> Date: Wed, 17 May 2006 16:01:31 GMT
> Connection: close
> <html><head><title>Apache Tomcat/5.5.15 - Error
> report</title><style><!--H1
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
> H2
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
> H3
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
> BODY
> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
> B
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
> P
> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
> {color : black;}A.name {color : black;}HR {color : #525D76;}--></style>
> </head><body><h1>HTTP Status 500 - </h1><HR size="1"
> noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b>
> <u></u></p><p><b>description</b> <u>The server encountered an internal
> error () that prevented it from fulfilling this
> request.</u></p><p><b>exception</b>
> <pre>org.apache.axiom.om.OMException:
> com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character
> '&gt;' (code 62) expected '='
>  at [row,col {unknown-source}]: [1,226]
>       
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
>       
> org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:263)
>       
> org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.next(OMChildrenQNameIterator.java:101)
>       
> org.apache.axiom.om.impl.llom.OMElementImpl.getFirstChildWithName(OMElementImpl.java:223)
>       
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getHeader(SOAPEnvelopeImpl.java:76)
>       
> org.apache.axis2.engine.AxisEngine.createFaultMessageContext(AxisEngine.java:194)
>       
> org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:168)
>       org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:153)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> </pre></p><p><b>note</b> <u>The full stack trace of the root cause is
> available in the Apache Tomcat/5.5.15 logs.</u></p><HR size="1"
> noshade="noshade"><h3>Apache Tomcat/5.5.15</h3></body></html>
> 3) sender.addStringHeader(new QName("qname"), "Header text"):
> HTTP/1.1 500 Internal Server Error
> Server: Apache-Coyote/1.1
> Content-Type: text/html;charset=utf-8
> Content-Length: 1857
> Date: Wed, 17 May 2006 16:06:42 GMT
> Connection: close
> <html><head><title>Apache Tomcat/5.5.15 - Error
> report</title><style><!--H1
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
> H2
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
> H3
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
> BODY
> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
> B
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
> P
> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
> {color : black;}A.name {color : black;}HR {color : #525D76;}--></style>
> </head><body><h1>HTTP Status 500 - </h1><HR size="1"
> noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b>
> <u></u></p><p><b>description</b> <u>The server encountered an internal
> error () that prevented it from fulfilling this
> request.</u></p><p><b>exception</b> <pre>java.lang.NullPointerException
>       
> org.apache.axiom.soap.impl.llom.SOAPHeaderImpl.getHeaderBlocksWithNSURI(SOAPHeaderImpl.java:217)
>       
> org.apache.axis2.handlers.addressing.AddressingInHandler.invoke(AddressingInHandler.java:64)
>       org.apache.axis2.engine.Phase.invoke(Phase.java:378)
>       org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:492)
>       org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:462)
>       
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:283)
>       org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:137)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> </pre></p><p><b>note</b> <u>The full stack trace of the root cause is
> available in the Apache Tomcat/5.5.15 logs.</u></p><HR size="1"
> noshade="noshade"><h3>Apache Tomcat/5.5.15</h3></body></html>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to