KrishNaveen / wsdl2objc

Automatically exported from code.google.com/p/wsdl2objc
MIT License
0 stars 0 forks source link

wsdl private! #150

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

binding of my Web Service.
<wsdl:binding name="serviceSoapBinding" type="impl:service">
    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="RFC">
        <wsdlsoap:operation soapAction=""/>
        <wsdl:input name="RFCRequest">
            <wsdlsoap:body use="literal"/>
        </wsdl:input>
        <wsdl:output name="RFCResponse">
            <wsdlsoap:body use="literal"/>
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>

<wsdl:service name="serviceService">
    <wsdl:port binding="impl:serviceSoapBinding" name="service">
        <wsdlsoap:address location="http://10.0.1.2:8080/SAP01/services/service"/>
    </wsdl:port>
</wsdl:service>

I have a Web Service installed on a Tomcat 7 server on a server mac ox, when 
try to access the wsdl from iphone, given a problem that the server is private, 
I have no idea referred to, if you need to configure anything in iOS, or rather 
is in the wsdl.

wsdl created in eclipse Helios 3.6, i'm calling from iphone Xcode Version 4.0 
with wsdl2objc, I need an explanation to integrate this web service in iOS do 
not understand the management of credentials by iOS.

code iOS
    serviceSoapBinding *binding = [[serviceService serviceSoapBinding]
                                        initWithAddress:@"http://10.0.1.2:8080/SAP01/services/service"];
    binding.logXMLInOut = YES; 

    NSDictionary *credentials = [NSDictionary dictionaryWithObjectsAndKeys:
                                 @"my username", @"lol",
                                 @"my password", @"lol",
                                 nil];
    NSDictionary *authProperties = [NSDictionary dictionaryWithObject:credentials 
                                                               forKey:NSURLAuthenticationMethodHTTPBasic];
    binding.authPassword = @"lol";
    binding.authUsername = @"lol";

    serviceService_RFC *request = [[serviceService_RFC alloc] init];
    request.host = @"192.168.200.109";
    request.user = @"prueba";
    request.prog_name = @"Z_DOWNLOAD_JGF";

    serviceSoapBindingResponse *response = [binding RFCUsingParameters:request];

    NSArray *responseBodyParts = response.bodyParts;

    for(id bodyPart in responseBodyParts) {
        if([bodyPart isKindOfClass:[serviceService_RFCResponse class]]) {
            serviceService_RFCResponse *body = (serviceService_RFCResponse*)bodyPart;
            field.text = body.RFCReturn;
        }
    }

result in iOS.
2011-06-21 09:05:02.698 WEB[835:207] ResponseHeaders:
{
    Connection = close;
    "Content-Type" = "text/xml;charset=utf-8";
    Date = "Tue, 21 Jun 2011 14:57:36 GMT";
    Server = "Apache-Coyote/1.1";
    "Transfer-Encoding" = Identity;
}
2011-06-21 09:05:02.699 WEB[835:207] ResponseBody:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>
                soapenv:Server.userException
            </faultcode>
            <faultstring>
                java.lang.reflect.InvocationTargetException
            </faultstring>
            <detail>
                <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">
                    serverPC.private
                </ns1:hostname>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

Original issue reported on code.google.com by enanos...@gmail.com on 21 Jun 2011 at 3:16