Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Web Services
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Eclipse Collections Categorically: Level up your programming game
this week in the
Open Source Projects
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Web Services
org.apache.axis2.AxisFault: Unconnected sockets not implemented
Dinesh nath
Greenhorn
Posts: 3
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi All,
I am new to
Java
and Web Services.
I have crated client Stubs from WSDL to connect to webservice
import com.company.www.ecc.cdm.serviceheader.ServiceHeaderType; import com.company.www.ecc.cdm.serviceheader.String255; import com.company.www.ecc.cdm.serviceheader.String50; import com.company.www.it.webservices.Util.DateUtil; import com.company.www.it.webservices.Util.ReadAndPrintXMLFile; import com.company.www.it.webservices.Util.ReadKeyFromProperties; import com.company.www.it.webservices.translationinitiationrequest.TranslationInitiationRequest; import com.company.www.it.webservices.translationinitiationrequeststatus.TranslationInitiationRequestStatus; import com.company.www.it.webservices.translationservice.ExtensionsType; import com.company.www.it.webservices.translationservice.GenericExtensionNumericType; import com.company.www.it.webservices.translationservice.GenericExtensionStringType; import com.company.www.it.webservices.translationservice.OperationLOVType; import com.company.www.it.webservices.translationservice.PackageEncodingLOVType; import com.company.www.it.webservices.translationservice.PriorityLOVType; import com.company.www.it.webservices.translationservice.RequiredStringType; import com.company.www.it.webservices.translationservice.Status; import com.company.www.it.webservices.translationservice.TargetLocale_type0; import com.company.www.it.webservices.translationservice.TranslationRequestGroupType; import com.company.www.it.webservices.translationservice.TranslationRequestUnitType; import com.company.www.it.webservices.translationservice.TranslationServiceAbstractStub; import org.apache.axiom.om.OMElement; import org.apache.axis2.databinding.types.NonNegativeInteger; import org.apache.axis2.databinding.types.NormalizedString; import org.apache.xmlbeans.XmlObject; import org.w3c.dom.Document; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import java.io.File; import java.math.BigInteger; import java.security.Security; import java.util.ArrayList; import java.util.Calendar; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; public class clientRequest { public static void main(String[] args) { try { String END_POINT = null; if ((args == null) || (args.length != 2)) { System.out.println( "USAGE : clientRequest requestXMLFile propertiesFile"); System.exit(-1); } if (args.length > 1) { END_POINT = ReadKeyFromProperties.retrieveKey(args[1], "Translation.EndPointUrl"); } System.out.println("End Point: " + END_POINT); //javax.net.ssl.SSLS // String END_POINT = // "http://webservice-devintf.ges.company.com/BusinessProcesses/TranslationService"; TranslationServiceAbstractStub stub = new TranslationServiceAbstractStub(END_POINT); // TranslationInitiationRequest translationInitiationRequestDocument = (TranslationInitiationRequest) getTestObject(TranslationInitiationRequest.class); TranslationInitiationRequest translationInitiationRequestDocument = new TranslationInitiationRequest(); System.setProperty("javax.net.ssl.trustStore", ReadKeyFromProperties.retrieveKey(args[1], "Translation.trustStore")); System.setProperty("javax.net.ssl.trustStorePassword", ReadKeyFromProperties.retrieveKey(args[1], "Translation.trustStorePassword")); System.setProperty("javax.nSet.ssl.keyStoreType", ReadKeyFromProperties.retrieveKey(args[1], "Translation.keyStoreType")); System.setProperty("javax.net.ssl.keyStore", ReadKeyFromProperties.retrieveKey(args[1], "Translation.keyStore")); System.setProperty("javax.net.ssl.keyStorePassword", ReadKeyFromProperties.retrieveKey(args[1], "Translation.keyStorePassword")); [b] //Security.setProperty("ssl.SocketFactory.provider", // "javax.net.ssl.SSLSocketFactory");[/b] Security.setProperty("ssl.SocketFactory.provider", "com.company.www.Test.DummySSLSocketFactory"); System.setProperty("javax.net.debug", "SSL,handshake,data,trustmanager"); System.setProperty("javax.net.debug", "all"); DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); Document doc = docBuilder.parse(new File(args[0])); String thirdTag = null; String fourthTag = null; ServiceHeaderType serviceHeader = new ServiceHeaderType(); translationInitiationRequestDocument.setServiceHeader(serviceHeader); /* code to attach some content to translation request */ translationInitiationRequestDocument.setTranslationGroup(translationGroups); System.out.println("\nINITIAL REQUEST"); System.out.println("------------------"); System.out.println(translationInitiationRequestDocument); System.out.println("\nINTITIATION REQUEST"); System.out.println("------------------"); System.out.println("\nINTITIATION REQUEST PLUS GRPARRAY"); System.out.println("------------------"); System.out.println("\nCONTENT"); System.out.println("------------------"); System.out.println("\n GETTING RESULTS"); System.out.println("------------------"); //TranslationInitiationRequestStatus results = stub.SendTranslationRequest(translationInitiationRequestDocument); //TranslationInitiationRequestStatus results = stub.SendTranslationRequest(translationInitiationRequestDocument); TranslationInitiationRequestStatus results = stub.sendTranslationRequest(translationInitiationRequestDocument); System.out.println("\nRESULTS"); System.out.println("------------------"); System.out.println(results.toString()); System.out.println(">>>>>>" + results.getStatus()); // assertNotNull(results); Status status = results.getStatus(); System.out.println("\nREQUEST STATUS"); System.out.println("------------------"); String code = status.getCode(); // assertEquals("0", code); System.out.println("STATUS CODE : " + code); String message = status.getMessage(); // assertEquals("Success", message); System.out.println("STATUS MESSAGE : " + message); } catch (SAXParseException err) { System.out.println("** Parsing error" + ", line " + err.getLineNumber() + ", uri " + err.getSystemId()); System.out.println(" " + err.getMessage()); } catch (SAXException e) { Exception x = e.getException(); ((x == null) ? e : x).printStackTrace(); } catch (Throwable t) { t.printStackTrace(); } } // Create the desired XmlObject and provide it as the test object public static XmlObject getTestObject(java.lang.Class type) throws Exception { System.out.println("type is " + type); java.lang.reflect.Method creatorMethod = null; if (XmlObject.class.isAssignableFrom(type)) { Class[] declaredClasses = type.getDeclaredClasses(); for (int i = 0; i < declaredClasses.length; i++) { Class declaredClass = declaredClasses[i]; if (declaredClass.getName().endsWith("$Factory")) { creatorMethod = declaredClass.getMethod("newInstance", null); break; } } } else { System.out.println("some problem here"); } if (creatorMethod != null) { return (org.apache.xmlbeans.XmlObject) creatorMethod.invoke(null, null); } else { throw new Exception("Creator not found!"); } } }
I am getting a following error
GETTING RESULTS ------------------ setting up default SSLSocketFactory use class specified by ssl.SocketFactory.provider: com.symantec.www.Test.DummySSLSocketFactory class com.symantec.www.Test.DummySSLSocketFactory is loaded trigger seeding of SecureRandom done seeding SecureRandom instantiated an instance of class com.symantec.www.Test.DummySSLSocketFactory org.apache.axis2.AxisFault: Unconnected sockets not implemented at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417) at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195) at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) at com.symantec.www.it.webservices.translationservice.TranslationServiceAbstractStub.sendTranslationRequest(TranslationServiceAbstractStub.java:222) at clientRequest.main(clientRequest.java:502) Caused by: java.net.SocketException: Unconnected sockets not implemented at javax.net.SocketFactory.createSocket(SocketFactory.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:115) at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:129) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706) at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1321) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:520) at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191) ... 9 more #
earlier when i tried with the
Security.setProperty("ssl.SocketFactory.provider","javax.net.ssl.SSLSocketFactory"); I got GETTING RESULTS ------------------ setting up default SSLSocketFactory use class specified by ssl.SocketFactory.provider: javax.net.ssl.SSLSocketFactory class javax.net.ssl.SSLSocketFactory is loaded use dummy SSLSocketFactory due to java.lang.InstantiationException followed by same sockets unimplemented error
can some one please help
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
SSL Socket Stopped Working with Java1.6
posting data in key/value pair when doing http Post in java
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized while invoking the webservice
SSL - client side - trusting untrusted certificates?
org.apache.axis2.AxisFault: problem accessing the parser. Parser already accessed!
More...