unsubscribe

2016-11-14 Thread Dinshaw, Afshad


From: Sterpu Victor [mailto:vic...@caido.ro]
Sent: Monday, November 14, 2016 3:59 PM
To: Martin Gainty ; java-user@axis.apache.org
Subject: Re[4]: Raw SOAP XML response

I tired your code but I got a problem. This is what I wrote(I don't have a 
axis2.xml file, I just create the stub with wsdl2java and used the class):
ConfigurationContext configContext = 
ConfigurationContextFactory.createDefaultConfigurationContext();
ServiceClient sender = new ServiceClient(configContext, null);
OperationClient mepClient = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
MessageContext 
response=mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
String response_xml = response.getEnvelope().toString();

These lines are executed immediatly after the succesful SOAP call and I receive 
a java.lang.NullPointerException at the line "String response_xml = 
response.getEnvelope().toString();".
I traced the SOAP response with Fiddler and the answer is "http://schemas.xmlsoap.org/soap/envelope/;>http://www.w3.org/2001/XMLSchema-instance;>"

Thank you.

-- Original Message --
From: "Martin Gainty" >
To: "java-user@axis.apache.org" 
>; "Sterpu Victor" 
>
Sent: 2/11/2016 9:28:48 PM
Subject: Re: Re[2]: Raw SOAP XML response



From: Sterpu Victor >
Sent: Wednesday, November 2, 2016 11:57 AM
To: Martin Gainty; java-user@axis.apache.org
Subject: Re[2]: Raw SOAP XML response

It didn't work.
This is what I did: I deleted from the directory of Axis2\lib 4 files: 
axiom-jaxb-1.2.19.jar, axiom-api-1.2.19.jar, axiom-dom-1.2.19.jar, 
axiom-impl-1.2.19.jar
and I added these 4 files: 
axiom-api-1.2.20.jar,axiom-dom-1.2.20.jar,axiom-impl-1.2.20.jar,axiom-jaxb-1.2.20.jar.
I use Axis embeded so I also deleted from my netbeans libraries the old jars 
and added the new ones.
I recompiled and the error remained.


-- Original Message --
From: "Martin Gainty" >
To: "java-user@axis.apache.org" 
>; "Sterpu Victor" 
>
Sent: 2/11/2016 4:58:09 PM
Subject: Re: Raw SOAP XML response

possible outdated version of axiom

 * In Axiom versions prior to 1.2.9, the sequence of events was 
inconsistent if the
 * underlying stream is XOP encoded and caching is disabled (see 
WSCOMMONS-485).
 * This made it necessary for the caller to (partially) handle the XOP 
processing and to use
 * {@link OMAttachmentAccessor#getDataHandler(String)} to retrieve the 
binary content.
 * Starting with 1.2.9 this is no longer be the case: as specified above,
 * the sequence of events is *independent of the state of the object model*
 * and the value of the cache parameter,
 * and ALL binary content is reported through the
 * {@link org.apache.axiom.ext.stax.datahandler.DataHandlerReader} 
(embedded in axiom-api) extension.

upgrade axiom to 1.2.9 a recompile, package, deploy and run with 1.2.9 should 
mitigate the error you are now receiving

*please keep us apprised*

Martin
__


From: Sterpu Victor >
Sent: Wednesday, November 2, 2016 9:37 AM
To: java-user@axis.apache.org
Subject: Raw SOAP XML response

Hello

I need to save the raw SOAP XML response from Axis2(I use axis 2 1.7.3).
When Axis2 call retusrns an error this code works:
String response = 
sc.getLastOperationContext().getMessageContext("In").getEnvelope().toString();

MG>//build configurationContext from location of repo and name of axis2.xml
MG> ConfigurationContext configContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem("../../repository",  //exact location 
of repository
"axis2.xml");   //exact filename of axis2.xml

MG>establish new ServiceClient implementing attributes from ConfigurationContext
MG> ServiceClient sender = new ServiceClient(configContext, null);

MG>you will need to supply a QName for incoming request and SOAP response output
/**
 * Operation name used for an anonymous in-out operation (meaning we sent a 
message and receive
 * a response, equivalent to a WSDL In-Out operation).

public static final QName ANON_OUT_IN_OP = new 
QName(Constants.AXIS2_NAMESPACE_URI,
 "anonOutInOp",
 
Constants.AXIS2_NAMESPACE_PREFIX);
*/
MG>OperationClient mepClient = 
sender.createClient(ServiceClient.ANON_OUT_IN_OP);

MG>ask client to contact 

Re[4]: Raw SOAP XML response

2016-11-14 Thread Sterpu Victor
I tired your code but I got a problem. This is what I wrote(I don't have 
a axis2.xml file, I just create the stub with wsdl2java and used the 
class):
ConfigurationContext configContext = 
ConfigurationContextFactory.createDefaultConfigurationContext();

ServiceClient sender = new ServiceClient(configContext, null);
OperationClient mepClient = 
sender.createClient(ServiceClient.ANON_OUT_IN_OP);
MessageContext 
response=mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

String response_xml = response.getEnvelope().toString();

These lines are executed immediatly after the succesful SOAP call and I 
receive a java.lang.NullPointerException at the line "String 
response_xml = response.getEnvelope().toString();".
I traced the SOAP response with Fiddler and the answer is "version="1.0" encoding="UTF-8"?>xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/;>xmlns:dlwmin="core.des.uti.ro" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>"


Thank you.

-- Original Message --
From: "Martin Gainty" 
To: "java-user@axis.apache.org" ; "Sterpu 
Victor" 

Sent: 2/11/2016 9:28:48 PM
Subject: Re: Re[2]: Raw SOAP XML response





From: Sterpu Victor 
Sent: Wednesday, November 2, 2016 11:57 AM
To: Martin Gainty; java-user@axis.apache.org
Subject: Re[2]: Raw SOAP XML response

It didn't work.
This is what I did: I deleted from the directory of Axis2\lib 4 files: 
axiom-jaxb-1.2.19.jar, axiom-api-1.2.19.jar, axiom-dom-1.2.19.jar, 
axiom-impl-1.2.19.jar
and I added these 4 files: 
axiom-api-1.2.20.jar,axiom-dom-1.2.20.jar,axiom-impl-1.2.20.jar,axiom-jaxb-1.2.20.jar.
I use Axis embeded so I also deleted from my netbeans libraries the old 
jars and added the new ones.

I recompiled and the error remained.


-- Original Message --
From: "Martin Gainty" 
To: "java-user@axis.apache.org" ; "Sterpu 
Victor" 

Sent: 2/11/2016 4:58:09 PM
Subject: Re: Raw SOAP XML response


possible outdated version of axiom




 * In Axiom versions prior to 1.2.9, the sequence of events was 
inconsistent if the
 * underlying stream is XOP encoded and caching is disabled (see 
WSCOMMONS-485).
 * This made it necessary for the caller to (partially) handle the 
XOP processing and to use
 * {@link OMAttachmentAccessor#getDataHandler(String)} to retrieve 
the binary content.
 * Starting with 1.2.9 this is no longer be the case: as specified 
above,
 * the sequence of events is *independent of the state of the 
object model*

 * and the value of the cache parameter,
 * and ALL binary content is reported through the
 * {@link org.apache.axiom.ext.stax.datahandler.DataHandlerReader} 
(embedded in axiom-api) extension.



upgrade axiom to 1.2.9 a recompile, package, deploy and run with 1.2.9 
should mitigate the error you are now receiving


*please keep us apprised*



Martin
__



From: Sterpu Victor 
Sent: Wednesday, November 2, 2016 9:37 AM
To:java-user@axis.apache.org
Subject: Raw SOAP XML response

Hello

I need to save the raw SOAP XML response from Axis2(I use axis 2 
1.7.3).

When Axis2 call retusrns an error this code works:
String response = 
sc.getLastOperationContext().getMessageContext("In").getEnvelope().toString();


MG>//build configurationContext from location of repo and name of 
axis2.xml

MG>ConfigurationContext configContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem("../../repository",  //exact 
location of repository

"axis2.xml");   //exact filename of axis2.xml

MG>establish new ServiceClient implementing attributes from 
ConfigurationContext

MG>ServiceClient sender = new ServiceClient(configContext, null);

MG>you will need to supply a QName for incoming request and SOAP 
response output

/**
 * Operation name used for an anonymous in-out operation (meaning 
we sent a message and receive

 * a response, equivalent to a WSDL In-Out operation).

public static final QName ANON_OUT_IN_OP = new 
QName(Constants.AXIS2_NAMESPACE_URI,
 
"anonOutInOp",
 
Constants.AXIS2_NAMESPACE_PREFIX);

*/
MG>OperationClient mepClient = 
sender.createClient(ServiceClient.ANON_OUT_IN_OP);


MG>ask client to contact axis2 server and pull a response back
MG>MessageContext 
response=mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE));

/**
 *MESSAGE_LABEL_IN_VALUE Constant to represent the message label 
"In" which is used by the
 * following WSDL 2.0 defined MEPs: In-Only, Robust In-Only, 
In-Out, //Hint: In-Out is your 

Re[2]: Axis2 , 2 Way SSL and Fiddler

2016-11-14 Thread Sterpu Victor

I solved it, it was not a Axis2 problem.
When I produced the PKCS7 signature I reinitialized my PKCS11 object and 
lost the connection to the token.



-- Original Message --
From: "Martin Gainty" 
To: "java-user@axis.apache.org" ; "Sterpu 
Victor" 

Sent: 14/11/2016 6:36:40 PM
Subject: Re: Axis2 , 2 Way SSL and Fiddler




verify you have PKCS7  Cryptography libraries installed in your OS *you 
didnt mention your OS
so I am unable to guide you in the PKCS7 Cryptography libraries you 
may/may not have*




verify you have unlimited strength JCE jars installed



http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

Java Cryptography Extension (JCE) Unlimited Strength ...
www.oracle.com
Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction 
Policy Files for JDK/JRE 8 Download






export your certificate to pem format



openssl x509 -in  -inform der -outform pem -out 




deskcheck certificate input pem and validate attributes with your 
Security Admin



openssl x509 -in NameOfPem.pem -text
display cert in pem format inline here or attach pem in reply



Martin
__




From: Sterpu Victor 
Sent: Sunday, November 13, 2016 7:36 PM
To: java-user
Subject: Axis2 , 2 Way SSL and Fiddler

Hello

I'm testing Axis2 with 2 way SSL for a few weeks and in my tests I 
always used Fiddler to debug.
Everything went fine but now I must move to production and I stopped 
fiddler and removed these lines:

System.setProperty("https.proxyHost", "127.0.0.1");
System.setProperty("https.proxyPort", "");

An I almost got a heat attack, I'm in a big time crisis and I can't 
make Axis2 work without Fiddler, I receive the error: 
"org.apache.axis2.AxisFault: Connection has been shutdown: 
javax.net.ssl.SSLHandshakeException: Error signing certificate verify".
And somewere at the end: "java.security.InvalidKeyException: 
Unsupported key type: SunPKCS11-SmartCard RSA private key, 2048 bits 
(id 65541, token object, sensitive, unextractable)"

At the end of the mail I pasted all the trace.

Some services are working, but the service that doesn't work sends a 
PKCS7 signature to the server. I create the PKCS7 signature using the 
same PKCS11 token that I use to comunicate 2 way SSL to the server.
This is reproductible behaviour, always when I activate Fiddler, Axis2 
works. And only services where I use PKCS7 signature don't work.


Do you have any advice? I have no idea what to do.
I attached the whole stub that I generated with the command 
"wsdl2java.bat -uri tmp\StoreClinicalDocument.wsdl -p 
stubs.StoreClinicalDocument.client -s -sd -ssi -o 
tmp\build_StoreClinicalDocument\client" and I attached the wsdl file.


Thank you.



SEVERE: null
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

 at java.lang.reflect.Method.invoke(Method.java:498)
 at 
SoapUtils.Axis2ReflectionBuilder.executeMethod(Axis2ReflectionBuilder.java:295)

 at SoapUtils.Soap.executeMethod(Soap.java:225)
 at Util.DES.ExportDES.FOCG_TransmiteDES(ExportDES.java:193)
 at 
GenericDBCarier.CustomFunctions$44$15.call(CustomFunctions.java:5346)

 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

 at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.axis2.AxisFault: Connection has been shutdown: 
javax.net.ssl.SSLHandshakeException: Error signing certificate verify

 at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
 at 
org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78)
 at 
org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:85)
 at 
org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
 at 
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
 at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
 at 
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
 at 
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
 at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
 at 
org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.executeMethod(HTTPSenderImpl.java:872)
 at 

Re: Axis2 , 2 Way SSL and Fiddler

2016-11-14 Thread Martin Gainty

verify you have PKCS7  Cryptography libraries installed in your OS *you didnt 
mention your OS
so I am unable to guide you in the PKCS7 Cryptography libraries you may/may not 
have*


verify you have unlimited strength JCE jars installed


http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

Java Cryptography Extension (JCE) Unlimited Strength 
...
www.oracle.com
Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 
for JDK/JRE 8 Download




export your certificate to pem format


openssl x509 -in  -inform der -outform pem -out 


deskcheck certificate input pem and validate attributes with your Security Admin

openssl x509 -in NameOfPem.pem -text
display cert in pem format inline here or attach pem in reply


Martin
__




From: Sterpu Victor 
Sent: Sunday, November 13, 2016 7:36 PM
To: java-user
Subject: Axis2 , 2 Way SSL and Fiddler

Hello

I'm testing Axis2 with 2 way SSL for a few weeks and in my tests I always used 
Fiddler to debug.
Everything went fine but now I must move to production and I stopped fiddler 
and removed these lines:
System.setProperty("https.proxyHost", "127.0.0.1");
System.setProperty("https.proxyPort", "");

An I almost got a heat attack, I'm in a big time crisis and I can't make Axis2 
work without Fiddler, I receive the error: "org.apache.axis2.AxisFault: 
Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Error 
signing certificate verify".
And somewere at the end: "java.security.InvalidKeyException: Unsupported key 
type: SunPKCS11-SmartCard RSA private key, 2048 bits (id 65541, token object, 
sensitive, unextractable)"
At the end of the mail I pasted all the trace.

Some services are working, but the service that doesn't work sends a PKCS7 
signature to the server. I create the PKCS7 signature using the same PKCS11 
token that I use to comunicate 2 way SSL to the server.
This is reproductible behaviour, always when I activate Fiddler, Axis2 works. 
And only services where I use PKCS7 signature don't work.

Do you have any advice? I have no idea what to do.
I attached the whole stub that I generated with the command "wsdl2java.bat -uri 
tmp\StoreClinicalDocument.wsdl -p stubs.StoreClinicalDocument.client -s -sd 
-ssi -o tmp\build_StoreClinicalDocument\client" and I attached the wsdl file.

Thank you.



SEVERE: null
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at 
SoapUtils.Axis2ReflectionBuilder.executeMethod(Axis2ReflectionBuilder.java:295)
 at SoapUtils.Soap.executeMethod(Soap.java:225)
 at Util.DES.ExportDES.FOCG_TransmiteDES(ExportDES.java:193)
 at GenericDBCarier.CustomFunctions$44$15.call(CustomFunctions.java:5346)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.axis2.AxisFault: Connection has been shutdown: 
javax.net.ssl.SSLHandshakeException: Error signing certificate verify
 at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
 at 
org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78)
 at 
org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:85)
 at 
org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
 at 
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
 at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
 at 
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
 at 
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
 at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
 at 
org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.executeMethod(HTTPSenderImpl.java:872)
 at 
org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:212)
 at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)
 at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)
 at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)
 at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
 at