MyService is in the package dummy?If this,then generated wsdl's targetNamespace
should be
"targetNamespace="http://localhost:8080/axis/MyService.jws"
I am not sure of it,but you can try it!
Best Regards,
Robert Zhang
Email:[EMAIL PROTECTED]
Tel:86-010-62014411-2437
----- 原邮件 -----
从: J R <[EMAIL PROTECTED]>
日期: 星期四, 六月 16日, 2005 上午3:16
主题: Interesting Error
> I have created a service with the following client:
>
> public class MyClient
> {
> public static void main(String [] args) throws
> Exception {
> Options options = new Options(args);
>
> String endpoint = "http://localhost:" +
> options.getPort() +
> "/axis/dummy/MyService.jws";
>
>
> Service service = new Service();
> Call call = (Call) service.createCall();
>
> call.setTargetEndpointAddress( new
> java.net.URL(endpoint) );
> call.setOperationName( "checkServer" );
> call.addParameter( "ipaddress",
> XMLType.XSD_STRING, ParameterMode.IN );
> call.setReturnType( XMLType.XSD_STRING );
>
> System.out.println( call.invoke( new Object []
> { args[1] }) );
>
> }
> }
>
>
> The service uses threads and a network connection to
> work correctly.
>
> I get the following error message:
> Exception in thread "main" AxisFault
> faultCode:
> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> faultSubcode:
> faultString:
> java.lang.reflect.InvocationTargetException
> faultActor:
> faultNode:
> faultDetail:
>
> {http://xml.apache.org/axis/}hostname:myhost.myserver.edu
>
> java.lang.reflect.InvocationTargetException
> at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
> at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
> at
> org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
> at
> org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at
> org.apache.xerces.parsers.XMLParser.parse(Unknown
> Source)
> at
> org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> at
> javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
> at
> org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> at
> org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
> at
> org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> at
> org.apache.axis.message.addressing.handler.AddressingHandler.processClientResponse(AddressingHandler.java:305)
> at
> org.apache.axis.message.addressing.handler.AddressingHandler.invoke(AddressingHandler.java:110)
> 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:190)
> at
> org.apache.axis.client.Call.invokeEngine(Call.java:2726)
> at
> org.apache.axis.client.Call.invoke(Call.java:2709)
> at
> org.apache.axis.client.Call.invoke(Call.java:2385)
> at
> org.apache.axis.client.Call.invoke(Call.java:2308)
> at
> org.apache.axis.client.Call.invoke(Call.java:1765)
>
> The WSDL for my code is the following:
> <wsdl:definitions
> targetNamespace="http://localhost:8080/axis/dummy/MyService.jws">
> -
> <!--
> WSDL created by Apache Axis version: 1.2
> Built on May 03, 2005 (02:20:24 EDT)
> -->
> -
> <wsdl:message name="checkServerResponse">
> <wsdl:part name="checkServerReturn"
> type="xsd:string"/>
> </wsdl:message>
> -
> <wsdl:message name="checkServerRequest">
> <wsdl:part name="ipaddress" type="xsd:string"/>
> </wsdl:message>
> -
> <wsdl:portType name="MyService">
> -
> <wsdl:operation name="checkServer"
> parameterOrder="ipaddress">
> <wsdl:input message="impl:checkServerRequest"
> name="checkServerRequest"/>
> <wsdl:output message="impl:checkServerResponse"
> name="checkServerResponse"/>
> </wsdl:operation>
> </wsdl:portType>
> -
> <wsdl:binding name="MyServiceSoapBinding"
> type="impl:ArinWhois">
> <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> -
> <wsdl:operation name="checkServer">
> <wsdlsoap:operation soapAction=""/>
> -
> <wsdl:input name="checkServerRequest">
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://DefaultNamespace" use="encoded"/>
> </wsdl:input>
> -
> <wsdl:output name="checkServerResponse">
> <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://localhost:8080/axis/dummy/MyService.jws"
> use="encoded"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> -
> <wsdl:service name="MyServiceService">
> -
> <wsdl:port binding="impl:MyServiceSoapBinding"
> name="MyService">
> <wsdlsoap:address
> location="http://localhost:8080/axis/dummy/MyService.jws"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
> What could be causing this? I am sure it is my fault.
>
> JR
>
>
>
> __________________________________
> Discover Yahoo!
> Get on-the-go sports scores, stock quotes, news and more. Check it
> out!
> http://discover.yahoo.com/mobile.html
>