急:java调用PHP webservice问题

亵渎 发布于 2014/05/27 13:51
阅读 2K+
收藏 1

对方提供的PHP接口如下,我的代码

public String getT(){
String result=null;
            try {
              String endpoint = " http://192.168.1.16/webservice/worg.php?wsdl";
                   
                    // 调用过程
                    Service service = new Service();
                    Call call = (Call) service.createCall();
                    call.setTargetEndpointAddress(new java.net.URL(endpoint));
                    call.setOperationName("get_ext_authkey");// WSDL里面描述的操作名称
                    call.addParameter(new QName(nameSpace,"user"),
                                    org.apache.axis.encoding.XMLType.XSD_STRING,
                                    javax.xml.rpc.ParameterMode.IN);// 操作的参数
                    call.addParameter(new QName(nameSpace,"pass"),
                            org.apache.axis.encoding.XMLType.XSD_STRING,
                            javax.xml.rpc.ParameterMode.IN);// 操作的参数
                    call.addParameter(new QName(nameSpace,"oid"),
                            org.apache.axis.encoding.XMLType.XSD_STRING,
                            javax.xml.rpc.ParameterMode.IN);// 操作的参数
                    call.addParameter(new QName(nameSpace,"key"),
                            org.apache.axis.encoding.XMLType.XSD_STRING,
                            javax.xml.rpc.ParameterMode.IN);// 操作的参数
                    call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);// 设置返回类型           
                    call.setSOAPActionURI("http://192.168.1.16/webservice/worg.php/get_ext_authkey");
                    // 给方法传递参数,并且调用方法               
                    Object[] obj = new Object[] { "","","1","" };
                    result = (String) call.invoke(obj);
                   // System.out.println("Result is : " + result);
            } catch (Exception e) {
                    e.printStackTrace();
            }
            return result;
    }

输出:

AxisFault
 faultCode: client
 faultSubcode: 
 faultString: 100003
 faultActor: 
 faultNode: 
 faultDetail: 
{http://xml.apache.org/axis/}stackTrace:100003
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:1774)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
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:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
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:107)
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.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
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)
at com.ToEmail.getT(ToEmail.java:75)
at com.ToEmail.main(ToEmail.java:110)


{http://xml.apache.org/axis/}hostname:xx


100003
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:1774)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
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:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
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:107)
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.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
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)
at com.ToEmail.getT(ToEmail.java:75)
at com.ToEmail.main(ToEmail.java:110)
null


求大神给分下下什么原因啊?
加载中
0
意志与表象的世界
意志与表象的世界
去问提供接口的10003代表什么含义
0
亵渎
嗯,找到原因了,是我的IP没有加入对方的认证
返回顶部
顶部