{"id":1842,"date":"2022-08-30T15:19:54","date_gmt":"2022-08-30T15:19:54","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/12\/02\/java-web-service-client-authenticate-with-php-web-service-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:19:54","modified_gmt":"2022-08-30T15:19:54","slug":"java-web-service-client-authenticate-with-php-web-service-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/java-web-service-client-authenticate-with-php-web-service-collection-of-common-programming-errors\/","title":{"rendered":"JAVA web service client authenticate with PHP web service?-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;ve used default eclipse wizard to create a web service client (File&gt;New&gt;Other and select a wizard for web service client). The classes were generated and the problem now is that the username and password were introduced, and I don&#8217;t know how to modify my code to access the server, I tried to change the code in _initServiceProxy() method of generated proxy class<\/p>\n<pre><code>private DirService_Port proxy = null;\n\nprivate void _initDirService_PortProxy() {\n\n  try {\n\n      proxy = (new com.soap.DirService_ServiceLocator()).getDirService_Port(\"EndpoitnURL\");\n      if (proxy != null) {\n          ((DirService_BindingStub) proxy).setUsername(\"username\");\n          ((DirService_BindingStub) proxy).setPassword(\"password\");\n          ((DirService_BindingStub) proxy).setTimeout(10000);\n        }\n    }\n    catch (javax.xml.rpc.ServiceException serviceException) {}\n  }\n<\/code><\/pre>\n<p>After calling <code>_initDirService_PortProxy()<\/code> I am trying to call client method through this:<\/p>\n<pre><code>proxy.getUserList();\n<\/code><\/pre>\n<p>But I getting these errors:<\/p>\n<blockquote>\n<p>AxisFault faultCode: Receiver faultSubcode: faultString: Unknown error faultActor: faultNode: faultDetail: {http:\/\/xml.apache.org\/axis\/}stackTrace:Unknown error at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2939) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812)<\/p>\n<\/blockquote>\n<p id=\"rop\"><small>Originally posted 2013-12-02 20:57:37. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve used default eclipse wizard to create a web service client (File&gt;New&gt;Other and select a wizard for web service client). The classes were generated and the problem now is that the username and password were introduced, and I don&#8217;t know how to modify my code to access the server, I tried to change the code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1842","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1842"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1842\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}