« Return to Thread: about SimpleWsResource and SimpleResource

about SimpleWsResource and SimpleResource

by SARA1232007 :: Rate this Message:

Reply to Author | View in Thread

Hi,

I modify the simple example to add a new property.
For SimpleResource definition in muse.xml, I alter the java-resource-class definition as following:

        <java-id-factory-class>org.apache.muse.core.routing.CounterResourceIdFactory</java-id-factory-class>
        <java-resource-class>org.apache.muse.ws.resource.impl.SimpleWsResource</java-resource-class>

I run the client which extends WsResourceClient class to invoke firstOperation, and I get "There is no resource available at the given EPR" exception from client.The trace information from client as following:

[CLIENT TRACE] SOAP envelope contents (outgoing):

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://127.0.0.1:8086/simple/services/SimpleResource</wsa:To>
        <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://ws.apache.org/muse/test/simple/first/FirstOperation</wsa:Action>
        <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:2ba3f950-9ab8-8759-1749-57cbe781cd1b</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
            <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
        </wsa:From>
        <muse-wsa:ResourceId
            xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
            xmlns:wsa="http://www.w3.org/2005/08/addressing" wsa:IsReferenceParameter="true">MuseResource-1</muse-wsa:ResourceId>
    </soap:Header>
    <soap:Body>
        <FirstOperation xmlns="http://ws.apache.org/muse/test/simple/first">Hello, World!</FirstOperation>
    </soap:Body>
</soap:Envelope>

[CLIENT TRACE] SOAP envelope contents (incoming):

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
        <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/fault</wsa:Action>
        <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:160b9c61-df5e-be27-e3b0-c5f8ba9a2f88</wsa:MessageID>
        <wsa:RelatesTo RelationshipType="wsa:Reply" xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:2ba3f950-9ab8-8759-1749-57cbe781cd1b</wsa:RelatesTo>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
            <wsa:Address>http://127.0.0.1:8086/simple/services/SimpleResource</wsa:Address>
            <wsa:ReferenceParameters>
                <muse-wsa:ResourceId wsa:IsReferenceParameter="true"
                    xmlns:muse-wsa="http://ws.apache.org/muse/addressing" xmlns:wsa="http://www.w3.org/2005/08/addressing">MuseResource-1</muse-wsa:ResourceId>
            </wsa:ReferenceParameters>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <soap:Code>
                <soap:Value>soap:Sender</soap:Value>
                <soap:Subcode xmlns:wsa="http://www.w3.org/2005/08/addressing">
                    <soap:Value>wsa:DestinationUnreachable</soap:Value>
                </soap:Subcode>
            </soap:Code>
            <soap:Reason>
                <soap:Text>[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:8086/simple/services/SimpleResource</wsa:Address>
    <wsa:ReferenceParameters>
        <muse-wsa:ResourceId
            xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
            wsa:IsReferenceParameter="true" xmlns:wsa="http://www.w3.org/2005/08/addressing">MuseResource-1</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</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"/>
    <wsa:Address>http://127.0.0.1:8086/simple/services/SimpleResource</wsa:Address>
</wsa:EndpointReference>
</soap:Text>
            </soap:Reason>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

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:8086/simple/services/SimpleResource</wsa:Address>
    <wsa:ReferenceParameters>
        <muse-wsa:ResourceId
            xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
            wsa:IsReferenceParameter="true" xmlns:wsa="http://www.w3.org/2005/08/addressing">MuseResource-1</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</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"/>
    <wsa:Address>http://127.0.0.1:8086/simple/services/SimpleResource</wsa:Address>
</wsa:EndpointReference>
        at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:298)
        at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
        at org.apache.muse.test.simple.SimpleResourceClient.firstOperation(SimpleResourceClient.java:67)
        at org.apache.muse.test.simple.SimpleTestClient.main(SimpleTestClient.java:105)


Can anyone tell me what is wrong?

Thanks!

Sara

 « Return to Thread: about SimpleWsResource and SimpleResource