[JBoss Web Services] - Sporadic error sending SOAP messages
by Sat Ena
Sat Ena [http://community.jboss.org/people/sat.ena] created the discussion
"Sporadic error sending SOAP messages"
To view the discussion, visit: http://community.jboss.org/message/590160#590160
--------------------------------------------------------------
Hi,
I am facing a sporadic (intermittent) issue when tried to send SOAP messages over HTTPS through a proxy. Below are the checks done
- SSL certificates installed.
- WebService end-point is always avaliable. No issue with it.
- When the failed messages are re-sent they go through fine.
- Connected through a proxy server.
- Using SAAJ api provided by Jboss installation
/server/default/lib/saaj-api.jar
/server/default/lib/saaj-impl.jar
- Java version: jdk1.5.0_11
- Jboss version: jboss-4.0.5.GA
Code Snippet of client which sends the SOAP message:
-----------------------------------------------------------------------------------
private String sendSoap(String content) throws IOException
{
String retValue = "";
try {
String methodName = this.properties.getProperty ("method");
String url = this.properties.getProperty ("url");
String soapAction = this.properties.getProperty ("action");
if (soapAction==null) soapAction = "DEFAULT";
String nameSpace = this.properties.getProperty (methodName+".namespace");
String parameter = this.properties.getProperty (methodName+".parameter");
javax.xml.soap.SOAPMessage message = javax.xml.soap.MessageFactory.newInstance().createMessage();
message.getMimeHeaders().addHeader("SOAPAction",soapAction);
javax.xml.soap.SOAPHeader header = message.getSOAPHeader();
javax.xml.soap.SOAPBody body = message.getSOAPBody();
javax.xml.soap.SOAPFactory soapFactory = javax.xml.soap.SOAPFactory.newInstance();
javax.xml.soap.Name bodyName = soapFactory.createName(methodName,"ns0",nameSpace);
javax.xml.soap.SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
javax.xml.soap.Name parameterName = soapFactory.createName (parameter);
javax.xml.soap.SOAPElement parameterElement = soapFactory.createElement (parameterName);
parameterElement.addTextNode (content);
bodyElement.addChildElement (parameterElement);
java.io.ByteArrayOutputStream out1 = new java.io.ByteArrayOutputStream();
message.writeTo (out1);
java.net.URL endpoint = new java.net.URL(url);
javax.xml.soap.SOAPConnection conn = javax.xml.soap.SOAPConnectionFactory.newInstance().createConnection();
javax.xml.soap.SOAPMessage response = conn.call(message,endpoint);
java.io.ByteArrayOutputStream out2 = new java.io.ByteArrayOutputStream();
response.writeTo(out2);
logger.debug("XML Response String ==> " + out2.toString());
javax.xml.soap.SOAPBody responseBody = response.getSOAPBody();
org.w3c.dom.Document document = responseBody.extractContentAsDocument();
retValue = document.getElementsByTagNameNS( nameSpace, methodName+"Return").item (0).getTextContent ();
}
catch (SOAPException ex)
{ ex.printStackTrace();
throw new IOException(ex.getMessage());
}
catch (FactoryConfigurationError ex)
{
ex.printStackTrace();
throw new IOException(ex.getMessage());
}
return retValue;
}
Error stack trace when messaged failed:
-----------------------------------------------------------
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/590160#590160]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[JBoss Web Services] - Unable to compile JbossW (native) 3.4.0 in Jboss 5.1.0 : help required
by Aurélien Lansmanne
Aurélien Lansmanne [http://community.jboss.org/people/alansmanne] created the discussion
"Unable to compile JbossW (native) 3.4.0 in Jboss 5.1.0 : help required"
To view the discussion, visit: http://community.jboss.org/message/590133#590133
--------------------------------------------------------------
Hello,
I was using Jboss 4.2.2 at work when I encountered the following bug : https://issues.jboss.org/browse/JBWS-2845 https://issues.jboss.org/browse/JBWS-2845
Apparently, this issue has been fixed in https://issues.jboss.org/browse/JBWS/fixforversion/12314591 jbossws-native-3.3.0.Beta4
If I look at the Jboss/JbossWS compatibility wiki page ( http://community.jboss.org/docs/DOC-13569 http://community.jboss.org/wiki/JBossWS-SupportedTargetContainers), I see that I must use at least Jboss 5. So I've switched to Jboss 5.1.0.GA, but the error was still present. I've tried to compile myself Jbossws-native-3.4.0, using the ant task (ant deploy-jboss510).
Even if the ouput was "SUCCESSFUL", whenever I restart Jboss, the following error appears :
Unexpected error during load of:org.jboss.wsf.spi.invocation.integration.ServiceEndpointContainer
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
....
The same kind of error appears when I run the ant test task, so something must be wrong with my Java configuration. I've checked in MyEclipse, the JRE and JDK are set to Java 1.5.0_16. The compilation has been made using MyEclipse too, and the project was set to the same JDK...
Any suggestion is welcome. If there is a way to download the Jboss-WS binaries without compilation and put them inside Jboss 5.1.0, it may solve my problem. If someone knows a workaround (either ith Jboss 4.2.2 or Jboss 5.0), it could help too.
All I need is to prevent Jboss from generating a tmp WSDL file with a "#" inside... (see the bug at the top of this topic)...
I can't change the namespace as I'm actually deploying a webservice based on a WSDL which I'm not the author...
Thank you for your help,
Aurélien Lansmanne.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/590133#590133]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months