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 Jaidev Nair <ja...@gmail.com> on 2005/03/03 05:26:01 UTC

Getting Server.BadTargetObjectURI exception when running the client

Hai all

Am new to webservices.
Am facing this problem for couple of hours am not beign able to rectify it.

Am trying to access one of the service from xmethods using AXIS.

My client code is like this :

import java.io.PrintStream;
import java.net.URL;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import  org.apache.axis.providers.java.RPCProvider;
import org.xml.sax.XMLReader;

public class Temp
{

    public Temp()
    {
    }

    public static void main(String args[]) throws Exception
    {
        String endpoint =
"http://services.xmethods.net:80/soap/servlet/rpcrouter";
        String method = "getTemp";
		String zipcode = "67801";
		
		Service service = new Service();
		Call call = (Call)service.createCall();
		call.setUseSOAPAction(true);
		call.setTargetEndpointAddress(new URL(endpoint));
		call.setOperationName(method);
		
		call.addParameter("zipcode", XMLType.XSD_STRING, ParameterMode.IN);
		
		call.setReturnType(XMLType.XSD_FLOAT);

		

		Float resp = (Float)call.invoke(new Object[] {
			zipcode
		});

		System.out.println("Got result : " + resp.toString());
		return;
    }
}

THE ERROR WHAT I AM GETTING WHEN I RUN THIS CLIENT IS :

Exception in thread "main" AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
 faultSubcode:
 faultString: Unable to determine object id from call: is the method
element namespaced?
 faultActor: /soap/servlet/rpcrouter
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace: AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
 faultSubcode:
 faultString: Unable to determine object id from call: is the method
element namespaced?
 faultActor: /soap/servlet/rpcrouter
 faultNode:
 faultDetail:

Unable to determine object id from call: is the method element namespaced?

Can any on help me in this what is the problem with my client code.

Thanks,
JAIDEV.


-- 
Jaidev.Nair
Software Engineer
eDrugStore - Web Services 
Inspired By Inovation®
www.benchmarksoft.com

Ph : +91 44 24987589  Extn : 150

Cut me and ...  i will bleed Java !

Re: Getting Server.BadTargetObjectURI exception when running the client

Posted by Jaidev Nair <ja...@gmail.com>.
Thanks matt for the reply.

My direct email id is :    jaidevnair@gmail.com

Awaiting a reply

Thanks,
Jaidev.


On Thu, 03 Mar 2005 16:27:59 +1000, Matt Robinson
<ma...@flightcentre.com> wrote:
> axis-user@ws.apache.org,Internet writes:
> >Hi matt
> >
> >Sure i will be greatful if u provide info about Axis Stub Method
> >
> >Thanks,
> >Jaidev.
> >
> Axis comes with a set of tools.  One of these tools is WSDL2Java.  It takes a WSDL File and generates a set of JAVA Classes that represent that service.
> See http://ws.apache.org/axis/java/reference.html#Java2WSDLReference for more detail on how to use this tool.
> 
> Using this tool on your WSDL file generated these files:
> 
> xmethods/www/sd/TemperatureService_wsdl/TemperatureBindingStub.java
> xmethods/www/sd/TemperatureService_wsdl/TemperaturePortType.java
> xmethods/www/sd/TemperatureService_wsdl/TemperatureService.java
> xmethods/www/sd/TemperatureService_wsdl/TemperatureServiceLocator.java
> 
> Below is a sample Client that uses these files:
> 
> **** START OF CODE ****
> import java.rmi.RemoteException;
> 
> import javax.xml.rpc.ServiceException;
> 
> import net.xmethods.www.sd.TemperatureService_wsdl.TemperaturePortType;
> import net.xmethods.www.sd.TemperatureService_wsdl.TemperatureServiceLocator;
> 
> public class TestTemp {
> 
>    public static void main(String[] args) {
> 
> /*  Use these lines to setup HTTP Proxy (if required)
>        System.setProperty("http.proxyHost", "");
>        System.setProperty("http.proxyPort", "");
>        System.setProperty("http.proxyUser", "");
>        System.setProperty("http.proxyPassword", "");
> */
> 
>        TemperatureServiceLocator locator = new TemperatureServiceLocator();
>        try {
>            TemperaturePortType client = locator.getTemperaturePort();
>            float temp = client.getTemp( "67801" );
>            System.out.println( "Temperature is = " + temp );
>        } catch (ServiceException e) {
>            e.printStackTrace();
>        } catch (RemoteException e) {
>            e.printStackTrace();
>        }
>    }
> }
> **** END OF CODE ****
> 
> If you send me your direct email I can send you a JAR of the generated files.  You can add this JAR to your classpath and then run this client.
> 
> Kind Regards,
> 
> Matt Robinson
> 
>

Re: Getting Server.BadTargetObjectURI exception when running the client

Posted by Matt Robinson <ma...@flightcentre.com>.
axis-user@ws.apache.org,Internet writes:
>Hi matt
>
>Sure i will be greatful if u provide info about Axis Stub Method 
>
>Thanks,
>Jaidev.
>
Axis comes with a set of tools.  One of these tools is WSDL2Java.  It takes a WSDL File and generates a set of JAVA Classes that represent that service.
See http://ws.apache.org/axis/java/reference.html#Java2WSDLReference for more detail on how to use this tool.

Using this tool on your WSDL file generated these files:

xmethods/www/sd/TemperatureService_wsdl/TemperatureBindingStub.java
xmethods/www/sd/TemperatureService_wsdl/TemperaturePortType.java
xmethods/www/sd/TemperatureService_wsdl/TemperatureService.java
xmethods/www/sd/TemperatureService_wsdl/TemperatureServiceLocator.java

Below is a sample Client that uses these files:

**** START OF CODE ****
import java.rmi.RemoteException;

import javax.xml.rpc.ServiceException;

import net.xmethods.www.sd.TemperatureService_wsdl.TemperaturePortType;
import net.xmethods.www.sd.TemperatureService_wsdl.TemperatureServiceLocator;

public class TestTemp {

    public static void main(String[] args) {
        
/*  Use these lines to setup HTTP Proxy (if required)
        System.setProperty("http.proxyHost", ""); 
        System.setProperty("http.proxyPort", ""); 
        System.setProperty("http.proxyUser", ""); 
        System.setProperty("http.proxyPassword", "");
*/ 
        
        TemperatureServiceLocator locator = new TemperatureServiceLocator();
        try {
            TemperaturePortType client = locator.getTemperaturePort();
            float temp = client.getTemp( "67801" );
            System.out.println( "Temperature is = " + temp );
        } catch (ServiceException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}
**** END OF CODE ****

If you send me your direct email I can send you a JAR of the generated files.  You can add this JAR to your classpath and then run this client.

Kind Regards,

Matt Robinson


Re: Getting Server.BadTargetObjectURI exception when running the client

Posted by Jaidev Nair <ja...@gmail.com>.
Hi matt

Sure i will be greatful if u provide info about Axis Stub Method 

Thanks,
Jaidev.



On Thu, 03 Mar 2005 16:07:43 +1000, Matt Robinson
<ma...@flightcentre.com> wrote:
> Sorry, yeah I thought you might (looking back over the code).
> 
> I got the thing working using the Axis Stub Method (my preferred method).
> 
> Would you like information on that method?
> 
> axis-user@ws.apache.org,Internet writes:
> >HI Matt
> >
> >I tried the way you told me but am getting a new exception like :
> >
> >Exception in thread "main" AxisFault
> > faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
> > faultSubcode:
> > faultString: parsing error: org.xml.sax.SAXParseException: An invalid
> >second &apos;:&apos; was found in the element type or
> >tribute name.
> > faultActor: /soap/servlet/rpcrouter
> > faultNode:
> > faultDetail:
> >        {http://xml.apache.org/axis/}stackTrace: AxisFault
> > faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
> > faultSubcode:
> > faultString: parsing error: org.xml.sax.SAXParseException: An invalid
> >second &amp;apos;:&amp;apos; was found in the element
> >pe or attribute name.
> > faultActor: /soap/servlet/rpcrouter
> > faultNode:
> > faultDetail:
> >
> >parsing error: org.xml.sax.SAXParseException: An invalid second ':'
> >was found in the element type or attribute name.
> >
> >
> >Thanks,
> >Jaidev.
> 
> Kind Regards,
> 
> Matt Robinson
> 
> E-Commerce
> Level 7
> Flight Centre Limited
> 316 Adelaide Street
> Brisbane  QLD 4000
> 
> Ph: 3032 9488
> Mob: 0414 385 600
> http://www.flightcentre.com
> 
>

Re: Getting Server.BadTargetObjectURI exception when running the client

Posted by Matt Robinson <ma...@flightcentre.com>.
Sorry, yeah I thought you might (looking back over the code).

I got the thing working using the Axis Stub Method (my preferred method).

Would you like information on that method?

axis-user@ws.apache.org,Internet writes:
>HI Matt
>
>I tried the way you told me but am getting a new exception like :
>
>Exception in thread "main" AxisFault
> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
> faultSubcode:
> faultString: parsing error: org.xml.sax.SAXParseException: An invalid
>second &apos;:&apos; was found in the element type or
>tribute name.
> faultActor: /soap/servlet/rpcrouter
> faultNode:
> faultDetail:
>        {http://xml.apache.org/axis/}stackTrace: AxisFault
> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
> faultSubcode:
> faultString: parsing error: org.xml.sax.SAXParseException: An invalid
>second &amp;apos;:&amp;apos; was found in the element
>pe or attribute name.
> faultActor: /soap/servlet/rpcrouter
> faultNode:
> faultDetail:
>
>parsing error: org.xml.sax.SAXParseException: An invalid second ':'
>was found in the element type or attribute name.
>
>
>Thanks,
>Jaidev.


Kind Regards,

Matt Robinson

E-Commerce
Level 7
Flight Centre Limited
316 Adelaide Street
Brisbane  QLD 4000

Ph: 3032 9488
Mob: 0414 385 600
http://www.flightcentre.com


Re: Getting Server.BadTargetObjectURI exception when running the client

Posted by Jaidev Nair <ja...@gmail.com>.
HI Matt

I tried the way you told me but am getting a new exception like :

Exception in thread "main" AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
 faultSubcode:
 faultString: parsing error: org.xml.sax.SAXParseException: An invalid
second &apos;:&apos; was found in the element type or
tribute name.
 faultActor: /soap/servlet/rpcrouter
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace: AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
 faultSubcode:
 faultString: parsing error: org.xml.sax.SAXParseException: An invalid
second &amp;apos;:&amp;apos; was found in the element
pe or attribute name.
 faultActor: /soap/servlet/rpcrouter
 faultNode:
 faultDetail:

parsing error: org.xml.sax.SAXParseException: An invalid second ':'
was found in the element type or attribute name.


Thanks,
Jaidev.

On Thu, 03 Mar 2005 15:12:02 +1000, Matt Robinson
<ma...@flightcentre.com> wrote:
> Have you tried:
> 
> Float resp = (Float)call.invoke( new QName("http://www.xmethods.net/sd/TemperatureService.wsdl"), new Object[] { zipcode } );
> 
> (i.e., use the targetNamespace value from the WSDL).
> 
> Kind Regards,
> 
> Matt Robinson
> axis-user@ws.apache.org,Internet writes:
> >THANKS FOR THE REPLY.
> >
> >The WSDL for the service is like this :
> >
> ><?xml version="1.0" ?>
> >- <definitions name="TemperatureService"
> >targetNamespace="http://www.xmethods.net/sd/TemperatureService.wsdl"
> >xmlns:tns="http://www.xmethods.net/sd/TemperatureService.wsdl"
> >xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >xmlns="http://schemas.xmlsoap.org/wsdl/">
> >- <message name="getTempRequest">
> >  <part name="zipcode" type="xsd:string" />
> >  </message>
> >- <message name="getTempResponse">
> >  <part name="return" type="xsd:float" />
> >  </message>
> >- <portType name="TemperaturePortType">
> >- <operation name="getTemp">
> >  <input message="tns:getTempRequest" />
> >  <output message="tns:getTempResponse" />
> >  </operation>
> >  </portType>
> >- <binding name="TemperatureBinding" type="tns:TemperaturePortType">
> >  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
> >- <operation name="getTemp">
> >  <soap:operation soapAction="" />
> >- <input>
> >  <soap:body use="encoded" namespace="urn:xmethods-Temperature"
> >encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
> >  </input>
> >- <output>
> >  <soap:body use="encoded" namespace="urn:xmethods-Temperature"
> >encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
> >  </output>
> >  </operation>
> >  </binding>
> >- <service name="TemperatureService">
> >  <documentation>Returns current temperature in a given U.S.
> >zipcode</documentation>
> >- <port name="TemperaturePort" binding="tns:TemperatureBinding">
> >  <soap:address
> >location="http://services.xmethods.net:80/soap/servlet/rpcrouter" />
> >  </port>
> >  </service>
> >  </definitions>
> >
> >
> >
> >
> >Thanks
> >JAIDEV.
> >
> >
> >
> >
> >
> >
> >
> >
> >On Thu, 03 Mar 2005 14:30:07 +1000, Matt Robinson
> ><ma...@flightcentre.com> wrote:
> >> Can you forward the WSDL?  At least the relevant sections, including the namespace declarations?
> >>
> >>
> >> axis-user@ws.apache.org,Internet writes:
> >> >Hai all
> >> >
> >> >Am new to webservices.
> >> >Am facing this problem for couple of hours am not beign able to rectify it.
> >> >
> >> >Am trying to access one of the service from xmethods using AXIS.
> >> >
> >> >My client code is like this :
> >> >
> >> >import java.io.PrintStream;
> >> >import java.net.URL;
> >> >import javax.xml.rpc.ParameterMode;
> >> >import org.apache.axis.client.Call;
> >> >import org.apache.axis.client.Service;
> >> >import org.apache.axis.encoding.XMLType;
> >> >import org.apache.axis.utils.Options;
> >> >import  org.apache.axis.providers.java.RPCProvider;
> >> >import org.xml.sax.XMLReader;
> >> >
> >> >public class Temp
> >> >{
> >> >
> >> >    public Temp()
> >> >    {
> >> >    }
> >> >
> >> >    public static void main(String args[]) throws Exception
> >> >    {
> >> >        String endpoint =
> >> >"http://services.xmethods.net:80/soap/servlet/rpcrouter";
> >> >        String method = "getTemp";
> >> >               String zipcode = "67801";
> >> >
> >> >               Service service = new Service();
> >> >               Call call = (Call)service.createCall();
> >> >               call.setUseSOAPAction(true);
> >> >               call.setTargetEndpointAddress(new URL(endpoint));
> >> >               call.setOperationName(method);
> >> >
> >> >               call.addParameter("zipcode", XMLType.XSD_STRING, ParameterMode.IN);
> >> >
> >> >               call.setReturnType(XMLType.XSD_FLOAT);
> >> >
> >> >
> >> >
> >> >               Float resp = (Float)call.invoke(new Object[] {
> >> >                       zipcode
> >> >               });
> >> >
> >> >               System.out.println("Got result : " + resp.toString());
> >> >               return;
> >> >    }
> >> >}
> >> >
> >> >THE ERROR WHAT I AM GETTING WHEN I RUN THIS CLIENT IS :
> >> >
> >> >Exception in thread "main" AxisFault
> >> > faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
> >> > faultSubcode:
> >> > faultString: Unable to determine object id from call: is the method
> >> >element namespaced?
> >> > faultActor: /soap/servlet/rpcrouter
> >> > faultNode:
> >> > faultDetail:
> >> >        {http://xml.apache.org/axis/}stackTrace: AxisFault
> >> > faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
> >> > faultSubcode:
> >> > faultString: Unable to determine object id from call: is the method
> >> >element namespaced?
> >> > faultActor: /soap/servlet/rpcrouter
> >> > faultNode:
> >> > faultDetail:
> >> >
> >> >Unable to determine object id from call: is the method element namespaced?
> >> >
> >> >Can any on help me in this what is the problem with my client code.
> >> >
> >> >Thanks,
> >> >JAIDEV.
> >> >
> >> >
> >> >--
> >> >
> >>
> >> Kind Regards,
> >>
> >> Matt Robinson
> >
> >
> >--

>

Re: Getting Server.BadTargetObjectURI exception when running the client

Posted by Matt Robinson <ma...@flightcentre.com>.
Have you tried:

Float resp = (Float)call.invoke( new QName("http://www.xmethods.net/sd/TemperatureService.wsdl"), new Object[] { zipcode } );

(i.e., use the targetNamespace value from the WSDL).

Kind Regards,

Matt Robinson
axis-user@ws.apache.org,Internet writes:
>THANKS FOR THE REPLY.
>
>The WSDL for the service is like this :
>
><?xml version="1.0" ?> 
>- <definitions name="TemperatureService"
>targetNamespace="http://www.xmethods.net/sd/TemperatureService.wsdl"
>xmlns:tns="http://www.xmethods.net/sd/TemperatureService.wsdl"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>xmlns="http://schemas.xmlsoap.org/wsdl/">
>- <message name="getTempRequest">
>  <part name="zipcode" type="xsd:string" /> 
>  </message>
>- <message name="getTempResponse">
>  <part name="return" type="xsd:float" /> 
>  </message>
>- <portType name="TemperaturePortType">
>- <operation name="getTemp">
>  <input message="tns:getTempRequest" /> 
>  <output message="tns:getTempResponse" /> 
>  </operation>
>  </portType>
>- <binding name="TemperatureBinding" type="tns:TemperaturePortType">
>  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 
>- <operation name="getTemp">
>  <soap:operation soapAction="" /> 
>- <input>
>  <soap:body use="encoded" namespace="urn:xmethods-Temperature"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
>  </input>
>- <output>
>  <soap:body use="encoded" namespace="urn:xmethods-Temperature"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
>  </output>
>  </operation>
>  </binding>
>- <service name="TemperatureService">
>  <documentation>Returns current temperature in a given U.S.
>zipcode</documentation>
>- <port name="TemperaturePort" binding="tns:TemperatureBinding">
>  <soap:address
>location="http://services.xmethods.net:80/soap/servlet/rpcrouter" />
>  </port>
>  </service>
>  </definitions>
>
>
>
>
>Thanks
>JAIDEV.
>
>
>
>
>
>
>
>
>On Thu, 03 Mar 2005 14:30:07 +1000, Matt Robinson
><ma...@flightcentre.com> wrote:
>> Can you forward the WSDL?  At least the relevant sections, including the namespace declarations?
>> 
>> 
>> axis-user@ws.apache.org,Internet writes:
>> >Hai all
>> >
>> >Am new to webservices.
>> >Am facing this problem for couple of hours am not beign able to rectify it.
>> >
>> >Am trying to access one of the service from xmethods using AXIS.
>> >
>> >My client code is like this :
>> >
>> >import java.io.PrintStream;
>> >import java.net.URL;
>> >import javax.xml.rpc.ParameterMode;
>> >import org.apache.axis.client.Call;
>> >import org.apache.axis.client.Service;
>> >import org.apache.axis.encoding.XMLType;
>> >import org.apache.axis.utils.Options;
>> >import  org.apache.axis.providers.java.RPCProvider;
>> >import org.xml.sax.XMLReader;
>> >
>> >public class Temp
>> >{
>> >
>> >    public Temp()
>> >    {
>> >    }
>> >
>> >    public static void main(String args[]) throws Exception
>> >    {
>> >        String endpoint =
>> >"http://services.xmethods.net:80/soap/servlet/rpcrouter";
>> >        String method = "getTemp";
>> >               String zipcode = "67801";
>> >
>> >               Service service = new Service();
>> >               Call call = (Call)service.createCall();
>> >               call.setUseSOAPAction(true);
>> >               call.setTargetEndpointAddress(new URL(endpoint));
>> >               call.setOperationName(method);
>> >
>> >               call.addParameter("zipcode", XMLType.XSD_STRING, ParameterMode.IN);
>> >
>> >               call.setReturnType(XMLType.XSD_FLOAT);
>> >
>> >
>> >
>> >               Float resp = (Float)call.invoke(new Object[] {
>> >                       zipcode
>> >               });
>> >
>> >               System.out.println("Got result : " + resp.toString());
>> >               return;
>> >    }
>> >}
>> >
>> >THE ERROR WHAT I AM GETTING WHEN I RUN THIS CLIENT IS :
>> >
>> >Exception in thread "main" AxisFault
>> > faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
>> > faultSubcode:
>> > faultString: Unable to determine object id from call: is the method
>> >element namespaced?
>> > faultActor: /soap/servlet/rpcrouter
>> > faultNode:
>> > faultDetail:
>> >        {http://xml.apache.org/axis/}stackTrace: AxisFault
>> > faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
>> > faultSubcode:
>> > faultString: Unable to determine object id from call: is the method
>> >element namespaced?
>> > faultActor: /soap/servlet/rpcrouter
>> > faultNode:
>> > faultDetail:
>> >
>> >Unable to determine object id from call: is the method element namespaced?
>> >
>> >Can any on help me in this what is the problem with my client code.
>> >
>> >Thanks,
>> >JAIDEV.
>> >
>> >
>> >--
>> >Jaidev.Nair
>> >Software Engineer
>> >eDrugStore - Web Services
>> >Inspired By Inovation®
>> >www.benchmarksoft.com
>> >
>> >Ph : +91 44 24987589  Extn : 150
>> >
>> >Cut me and ...  i will bleed Java !
>> >
>> 
>> Kind Regards,
>> 
>> Matt Robinson
>
>
>-- 
>Jaidev.Nair
>Software Engineer
>eDrugStore - Web Services 
>Inspired By Inovation®
>www.benchmarksoft.com
>
>Ph : +91 44 24987589  Extn : 150
>
>Cut me and ...  i will bleed Java !
>


Re: Getting Server.BadTargetObjectURI exception when running the client

Posted by Jaidev Nair <ja...@gmail.com>.
THANKS FOR THE REPLY.

The WSDL for the service is like this :

<?xml version="1.0" ?> 
- <definitions name="TemperatureService"
targetNamespace="http://www.xmethods.net/sd/TemperatureService.wsdl"
xmlns:tns="http://www.xmethods.net/sd/TemperatureService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
- <message name="getTempRequest">
  <part name="zipcode" type="xsd:string" /> 
  </message>
- <message name="getTempResponse">
  <part name="return" type="xsd:float" /> 
  </message>
- <portType name="TemperaturePortType">
- <operation name="getTemp">
  <input message="tns:getTempRequest" /> 
  <output message="tns:getTempResponse" /> 
  </operation>
  </portType>
- <binding name="TemperatureBinding" type="tns:TemperaturePortType">
  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 
- <operation name="getTemp">
  <soap:operation soapAction="" /> 
- <input>
  <soap:body use="encoded" namespace="urn:xmethods-Temperature"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
  </input>
- <output>
  <soap:body use="encoded" namespace="urn:xmethods-Temperature"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
  </output>
  </operation>
  </binding>
- <service name="TemperatureService">
  <documentation>Returns current temperature in a given U.S.
zipcode</documentation>
- <port name="TemperaturePort" binding="tns:TemperatureBinding">
  <soap:address
location="http://services.xmethods.net:80/soap/servlet/rpcrouter" />
  </port>
  </service>
  </definitions>




Thanks
JAIDEV.








On Thu, 03 Mar 2005 14:30:07 +1000, Matt Robinson
<ma...@flightcentre.com> wrote:
> Can you forward the WSDL?  At least the relevant sections, including the namespace declarations?
> 
> 
> axis-user@ws.apache.org,Internet writes:
> >Hai all
> >
> >Am new to webservices.
> >Am facing this problem for couple of hours am not beign able to rectify it.
> >
> >Am trying to access one of the service from xmethods using AXIS.
> >
> >My client code is like this :
> >
> >import java.io.PrintStream;
> >import java.net.URL;
> >import javax.xml.rpc.ParameterMode;
> >import org.apache.axis.client.Call;
> >import org.apache.axis.client.Service;
> >import org.apache.axis.encoding.XMLType;
> >import org.apache.axis.utils.Options;
> >import  org.apache.axis.providers.java.RPCProvider;
> >import org.xml.sax.XMLReader;
> >
> >public class Temp
> >{
> >
> >    public Temp()
> >    {
> >    }
> >
> >    public static void main(String args[]) throws Exception
> >    {
> >        String endpoint =
> >"http://services.xmethods.net:80/soap/servlet/rpcrouter";
> >        String method = "getTemp";
> >               String zipcode = "67801";
> >
> >               Service service = new Service();
> >               Call call = (Call)service.createCall();
> >               call.setUseSOAPAction(true);
> >               call.setTargetEndpointAddress(new URL(endpoint));
> >               call.setOperationName(method);
> >
> >               call.addParameter("zipcode", XMLType.XSD_STRING, ParameterMode.IN);
> >
> >               call.setReturnType(XMLType.XSD_FLOAT);
> >
> >
> >
> >               Float resp = (Float)call.invoke(new Object[] {
> >                       zipcode
> >               });
> >
> >               System.out.println("Got result : " + resp.toString());
> >               return;
> >    }
> >}
> >
> >THE ERROR WHAT I AM GETTING WHEN I RUN THIS CLIENT IS :
> >
> >Exception in thread "main" AxisFault
> > faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
> > faultSubcode:
> > faultString: Unable to determine object id from call: is the method
> >element namespaced?
> > faultActor: /soap/servlet/rpcrouter
> > faultNode:
> > faultDetail:
> >        {http://xml.apache.org/axis/}stackTrace: AxisFault
> > faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
> > faultSubcode:
> > faultString: Unable to determine object id from call: is the method
> >element namespaced?
> > faultActor: /soap/servlet/rpcrouter
> > faultNode:
> > faultDetail:
> >
> >Unable to determine object id from call: is the method element namespaced?
> >
> >Can any on help me in this what is the problem with my client code.
> >
> >Thanks,
> >JAIDEV.
> >
> >
> >--
> >Jaidev.Nair
> >Software Engineer
> >eDrugStore - Web Services
> >Inspired By Inovation®
> >www.benchmarksoft.com
> >
> >Ph : +91 44 24987589  Extn : 150
> >
> >Cut me and ...  i will bleed Java !
> >
> 
> Kind Regards,
> 
> Matt Robinson
> 
> E-Commerce
> Level 7
> Flight Centre Limited
> 316 Adelaide Street
> Brisbane  QLD 4000
> 
> Ph: 3032 9488
> Mob: 0414 385 600
> http://www.flightcentre.com
> 
> 


-- 
Jaidev.Nair
Software Engineer
eDrugStore - Web Services 
Inspired By Inovation®
www.benchmarksoft.com

Ph : +91 44 24987589  Extn : 150

Cut me and ...  i will bleed Java !

Re: Getting Server.BadTargetObjectURI exception when running the client

Posted by Matt Robinson <ma...@flightcentre.com>.
Can you forward the WSDL?  At least the relevant sections, including the namespace declarations?


axis-user@ws.apache.org,Internet writes:
>Hai all
>
>Am new to webservices.
>Am facing this problem for couple of hours am not beign able to rectify it.
>
>Am trying to access one of the service from xmethods using AXIS.
>
>My client code is like this :
>
>import java.io.PrintStream;
>import java.net.URL;
>import javax.xml.rpc.ParameterMode;
>import org.apache.axis.client.Call;
>import org.apache.axis.client.Service;
>import org.apache.axis.encoding.XMLType;
>import org.apache.axis.utils.Options;
>import  org.apache.axis.providers.java.RPCProvider;
>import org.xml.sax.XMLReader;
>
>public class Temp
>{
>
>    public Temp()
>    {
>    }
>
>    public static void main(String args[]) throws Exception
>    {
>        String endpoint =
>"http://services.xmethods.net:80/soap/servlet/rpcrouter";
>        String method = "getTemp";
>		String zipcode = "67801";
>		
>		Service service = new Service();
>		Call call = (Call)service.createCall();
>		call.setUseSOAPAction(true);
>		call.setTargetEndpointAddress(new URL(endpoint));
>		call.setOperationName(method);
>		
>		call.addParameter("zipcode", XMLType.XSD_STRING, ParameterMode.IN);
>		
>		call.setReturnType(XMLType.XSD_FLOAT);
>
>		
>
>		Float resp = (Float)call.invoke(new Object[] {
>			zipcode
>		});
>
>		System.out.println("Got result : " + resp.toString());
>		return;
>    }
>}
>
>THE ERROR WHAT I AM GETTING WHEN I RUN THIS CLIENT IS :
>
>Exception in thread "main" AxisFault
> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
> faultSubcode:
> faultString: Unable to determine object id from call: is the method
>element namespaced?
> faultActor: /soap/servlet/rpcrouter
> faultNode:
> faultDetail:
>        {http://xml.apache.org/axis/}stackTrace: AxisFault
> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.BadTargetObjectURI
> faultSubcode:
> faultString: Unable to determine object id from call: is the method
>element namespaced?
> faultActor: /soap/servlet/rpcrouter
> faultNode:
> faultDetail:
>
>Unable to determine object id from call: is the method element namespaced?
>
>Can any on help me in this what is the problem with my client code.
>
>Thanks,
>JAIDEV.
>
>
>-- 
>Jaidev.Nair
>Software Engineer
>eDrugStore - Web Services 
>Inspired By Inovation®
>www.benchmarksoft.com
>
>Ph : +91 44 24987589  Extn : 150
>
>Cut me and ...  i will bleed Java !
>



Kind Regards,

Matt Robinson

E-Commerce
Level 7
Flight Centre Limited
316 Adelaide Street
Brisbane  QLD 4000

Ph: 3032 9488
Mob: 0414 385 600
http://www.flightcentre.com