xml-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tiago Fernandes Thomaz" <tiago.tho...@optimus.pt>
Subject URGENT: BadTargetObjectURI
Date Mon, 16 Sep 2002 11:51:01 GMT
Hi SOAP gurus!

I'm facing a quite anoying problem. 
I'm using Apache SOAP 2.2 and JBoss2.4.7-Tomcat4.0.4. The problem is due to the fact that
I'm requesting a service urn:SOAP
which has a mapping to a java class provider (com.mypackage.SOAPClass).
This version of JBoss creates all web contexts in a temporary folder like /tmp/soap.war/web1001/WEB-INF/classes/org/apache/soap/...
.
When JBoss starts up it deploys all the content contained in /deploy directory which has soap.war
file with com.mypackage.SOAPClass, DeployedServices.ds and DeploymentDescriptor.xml files.
since the only service that I want is urn:SOAP which consists on mapping to the java class
provider I previously added those 3 files to soap.war file.
So, when the soap context is generated at JBoss runtime, it has also com.mypackage.SOAPClass.

My java SOAP client code is:

SOAP.java:

import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;

public class SOAP
{
  public static void main (String[] args) throws Exception
  {
    URL url = new URL("http://localhost:8080/soap/servlet/rpcrouter");
    String sXML = null;

    for (int i = 0; i < 1; i++)
    {

      sXML = "Hello Tiago!";

      Call call = new Call();
      call.setTargetObjectURI("urn:SOAP");
      call.setMethodName("method01");
      call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encoding/");
      Vector params = new Vector();
      params.addElement(new org.apache.soap.rpc.Parameter("sXML", String.class, sXML, null));

      call.setParams(params);

      (new TestThread(call, url)).start();
    }
  }
}


TestThread.java:

import java.net.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;

public class TestThread extends Thread
{
  Call testCall = null;
  URL  url = null;
  ObjectRequest objR = new ObjectRequest();

  public TestThread(Call testCall, URL url)
  {
    this.testCall = testCall;
    this.url = url;
  }

  public void run()
  {
    try {
      org.apache.soap.rpc.Response resp = testCall.invoke(url, "");

      if (resp.generatedFault())
      {
        Fault fault = resp.getFault();
        System.out.println(this.getName() + " - Fault Code   = " + fault.getFaultCode());
        System.out.println(this.getName() + " - Fault String = " + fault.getFaultString());
        System.out.println(this.getName() + " - Fault ActorURI = " + fault.getFaultActorURI());
        System.out.println(this.getName() + " - Fault DetailEntries = " + fault.getDetailEntries());
      }
      else
      {
        org.apache.soap.rpc.Parameter result = resp.getReturnValue();
        String res = result.toString();
        Object obj = result.getValue();
        String resp2 = obj.toString();
        System.out.println(this.getName()+" - Result: "+resp2);
      }
    }
    catch (Exception e)
    {
      System.out.println(this.getName() + " :Error! - " + e.getMessage());
    }
  }
}

I keep getting the following error:

SOAP Server: BadTargetObjectURI
Unable to resolve target: com.mypackage.SOAPClass
Fault ActorURI: /soap/servlet/rpcrouter

The question is that if I set the SOAP Service with the wrong name, for instance:

 call.setTargetObjectURI("urn:SOA");

I get another error: 

SOAP Server: service "urn:SOA" unknown
Fault ActorURI: /soap/servlet/rpcrouter

which means, I presume, that the servlet rpcrouter couldn't find that service in DeployedServices.ds,
which is different from the first error.
I believe that in the first case, the SOAP request is catched by rpcrouter but it cannot be
mapped to the java class provider.
Am I wrong? 
What do you think might be the problem?
I would appreciate a lot any help provided.

My best,

Tiago Fernandes Thomaz


--
To unsubscribe, e-mail:   <mailto:soap-dev-unsubscribe@xml.apache.org>
For additional commands, e-mail: <mailto:soap-dev-help@xml.apache.org>


Mime
View raw message