You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by ju...@bt.com on 2009/10/05 11:27:29 UTC

Extra headers not working

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</wsa
: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</wsa
: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</wsa
:Address>
</wsa:EndpointReference>
	at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.java:298)
	at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
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.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
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(JUn
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(RemoteTe
stRunner.java:467)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:683)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:390)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:197)

Thanks

JuanLu

Re: Extra headers not working

Posted by Chris Twiner <ch...@gmail.com>.
Ah ok, that unfortunately makes sense.  If you want persisted routing
entries you have to enable them, see the wsn-consumer examples.


<persistence>
			<java-persistence-class>org.apache.muse.core.routing.RouterFilePersistence</java-persistence-class>
			<persistence-location>router-entries</persistence-location>
		</persistence>

must be enabled in muse.xml and the router-entries must be set out
similar to the wsn example.  If  you want to have a different
persistence scheme you can provide your own persistence class.

With the default you must ensure that the numbering of the file names
are unique but after that you can add/remove the actual number
parameters to not require reference params eg.

<?xml version="1.0" encoding="UTF-8"?>
<wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing"/>

in the resource-instance-X.xml file.

If you do not enable persistence then each resource will get an
incremental reference parameter associated with it, which can be less
than helpful because - as you've found - the reference paremeter
number could change with each change in the muse (add remove of
resources for example).

Its also worth noting that you seem to have two instances running at
the same address, if this is intentional you should definitely look at
customising the reference params to indicate which resource is which.
For example each store could have its id as a reference.

On Mon, Oct 5, 2009 at 12:24 PM,  <ju...@bt.com> 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:chris.twiner@gmail.com]
> Sent: 05 October 2009 11:09
> To: muse-user@ws.apache.org
> 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,  <ju...@bt.com> 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
>>
>

Re: Extra headers not working

Posted by Lenni Madsen <l....@mil.dk>.
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, <ju...@bt.com>  
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:chris.twiner@gmail.com]
> Sent: 05 October 2009 11:09
> To: muse-user@ws.apache.org
> 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,  <ju...@bt.com>  
> 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: l.madsen@mil.dk




RE: Extra headers not working

Posted by ju...@bt.com.
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:chris.twiner@gmail.com] 
Sent: 05 October 2009 11:09
To: muse-user@ws.apache.org
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,  <ju...@bt.com> 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
>

Re: Extra headers not working

Posted by Chris Twiner <ch...@gmail.com>.
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,  <ju...@bt.com> 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</wsa
> :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</wsa
> :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</wsa
> :Address>
> </wsa:EndpointReference>
>        at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> t.java:298)
>        at
> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
> 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.jav
> a:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> 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(JUn
> 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(RemoteTe
> stRunner.java:467)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
> stRunner.java:683)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
> ner.java:390)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
> nner.java:197)
>
> Thanks
>
> JuanLu
>