Last active
August 29, 2015 13:56
-
-
Save jvz/9030105 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.IOException; | |
import org.apache.http.client.fluent.Request; | |
import org.apache.http.client.fluent.Response; | |
import org.apache.http.entity.ContentType; | |
/** | |
* @author msicker | |
* @version 1.0 | |
*/ | |
public class PostSoap { | |
public static void main( final String... args ) | |
throws IOException { | |
final String url = args[ 0 ].trim(); | |
final String soapAction = args[ 1 ].trim(); | |
final String inputFileName = args[ 2 ].trim(); | |
final File inputFile = new File( inputFileName ); | |
final Response response = Request.Post( url ) | |
.addHeader( "SOAPAction", soapAction.equalsIgnoreCase( "none" ) ? "" : soapAction ) | |
.bodyFile( inputFile, ContentType.parse( "application/soap+xml" ) ) | |
.execute(); | |
System.out.println(response.returnContent().asString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment