Hi,
Sorry for posting again, but I really would like to solve this...
When I'm using the client with rampart included and Web service's
services.xml -file doesn't have rampart included (see below) I'm
receiving "WSDoAllReceiver: Incoming message does not contain required
Security header" error message. When I include the rampart section in
services.xml then I receive "The server did not recognise the action
which it received". So I think that request goes to the server (the
"Incoming message does not..." error is coming from Web service, I
think) but it just can't find the action.
************************************************************
<module ref="rampart" />
<parameter name="InflowSecurity">
<action>
<items>Timestamp Signature</items>
<signaturePropFile>service.properties</signaturePropFile>
</action>
</parameter>
<parameter name="OutflowSecurity">
<action>
<items>Timestamp Signature</items>
<user>client</user>
<signaturePropFile>service.properties</signaturePropFile>
<passwordCallbackClass>org.test.handlers.PWCBHandler</passwordCallbackCl
ass>
<signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
</action>
</parameter>
BR,
VP
________________________________
From: Veli-Pekka Rannila
Sent: 12 March 2008 11:22
To: [email protected]
Subject: FW: Problem with calling web service
Hi again,
I have used ADB when generating the codes with wsdl2java if that is
important.
Thanks!
BR,
VP
________________________________
From: Veli-Pekka Rannila
Sent: 12 March 2008 11:06
To: [email protected]
Subject: Problem with calling web service
Hi all,
I am using Axis2 v1.3 and Rampart v1.3. I'm running my web service under
Tomcat. I'm using Java 1.5. I should solve this problem within 2 days so
every help is very much welcome!
I put my question here so you can see it easily. Explanations what I
have done you can find below.
Question:
What is the right syntax for calling a web service when using rampart
and when actionmapping is empty (ie. "") in wsdl/services.xml? Do I need
some other configurations? Changing the customer's wsdl or customer's
web service is not possible. If someone would be so kind and send me a
short example of working client. Thank you!
So here are the things that I have done:
***********************************************
I created the service from the wsdl by using wsdl2java. No problems.
I created the stubs from the wsdl by using wsdl2java. No problems.
I created the client and I imported the jar file that has the stubs. No
problems.
I use TCPMon to check out the messages (messages seems to be in order).
When I first run the client I use the following client code (you can see
part of it):
************************************************************
System.err.println(" Call starts");
CFServiceStub stub = new
CFServiceStub("http://localhost:8082/axis2/services/CFService");
//stub._getServiceClient().getOptions().setAction("");
stub._getServiceClient().getOptions().setAction("urn:uploadFile");
stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(30000);
CFServiceStub.UploadFilein uploadFileinElement = new
CFServiceStub.UploadFilein();
CFServiceStub.UploadFileRequest uploadFileRequest = new
CFServiceStub.UploadFileRequest();
CFServiceStub.RequestHeader requestHeader = new
CFServiceStub.RequestHeader();
requestHeader.setReceiverId("RecId");
requestHeader.setRequestId("ReqId");
DataHandler dataHandlerAppReq = null;
uploadFileRequest.setApplicationRequest(dataHandlerAppReq);
uploadFileRequest.setRequestHeader(requestHeader);
uploadFileinElement.setUploadFilein(uploadFileRequest);
CFServiceStub.UploadFileout uploadFileOut =
stub.uploadFile(uploadFileinElement);
System.err.println(" Call ends");
************************************************************
The result is OK so it works and I can get the results.
Then I try to take Rampart in use. I changed my client code as follows
(paths of AXIS2_CLIENT_REPO and AXIS2_XML are valid):
************************************************************
System.err.println(" Call starts");
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXI
S2_CLIENT_REPO, AXIS2_XML);
CFServiceStub stub = new CFServiceStub(configContext,
"http://localhost:8082/axis2/services/CFService");
//stub._getServiceClient().getOptions().setAction("");
stub._getServiceClient().getOptions().setAction("urn:uploadFile");
stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(30000);
CFServiceStub.UploadFilein uploadFileinElement = new
CFServiceStub.UploadFilein();
CFServiceStub.UploadFileRequest uploadFileRequest = new
CFServiceStub.UploadFileRequest();
CFServiceStub.RequestHeader requestHeader = new
CFServiceStub.RequestHeader();
requestHeader.setReceiverId("RecId");
requestHeader.setRequestId("ReqId");
DataHandler dataHandlerAppReq = null;
uploadFileRequest.setApplicationRequest(dataHandlerAppReq);
uploadFileRequest.setRequestHeader(requestHeader);
uploadFileinElement.setUploadFilein(uploadFileRequest);
CFServiceStub.UploadFileout uploadFileOut =
stub.uploadFile(uploadFileinElement);
System.err.println(" Call ends");
************************************************************
Now I'm getting the error: "The server did not recognise the action
which it received"
I have tried pretty much everything but I don't manage to get the client
code to work. Below you can find part of my axis2.xml and wsdl.
I can make this client code to work if I change services.xml file of my
Web service. But this is not solution because customer don't want to
change their wsdl/services.xml. It is also valid way to use "" in
actionMapping element (according to specs).
This is part of the services.xml with original data in it (this doesn't
work when using rampart):
************************************************************
<operation name="uploadFile" mep="http://www.w3.org/ns/wsdl/in-out">
<actionMapping>""</actionMapping>
<outputActionMapping>http://xxx.org/CFService/CFServicePortType/uploadFi
leResponse</outputActionMapping>
<faultActionMapping
faultName="FileServiceFaultDetail">http://xxx.org/CFService/CFServicePor
tType/uploadFile/Fault/FServiceFaultDetail</faultActionMapping>
</operation>
************************************************************
Then I changed the services.xml a little bit and added "urn:uploadFile"
inside actionMapping element.
This is part of the services.xml with CHANGED data in it (this works
when using rampart) This is not a solution because customer won't do
that:
************************************************************
<operation name="uploadFile" mep="http://www.w3.org/ns/wsdl/in-out">
<actionMapping>urn:uploadFile</actionMapping>
<outputActionMapping>http://xxx.org/CFService/CFServicePortType/uploadFi
leResponse</outputActionMapping>
<faultActionMapping
faultName="FileServiceFaultDetail">http://xxx.org/CFService/CFServicePor
tType/uploadFile/Fault/FServiceFaultDetail</faultActionMapping>
</operation>
************************************************************
My axis2.xml have the following lines:
************************************************************
<module ref="rampart" />
<parameter name="OutflowSecurity">
<action>
<items>Timestamp Signature</items>
<user>client</user>
<signaturePropFile>client.properties</signaturePropFile>
<passwordCallbackClass>org.test.handlers.PWCBHandler</passwordCallbackCl
ass>
<signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
</action>
</parameter>
<parameter name="InflowSecurity">
<action>
<items>Timestamp Signature</items>
<signaturePropFile>client.properties</signaturePropFile>
</action>
</parameter>
************************************************************
Below you can find part of the wsdl (so you can see that soapAction=""):
************************************************************
<s1:operation name="uploadFile">
<s4:operation soapAction="" style="document"/>
<s1:input>
<s4:body parts="uploadFilein" use="literal"/>
</s1:input>
<s1:output>
<s4:body parts="uploadFileout" use="literal"/>
</s1:output>
<s1:fault name="FileServiceFaultDetail">
<s4:fault name="FileServiceFaultDetail" use="literal"/>
</s1:fault>
</s1:operation>
************************************************************
This is part of message taken from TCPMon:
************************************************************
"
...
SOAPAction: "urn:uploadFile"
...
<wsa:To>http://localhost:8082/axis2/services/CFService</wsa:To>
<wsa:MessageID>urn:uuid:E2EBDFDBE7B1D9743C1205310441034</wsa:MessageID>
<wsa:Action>urn:uploadFile</wsa:Action>
...
"
Thanks a lot!
BR,
VP