Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix example (client) #31

Open
MauroMombelli opened this issue Oct 14, 2014 · 0 comments
Open

fix example (client) #31

MauroMombelli opened this issue Oct 14, 2014 · 0 comments

Comments

@MauroMombelli
Copy link

I've found some error in the default example:

Request request

is using object Request that does not exist anymore, and String should be used now.

String response = client.post(request);

send a void SOAPEvent header witch cause a 500 server's error, changing to
String response = client.post("http://www.webserviceX.NET/ConversionRate",request);

fix it.

Fixed example code:
Wsdl wsdl = Wsdl.parse("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL");

    SoapBuilder builder = wsdl.binding()
        .localPart("CurrencyConvertorSoap")
        .find();
    SoapOperation operation = builder.operation()
        .soapAction("http://www.webserviceX.NET/ConversionRate")
        .find();
    String request = builder.buildInputMessage(operation);

    Security s = Security.builder().authBasic("admin", "admin").build();

    SoapClient client = SoapClient.builder()
        .endpointUri("http://www.webservicex.net/CurrencyConvertor.asmx").endpointSecurity(s)
        .build();

    System.out.println(request);

    String response = client.post("http://www.webserviceX.NET/ConversionRate",request);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant