ahh.. in that case, you forgot to cleanup, let me try to explain.

This is how I think your program is working in rough steps:

1) call clientprpxy
2) clientproxy initializes a server-instance
3) you make some calls to the server-instance

4) you call the clientproxy again (same epr)
5) the cleintproxy tries to instantiate a new server-instance at the same EPR (alreay in use -> instantiation fails), with muse-resource param <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing ">MuseResource-2</muse-wsa:ResourceId>


possible test solution(s):
A) try a new EPR (hint: make sure you don't reuse the same MuseResource-2) B) restart the server-side apache (if using two different apache servers)

permanent solution if A) works make sure you call <instance>.shutdown (); to remove the initialized instance at the EPR

/Lenni
On Oct 5, 2009, at 12:24 GMT+02:00, <[email protected]> wrote:

The think is that it works the first time that I run it after I deploy it, but afterwards that is the error, as far as I know the epr shouldn't change at all.

-----Original Message-----
From: Chris Twiner [mailto:[email protected]]
Sent: 05 October 2009 11:09
To: [email protected]
Subject: Re: Extra headers not working

Unless I'm missing something you aren't using the right epr. As the error message is telling you :

<wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
      <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/ addressing">MuseResource-2</
mu
se-wsa:ResourceId>
  </wsa:ReferenceParameters>

seems to be missing.

epr.addParameter(WsaConstants.DEFAULT_RESOURCE_ID_QNAME, "MuseResource-" + x);

should help.

On Mon, Oct 5, 2009 at 11:27 AM, <[email protected]> wrote:
Hi all,

I have built a client for my muse app with wsd2java and I have added
the flag -headers to be able to add headers to the call that I need to
extract with another component.

The proxy has been generated w/out any problem and it has the new
parameter Element[] in all the methods. To test it I am putting null
just to make a normal call to the webapp and I am having this issue.

This is the call I am doing:

public void testCreate() throws SoapFault {
               proxy = new WsSongStoreProxy(new
EndpointReference(URI.create(providerUrl)), null);
               proxy = new WsSongStoreProxy (elemToEpr
(proxy.createOperation(null)), null);
               proxy.setTrace(true);
       }

And this is the trace with the error I am getting.

org.apache.muse.ws.addressing.soap.SoapFault: [ID =
'DestinationUnreachable'] There is no resource available at the given
EPR:

<wsa:EndpointReference
xmlns:wsa="http://www.w3.org/2005/08/addressing";>

<wsa:Address>http://127.0.0.1:8080/WsSongStore/services/ WsSongStore</w
sa
:Address>
</wsa:EndpointReference>

The existing EPRs hosted by this endpoint are:

<wsa:EndpointReference
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
   <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
       <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/ addressing">MuseResource-2</
mu
se-wsa:ResourceId>
   </wsa:ReferenceParameters>

<wsa:Address>http://127.0.0.1:8080/WsSongStore/services/ WsSongStore</w
sa
:Address>
</wsa:EndpointReference>

<wsa:EndpointReference
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
   <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing";>
       <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/ addressing">MuseResource-3</
mu
se-wsa:ResourceId>
   </wsa:ReferenceParameters>

<wsa:Address>http://127.0.0.1:8080/WsSongStore/services/ WsSongStore</w
sa
:Address>
</wsa:EndpointReference>
       at
org.apache.muse.core.AbstractResourceClient.invoke (AbstractResourceCli
en
t.java:298)
       at
org.apache.muse.core.AbstractResourceClient.invoke (AbstractResourceCli
en
t.java:232)
       at
test.proxy.WsSongStoreProxy.createOperation(WsSongStoreProxy.java: 131)
       at core.testHeaders.testCreate(testHeaders.java:26)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.j
av
a:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccess
or
Impl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at junit.framework.TestCase.runTest(TestCase.java:164)
       at junit.framework.TestCase.runBare(TestCase.java:130)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java: 124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:120)
       at junit.framework.TestSuite.runTest(TestSuite.java:230)
       at junit.framework.TestSuite.run(TestSuite.java:225)
       at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run (J
Un
it3TestReference.java:130)
       at
org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.
ja
va:38)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (Remote
Te
stRunner.java:467)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (Remote
Te
stRunner.java:683)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestR
un
ner.java:390)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTest
Ru
nner.java:197)

Thanks

JuanLu


Lenni Madsen

Security Architect,
Dip. Eng. m. IDA.

Danish Defence IT
Helseholmen 1
2650 Hvidovre

Tel: (+45) 4567 7236
Mob: (+45) 2621 0011
Email: [email protected]



Reply via email to