Hi Thomas.
I found something strange in the Jboss code. Can you explain me what happens
there? What's the main difference between library versions? Is it possible to
'patch' it?
I'm using JbossWS libs from the
\jboss-4.0.1\server\default\deploy\jboss-ws4ee.sar\
I'm not sure if I use correct libraries... Correct me if I'm wrong.
As I told I was exploring sforce.com Axis examples. Their example works with
Axis 1.2rc2 but doesn't work with JbossWS.
They have a code which sets SessionID into the SAOP header for the subsequent
WS calls. Session Id is gotten from the first 'login' command.
It is described as
| public class SoapBindingStub
| extends org.apache.axis.client.Stub
| implements com.sforce.soap.enterprise.Soap
| ........
|
| com.sforce.soap.enterprise.SoapBindingStub binding;
| ....
|
They are using the 'simple java bean Handler class for setting Session ID
| public class _SessionHeader implements java.io.Serializable {
| private java.lang.String sessionId;
| ....
| }
|
| com.sforce.soap.enterprise._SessionHeader sh = new _SessionHeader();
| ....
| binding.setHeader(new
SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh);
|
Class org.apache.axis.client.Stub
from the
\jboss-src-4.0.1\jaxrpc\src\main\org\apache\axis\client\Stub.java
doesn't have method with such signature.
| org.apache.axis.client.Stub.setHeader(String, String, Object);
|
althought that signature is present in the Axis 1.2RC2
So I use changed code assuming it will work
| binding.setHeader(new
SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader",
sh.getSessionId());
|
but it doesn't work.
When I try to get this Header's value
| Object sessionHeaderObject = s._getProperty("SessionHeader");
|
sessionHeaderObject is NULL.
----------------------
I was trying to get all headers using different libaries (JbossWS 4.0.1, Axis
1.2RC2. I used CODE like that:
| org.apache.axis.message.SOAPHeaderElement{} array = binding.getHeaders();
| for (int i = 0; i < array.length; i++) {
| SOAPHeaderElementImpl soapHeaderElement = array{i};
| javax.xml.soap.SOAPHeaderElement soapHeaderElement =
array{i};
| System.out.println("SAOP header element = " +
soapHeaderElement.toString());
| System.out.println("SAOP header getNamespaceURI = " +
soapHeaderElement.getNamespaceURI());
| System.out.println("SAOP header getPrefix = " +
soapHeaderElement.getPrefix());
| System.out.println("SAOP header element = " +
soapHeaderElement.toString());
| }
|
I was getting different RESULTS using :
class type of javax.xml.soap.SOAPHeaderElement from Axis 1.2RC2
| SAOP header element = <ns1:SessionHeader
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xsi:type="xsd:string"
xmlns:ns1="urn:enterprise.soap.sforce.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">njRq6Ptg37ohqutyqzZdicUzejphrTZe90b6Yx3XBYtMNeGJRcxMpik7n0_TXAXxHikyGE8ui0DF16GKmkejIzteaH1xyGi1</ns1:SessionHeader>
| SAOP header getNamespaceURI = urn:enterprise.soap.sforce.com
| SAOP header getPrefix = null
| SAOP header element = <ns1:SessionHeader
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xsi:type="xsd:string"
xmlns:ns1="urn:enterprise.soap.sforce.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">njRq6Ptg37ohqutyqzZdicUzejphrTZe90b6Yx3XBYtMNeGJRcxMpik7n0_TXAXxHikyGE8ui0DF16GKmkejIzteaH1xyGi1</ns1:SessionHeader>
|
/b]CODE for class type of org.apache.axis.message.SOAPHeaderElement from Axis
1.2RC2
| org.apache.axis.message.SOAPHeaderElement soapHeaderElement = array{i};
| System.out.println("SAOP header element = " +
soapHeaderElement.toString());
| System.out.println("SAOP header getName = " + soapHeaderElement.getName());
| System.out.println("SAOP header getNamespaceURI = " +
soapHeaderElement.getNamespaceURI());
| System.out.println("SAOP header getObjectValue = " +
soapHeaderElement.getObjectValue());
| System.out.println("SAOP header getPrefix = " +
soapHeaderElement.getPrefix());
| System.out.println("SAOP header element = " +
soapHeaderElement.toString());
|
RESULT for class type of org.apache.axis.message.SOAPHeaderElement from Axis
1.2RC2 is:
| SAOP header element = <ns1:SessionHeader
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xsi:type="xsd:string"
xmlns:ns1="urn:enterprise.soap.sforce.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">X6K9mxCxCwt8VslHrxCERNHOJbcgz5NySWCriQPvp6vnupNeluKZg6fMFpj6VJCNAZMpziQrc6T7Brk1325sIjteaH1xyGi1</ns1:SessionHeader>
| SAOP header getName = SessionHeader
| SAOP header getNamespaceURI = urn:enterprise.soap.sforce.com
| SAOP header getObjectValue =
X6K9mxCxCwt8VslHrxCERNHOJbcgz5NySWCriQPvp6vnupNeluKZg6fMFpj6VJCNAZMpziQrc6T7Brk1325sIjteaH1xyGi1
| SAOP header getPrefix = null
| SAOP header element = <ns1:SessionHeader
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xsi:type="xsd:string"
xmlns:ns1="urn:enterprise.soap.sforce.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">X6K9mxCxCwt8VslHrxCERNHOJbcgz5NySWCriQPvp6vnupNeluKZg6fMFpj6VJCNAZMpziQrc6T7Brk1325sIjteaH1xyGi1</ns1:SessionHeader>
|
CODE using JbossWS is
| org.apache.axis.message.SOAPHeaderElementImpl{} array =
binding.getHeaders();
| for (int i = 0; i < array.length; i++) {
| org.apache.axis.message.SOAPHeaderElementImpl
soapHeaderElement = array{i}
| System.out.println("SAOP header element = " +
soapHeaderElement.toString());
| System.out.println("SAOP header getAsString = " +
soapHeaderElement.getAsString());
| System.out.println("SAOP header getName = " +
soapHeaderElement.getName());
| System.out.println("SAOP header getNamespaceURI = " +
soapHeaderElement.getNamespaceURI());
| System.out.println("SAOP header getObjectValue = " +
soapHeaderElement.getObjectValue());
| System.out.println("SAOP header getPrefix = " +
soapHeaderElement.getPrefix());
| System.out.println("SAOP header element = " +
soapHeaderElement.toString());
| }
|
The RESULT using JBossWS class type of
org.apache.axis.message.SOAPHeaderElementImpl
| SAOP header element = [EMAIL PROTECTED]: null]]
| SAOP header getAsString = <ns1:SessionHeader
xmlns:ns1="urn:enterprise.soap.sforce.com">HCY0lblqY8J7iTWfZvb5VALuJklpiwyZHBUlvW_pzick2FdSniwTfhLxCr4jqCGRmwjD7ZX3V5tecUgw5Q7gPDteaH1xyGi1</ns1:SessionHeader>
| SAOP header getName = SessionHeader
| SAOP header getNamespaceURI = urn:enterprise.soap.sforce.com
| SAOP header getObjectValue =
HCY0lblqY8J7iTWfZvb5VALuJklpiwyZHBUlvW_pzick2FdSniwTfhLxCr4jqCGRmwjD7ZX3V5tecUgw5Q7gPDteaH1xyGi1
| SAOP header getPrefix = null
| SAOP header element = [EMAIL PROTECTED]: null]]
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3869418#3869418
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3869418
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user