CheckList
WSDL
SOAPAction
https://www.wsdl-analyzer.com/
WSO2ESB;
@format is required to specify soap-version.
transports="https"
statistics="disable"
trace="disable"
startOnLoad="true">
format="soap11"/>
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://www.kiatnakinbank.com/services/abc"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:intf="http://www.kiatnakinbank.com/services/abc"
targetNamespace="http://www.kiatnakinbank.com/services/abc">
targetNamespace="http://www.kiatnakinbank.com/services/abc">
targetNamespace="http://www.kiatnakinbank.com/services/abc/data">
Client, With WS-Policy (UTOverTranspor),
Axis1 I think it's not support.
Axis2, It works fine. with Rampart
private static Policy loadPolicy(String name) throws Exception {
// ClassLoader loader = ABCAxis2Client.class.getClassLoader();
// InputStream resource = loader.getResourceAsStream(name);
StAXOMBuilder builder = new StAXOMBuilder("C:/Users/apichaic/Downloads/j-jws4/jws04code/plain-policy-client1.xml");
System.out.println(builder.toString());
return PolicyEngine.getPolicy(builder.getDocumentElement());
}
/**
* @param args
*/
public static void main(String[] args) throws Exception {
// ConfigurationContext ctx =
// ConfigurationContextFactory.createConfigurationContextFromFileSystem("path/to/client/repo",
// null);
ABCServiceStub stub = new ABCServiceStub();
if (true) {
ServiceClient client = stub._getServiceClient();
Options options = client.getOptions();
options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, loadPolicy(null));
options.setUserName("admin");
options.setPassword("admin");
client.engageModule("rampart");
}
/*
* HTTP-Basic Authentication
*/
if (false) {
// ServiceClient sc = stub._getServiceClient();
// Options options = sc.getOptions();
// HttpTransportProperties.Authenticator auth = new
// HttpTransportProperties.Authenticator();
// auth.setPreemptiveAuthentication(true);
// auth.setUsername("admin");
// auth.setPassword("admin");
//
// List
// authSchemes.add(HttpTransportProperties.Authenticator.BASIC);
// auth.setAuthSchemes(authSchemes);
// options.setProperty(HTTPConstants.AUTHENTICATE, auth);
// options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
}
InquiryABC inquiryABC = new InquiryABC();
RequestBean requestBean = new RequestBean();
requestBean.setReferenceId("refId:" + System.currentTimeMillis());
inquiryABC.setRequestBean(requestBean);
InquiryABCResponse response = stub.inquiryABC(inquiryABC);
System.out.println(ToStringBuilder.reflectionToString(response));
System.out.println(ToStringBuilder.reflectionToString(response.getInquiryABCReturn()));
System.out.println(response.getInquiryABCReturn().getStatusCode());
System.out.println(response.getInquiryABCReturn().getResponseId());
System.out.println(response.getInquiryABCReturn().getStatueDescription());
Policy.xml, Copy from wso2proxy wsdl
ไม่มีความคิดเห็น:
แสดงความคิดเห็น