Wednesday, January 25, 2017

add soap authentication header in soap request

VinDecodingServiceServiceLocator locator = new VinDecodingServiceServiceLocator(); VinDecodingService_PortType service = locator.getVinDecodingService(new URL("https://host_ip/apis/services/VinDecodingService")); org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub) service; SOAPHeaderElement header = new SOAPHeaderElement("urn:yournamespace", "AuthenticationHeader"); SOAPElement node = header.addChildElement("username"); node.addTextNode("joedone"); SOAPElement node1 = header.addChildElement("password"); node1.addTextNode("8b67e624r"); ((Stub) service).setHeader(header); stub.setHeader(header); VinDecodingResponse res = service.decode("US", 233706, "PRIOS", "2C4RC1BG1ER178205"); //test System.out.println(res.getStatus())

No comments:

Post a Comment