You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Krishnakumar B <kr...@mindtree.com> on 2003/04/09 11:04:09 UTC
Service not found
Hi
I am trying to invoke web service by creating an instance of Axis Server but
i get the exception service not found.
Any ideas as to how to fix this. I have added the class to the classpath.
The fault
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.NoService
faultString: The AXIS engine could not find a target service to invoke!
target
Service is null
faultActor: null
faultDetail:
stackTrace: AxisFault
faultCode: {http://xml.apache.org/axis/}Server.NoService
faultString: The AXIS engine could not find a target service to invoke!
target
Service is null
faultActor: null
faultDetail:
The AXIS engine could not find a target service to invoke! targetService is
null
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:307)
at Test.main(Test.java:51)
Source Code
String configuration = "C:\\Tomcat
4.1\\webapps\\EchoAddress\\WEB-INF\\server-config.wsdd";
FileProvider provider = new FileProvider(configuration);
AxisEngine engine = new AxisServer(provider);
EngineConfiguration ecg = engine.getConfig();
Iterator i2 = ecg.getDeployedServices();
while(i2.hasNext())
{
ServiceDesc sd = (ServiceDesc) i2.next();
System.out.println("the service name is " + sd.getName());
}
MessageContext msgContext = null;
msgContext = new MessageContext(engine);
String msgTxt = "<SOAP-ENV:Envelope
xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>"+
"<SOAP-ENV:Body>"+
"<m:echoAdd
xmlns:m='http://localhost:8080/EchoAddress/services/EchoAddressService'>"+
"<in0 xsi:type='xsd:string'>Test</in0>"+
"</m:echoAdd>"+
"</SOAP-ENV:Body>"+
"</SOAP-ENV:Envelope>";
Message soapMsg = new Message(msgTxt);
msgContext.setRequestMessage(soapMsg);
engine.invoke(msgContext);
System.out.println("---Getting response message from WebService");
Message responseMsg = null;
responseMsg = msgContext.getResponseMessage();
SOAPEnvelope envelope = responseMsg.getSOAPEnvelope();
Element envElement = envelope.getAsDOM();
String strSOAPBody = XMLUtils.ElementToString(envElement);
System.out.println("JMS-SOAP Response:");
System.out.println(strSOAPBody);
}catch(Exception e)
{
e.printStackTrace();
}
Thanks & Regards
Krishnakumar B
DISCLAIMER:
This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission.
Re: Service not found
Posted by Carl Cabou <ex...@sncf.fr>.
Hi.
Did you deploy your service ? if not, Axis won't be able to find it
(check out the admin service).
Check for error in the name of the service in your client code, there
may be a mismatch.
Regards.
Carl.
Krishnakumar B wrote:
> Hi
>
> I am trying to invoke web service by creating an instance of Axis Server
> but i get the exception service not found.
> Any ideas as to how to fix this. I have added the class to the classpath.
>
> *The fault*
>
> AxisFault
> faultCode: {http://xml.apache.org/axis/}Server.NoService
> faultString: The AXIS engine could not find a target service to
> invoke! target
> Service is null
> faultActor: null
> faultDetail:
> stackTrace: AxisFault
> faultCode: {http://xml.apache.org/axis/}Server.NoService
> faultString: The AXIS engine could not find a target service to
> invoke! target
> Service is null
> faultActor: null
> faultDetail:
>
> The AXIS engine could not find a target service to invoke!
> targetService is null
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:307)
> at Test.main(Test.java:51)
>
> *Source Code*
> **
> String configuration = "*C:\\Tomcat
> 4.1\\webapps\\EchoAddress\\WEB-INF\\server-config.wsdd*";
> FileProvider provider = new FileProvider(configuration);
> AxisEngine engine = new AxisServer(provider);
> EngineConfiguration ecg = engine.getConfig();
>
> Iterator i2 = ecg.getDeployedServices();
>
> while(i2.hasNext())
> {
> ServiceDesc sd = (ServiceDesc) i2.next();
> System.out.println("the service name is " + sd.getName());
> }
>
> MessageContext msgContext = null;
> msgContext = new MessageContext(engine);
> String msgTxt = *"<SOAP-ENV:Envelope
> xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
> xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
> xmlns:xsd='http://www.w3.org/2001/XMLSchema'
> SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>"+
> "<SOAP-ENV:Body>"+
> "<m:echoAdd
> xmlns:m='http://localhost:8080/EchoAddress/services/EchoAddressService'>"+
> "<in0 xsi:type='xsd:string'>Test</in0>"+
> "</m:echoAdd>"+
> "</SOAP-ENV:Body>"+
> "</SOAP-ENV:Envelope>";
> *Message soapMsg = new Message(msgTxt);
> msgContext.setRequestMessage(soapMsg);
> engine.invoke(msgContext);
> System.out.println("---Getting response message from WebService");
>
> Message responseMsg = null;
> responseMsg = msgContext.getResponseMessage();
> SOAPEnvelope envelope = responseMsg.getSOAPEnvelope();
> Element envElement = envelope.getAsDOM();
> String strSOAPBody = XMLUtils.ElementToString(envElement);
> System.out.println("JMS-SOAP Response:");
> System.out.println(strSOAPBody);
>
> }catch(Exception e)
> {
> e.printStackTrace();
> }
> *
> *Thanks & Regards
> Krishnakumar B*
> *
>
>
>
>
>
> DISCLAIMER:
> This message (including attachment if any) is confidential and may be
> privileged. Before opening attachments please check them for viruses and
> defects. MindTree Consulting Private Limited (MindTree) will not be
> responsible for any viruses or defects or any forwarded attachments
> emanating either from within MindTree or outside. If you have received
> this message by mistake please notify the sender by return e-mail and
> delete this message from your system. Any unauthorized use or
> dissemination of this message in whole or in part is strictly
> prohibited. Please note that e-mails are susceptible to change and
> MindTree shall not be liable for any improper, untimely or incomplete
> transmission.
>