Hi Dan,
I am having a problem getting the simple example to work with the latest
/dist/ws/muse/2.2.0/bin.
I saw the resource initialize in Tomcat and the initialization messages and
incoming soap message are in the muse.log file in
WEB-INF\classes\log\muse.log
I am using j2ee axis2.
The error is:
Error is org.apache.muse.ws.addressing.soap.SoapFault: [ID =
'DestinationUnreachable'] There is no resource available at the given EPR:
Steps below
Thanks,
Chuck
0. Built from scratch
- Renamed original simple directory and created a directory named
simple\ wsdl directory and copied the wsdl files from the simple example.
1. Build the server piece: C:\musework\muse-2.2.0-bin\bin\wsdl2java -j2ee
axis2 -overwrite -wsdl c:\musework\muse-
2.2.0-bin\samples\j2ee\simple\wsdl\SimpleResource.wsdl
2. Run ant (apache-ant 1.6.5)
3. Copy the resulting war file to the tomcat webapps directory:
C:\MuseWork\muse-2.2.0-bin\samples\j2ee\simple>copy *.war
C:\MuseWork\apache-tomcat-5.5.20\webapps
4. Build the client piece: C:\musework\muse-2.2.0-bin\bin\wsdl2java -j2ee
axis2 -proxy -overwrite -wsdl
c:\musework\muse-2.2.0-bin\samples\j2ee\simple\wsdl\SimpleResource.wsdl
5. Run ant
6. Start up tomcat to deploy the simple.war file
7. Create a new java project in eclipse Uses jre1.5.0_108.
Executed client from eclipse.
===============================================
*try*
{ //
// change these to point to different applications/servers
//
String contextPath = /SimpleWork/services/SimpleResource" ;
*int* port = 8080;
//
// create EPR for test resource
//
URI address = *getLocalAddress *(contextPath, port);
EndpointReference epr = *new* EndpointReference(address);
*addReferenceParameter *(epr);
//
// create proxy - turn on tracing of SOAP messages
//
SimpleResourceClient client = *new* SimpleResourceClient(epr);
client.setTrace(* true* );
//
// test FirstCapability.firstOperation
//
client.firstOperation( "Hello, World!" );
//
// test SecondCapability.secondOperation
//
client.secondOperation(42, *new* QName("http://ibm.com" , "Test",
"ibm" ));
//
// test WS-MEx GetMetadata with WSDL dialect
//
MetadataExchangeClient wsxClient = *new*MetadataExchangeClient(epr);
wsxClient.setTrace(* true* );
//
// make sure WSDL is valid using WSDL4J
//
Element wsdl = wsxClient.getWSDL();
WSDLFactory.*newInstance *().newWSDLReader().readWSDL((String)*
null *, wsdl);
}
*catch* (Throwable error)
{
error.printStackTrace();
}
}
=======================================
Console output:
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://138.42.149.141:8080/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:48eedf9b-254b-8826-bd6a-396fd5a51bb7</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> <first:FirstOperation xmlns:first="
http://ws.apache.org/muse/test/simple/first">Hello,
World!</first:FirstOperation>
</soap:Body></soap:Envelope> [CLIENT TRACE] SOAP envelope contents
(incoming):<soapenv:Envelope xmlns:soapenv="
http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://www.w3.org/2005/08/addressing ">
<soapenv:Header>
<wsa:To>http://www.w3.org/2005/08/addressing/anonymous </wsa:To>
<wsa:ReplyTo> <wsa:Address>http://www.w3.org/2005/08/addressing/none
</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:1982FAF06C7020492B11750884481072</wsa:MessageID>
<wsa:Action>
http://ws.apache.org/muse/test/simple/first/FirstOperation</wsa:Action>
<wsa:RelatesTo
wsa:RelationshipType="http://www.w3.org/2005/08/addressing/reply">uuid:48eedf9b-254b-8826-bd6a-396fd5a51bb7</wsa:RelatesTo>
</soapenv:Header> <soapenv:Body> <soap:Fault
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:tns="http://axis2.platform.core.muse.apache.org "> <soap:Code>
<soap:Value>soap:Sender</soap:Value> <soap:Subcode>
<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://138.42.149.141:8080/simple/services/SimpleResource</wsa:Address>
<wsa:ReferenceParameters> <muse-wsa:ResourceId xmlns:muse-wsa="
http://ws.apache.org/muse/addressing" 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://138.42.149.141:8080/simple/services/SimpleResource</wsa:Address>
</wsa:EndpointReference></soap:Text> </soap:Reason> </soap:Fault>
</soapenv:Body></soapenv: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://138.42.149.141:8080/simple/services/SimpleResource
</wsa:Address>
<wsa:ReferenceParameters> <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing
" 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://138.42.149.141:8080/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:65) at
org.apache.muse.test.simple.SimpleTestClient.main(SimpleTestClient.java:100)